diff --git a/.github/lock.yml b/.github/lock.yml deleted file mode 100644 index c5ceff66b0..0000000000 --- a/.github/lock.yml +++ /dev/null @@ -1,40 +0,0 @@ -# -# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app -# - -# Number of days of inactivity before a closed issue or pull request is locked -daysUntilLock: 60 - -# Skip issues and pull requests created before a given timestamp. Timestamp must -# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable -skipCreatedBefore: false - -# Issues and pull requests with these labels will be ignored. Set to `[]` to disable -exemptLabels: [ 'no-locking' ] - -# Label to add before locking, such as `outdated`. Set to `false` to disable -lockLabel: false - -# Comment to post before locking. Set to `false` to disable -lockComment: > - This thread has been automatically locked since there has not been - any recent activity after it was closed. Please open a new issue for - related bugs. - -# Assign `resolved` as the reason for locking. Set to `false` to disable -setLockReason: true - -# Limit to only `issues` or `pulls` -# only: issues - -# Optionally, specify configuration settings just for `issues` or `pulls` -# issues: -# exemptLabels: -# - help-wanted -# lockLabel: outdated - -# pulls: -# daysUntilLock: 30 - -# Repository to extend settings from -# _extends: repo diff --git a/.github/workflows/bump-date.yml b/.github/workflows/bump-date.yml index a08eeea561..2d3fd1f33d 100644 --- a/.github/workflows/bump-date.yml +++ b/.github/workflows/bump-date.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Check out bugfix-2.0.x - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: bugfix-2.0.x @@ -39,7 +39,7 @@ jobs: exit 0 - name: Check out bugfix-2.1.x - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: bugfix-2.1.x diff --git a/.github/workflows/test-builds.yml b/.github/workflows/ci-build-tests.yml similarity index 93% rename from .github/workflows/test-builds.yml rename to .github/workflows/ci-build-tests.yml index 7c62b5af6c..546faa5f38 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/ci-build-tests.yml @@ -1,9 +1,9 @@ # -# test-builds.yml +# ci-build-tests.yml # Do test builds to catch compile errors # -name: CI +name: CI - Build Tests on: pull_request: @@ -14,6 +14,8 @@ on: - config/** - data/** - docs/** + - test/** + - Marlin/tests/** - '**/*.md' push: branches: @@ -23,11 +25,13 @@ on: - config/** - data/** - docs/** + - test/** + - Marlin/tests/** - '**/*.md' jobs: test_builds: - name: Run All Tests + name: Build Test if: github.repository == 'MarlinFirmware/Marlin' runs-on: ubuntu-latest @@ -152,7 +156,7 @@ jobs: uses: actions/checkout@v4 - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} @@ -160,13 +164,13 @@ jobs: ${{ runner.os }}-pip- - name: Cache PlatformIO - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - name: Select Python 3.9 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.9' architecture: 'x64' diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml new file mode 100644 index 0000000000..caed5b1fbc --- /dev/null +++ b/.github/workflows/ci-unit-tests.yml @@ -0,0 +1,73 @@ +# +# ci-unit-tests.yml +# Build and execute unit tests to catch functional issues in code +# + +name: CI - Unit Tests + +on: + pull_request: + branches: + - bugfix-2.1.x + # Cannot be enabled on 2.1.x until it contains the unit test framework + #- 2.1.x + paths-ignore: + - config/** + - data/** + - docs/** + - '**/*.md' + push: + branches: + - bugfix-2.1.x + # Cannot be enabled on 2.1.x until it contains the unit test framework + #- 2.1.x + paths-ignore: + - config/** + - data/** + - docs/** + - '**/*.md' + +jobs: + # This runs all unit tests as a single job. While it should be possible to break this up into + # multiple jobs, they currently run quickly and finish long before the compilation tests. + run_unit_tests: + name: Unit Test + # These tests will only be able to run on the bugfix-2.1.x branch, until the next release + # pulls them into additional branches. + if: github.repository == 'MarlinFirmware/Marlin' + + runs-on: ubuntu-latest + + steps: + - name: Check out the PR + uses: actions/checkout@v4 + + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Cache PlatformIO + uses: actions/cache@v4 + with: + path: ~/.platformio + key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} + + - name: Select Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: '3.9' + architecture: 'x64' + + - name: Install PlatformIO + run: | + pip install -U platformio + pio upgrade --dev + pio pkg update --global + + - name: Run All Unit Tests + run: | + make unit-test-all-local diff --git a/.github/workflows/ci-validate-pins.yml b/.github/workflows/ci-validate-pins.yml new file mode 100644 index 0000000000..e093eb92c7 --- /dev/null +++ b/.github/workflows/ci-validate-pins.yml @@ -0,0 +1,51 @@ +# +# ci-validate-pins.yml +# Validate that all of the pins files are unchanged by pinsformat.py +# + +name: CI - Validate Pins Files + +on: + pull_request: + branches: + - bugfix-2.1.x + # Cannot be enabled on 2.1.x until it contains the unit test framework + #- 2.1.x + paths: + - 'Marlin/src/pins/*/**' + push: + branches: + - bugfix-2.1.x + # Cannot be enabled on 2.1.x until it contains the unit test framework + #- 2.1.x + paths: + - 'Marlin/src/pins/*/**' + +jobs: + validate_pins_files: + name: Validate Pins Files + if: github.repository == 'MarlinFirmware/Marlin' + + runs-on: ubuntu-latest + + steps: + - name: Check out the PR + uses: actions/checkout@v4 + + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Select Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: '3.9' + architecture: 'x64' + + - name: Validate all pins files + run: | + make validate-pins -j diff --git a/.github/workflows/clean-closed.yml b/.github/workflows/clean-closed.yml index 318d083dfa..3f370a4362 100644 --- a/.github/workflows/clean-closed.yml +++ b/.github/workflows/clean-closed.yml @@ -32,7 +32,7 @@ jobs: - "Needs: Work" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Remove Labels uses: actions-ecosystem/action-remove-labels@v1 with: diff --git a/.github/workflows/close-stale.yml b/.github/workflows/close-stale.yml index 397f9b5ea6..55e19de566 100644 --- a/.github/workflows/close-stale.yml +++ b/.github/workflows/close-stale.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/stale@v8 + - uses: actions/stale@v9 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: | diff --git a/.github/workflows/lock-closed.yml b/.github/workflows/lock-closed.yml index 8cdcd7a836..6392f244b5 100644 --- a/.github/workflows/lock-closed.yml +++ b/.github/workflows/lock-closed.yml @@ -17,15 +17,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v2 + - uses: dessant/lock-threads@v5 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: > + issue-inactive-days: '60' + exclude-issue-created-before: '' + exclude-any-issue-labels: 'no-locking' + add-issue-labels: '' + issue-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. diff --git a/Makefile b/Makefile index bc26173aaf..02722b9ca2 100644 --- a/Makefile +++ b/Makefile @@ -2,17 +2,23 @@ SCRIPTS_DIR := buildroot/share/scripts CONTAINER_RT_BIN := docker CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio CONTAINER_IMAGE := marlin-dev +UNIT_TEST_CONFIG ?= default help: @echo "Tasks for local development:" @echo "make marlin : Build marlin for the configured board" - @echo "make format-pins : Reformat all pins files" + @echo "make format-pins -j : Reformat all pins files (-j for parallel execution)" + @echo "make validate-pins -j : Validate all pins files, fails if any require reformatting" @echo "make tests-single-ci : Run a single test from inside the CI" @echo "make tests-single-local : Run a single test locally" @echo "make tests-single-local-docker : Run a single test locally, using docker" @echo "make tests-all-local : Run all tests locally" @echo "make tests-all-local-docker : Run all tests locally, using docker" - @echo "make setup-local-docker : Build the local docker image" + @echo "make unit-test-single-local : Run unit tests for a single config locally" + @echo "make unit-test-single-local-docker : Run unit tests for a single config locally, using docker" + @echo "make unit-test-all-local : Run all code tests locally" + @echo "make unit-test-all-local-docker : Run all code tests locally, using docker" + @echo "make setup-local-docker : Setup local docker using buildx" @echo "" @echo "Options for testing:" @echo " TEST_TARGET Set when running tests-single-*, to select the" @@ -22,6 +28,9 @@ help: @echo " run on GitHub CI" @echo " ONLY_TEST Limit tests to only those that contain this, or" @echo " the index of the test (1-based)" + @echo " UNIT_TEST_CONFIG Set the name of the config from the test folder, without" + @echo " the leading number. Default is 'default'". Used with the + @echo " unit-test-single-* tasks" @echo " VERBOSE_PLATFORMIO If you want the full PIO output, set any value" @echo " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:" @echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!" @@ -43,23 +52,53 @@ tests-single-local: tests-single-local-docker: @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET= or use make tests-all-local-docker" ; return 1; fi @if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi - $(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)" + $(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)" tests-all-local: + @python -c "import yaml" 2>/dev/null || (echo 'pyyaml module is not installed. Install it with "python -m pip install pyyaml"' && exit 1) export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ - && for TEST_TARGET in $$($(SCRIPTS_DIR)/get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done + && for TEST_TARGET in $$(python $(SCRIPTS_DIR)/get_test_targets.py) ; do \ + if [ "$$TEST_TARGET" = "linux_native" ] && [ "$$(uname)" = "Darwin" ]; then \ + echo "Skipping tests for $$TEST_TARGET on macOS" ; \ + continue ; \ + fi ; \ + echo "Running tests for $$TEST_TARGET" ; \ + run_tests . $$TEST_TARGET || exit 1 ; \ + sleep 5; \ + done tests-all-local-docker: @if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi - $(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) + $(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) + +unit-test-single-local: + platformio run -t marlin_$(UNIT_TEST_CONFIG) -e linux_native_test + +unit-test-single-local-docker: + @if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi + $(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make unit-test-single-local UNIT_TEST_CONFIG=$(UNIT_TEST_CONFIG) + +unit-test-all-local: + platformio run -t test-marlin -e linux_native_test + +unit-test-all-local-docker: + @if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi + $(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make unit-test-all-local setup-local-docker: - $(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile . + $(CONTAINER_RT_BIN) buildx build -t $(CONTAINER_IMAGE) -f docker/Dockerfile . PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h') +.PHONY: $(PINS) format-pins validate-pins + $(PINS): %: - @echo "Formatting $@" && node $(SCRIPTS_DIR)/pinsformat.js $@ + @echo "Formatting $@" + @python $(SCRIPTS_DIR)/pinsformat.py $< $@ format-pins: $(PINS) + +validate-pins: format-pins + @echo "Validating pins files" + @git diff --exit-code || (git status && echo "\nError: Pins files are not formatted correctly. Run \"make format-pins\" to fix.\n" && exit 1) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c12bed8afd..df38e88b75 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -135,9 +135,9 @@ * Options: A4988, A5984, DRV8825, LV8729, TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, - * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, - * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * TMC2660, TMC2660_STANDALONE, TMC5130, TMC5130_STANDALONE, + * TMC5160, TMC5160_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE TMC5160_STANDALONE #define Y_DRIVER_TYPE TMC5160_STANDALONE @@ -401,9 +401,18 @@ //#define PS_OFF_SOUND // Beep 1s when power off #define PSU_ACTIVE_STATE HIGH // Set 'LOW' for ATX, 'HIGH' for X-Box - #define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 - #define PSU_POWERUP_DELAY 750 // (ms) Delay for the PSU to warm up to full power - //#define LED_POWEROFF_TIMEOUT 10000 // (ms) Turn off LEDs after power-off, with this amount of delay + //#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 + //#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power + //#define LED_POWEROFF_TIMEOUT 10000 // (ms) Turn off LEDs after power-off, with this amount of delay + + //#define PSU_OFF_REDUNDANT // Second pin for redundant power control + //#define PSU_OFF_REDUNDANT_INVERTED // Redundant pin state is the inverse of PSU_ACTIVE_STATE + + //#define PS_ON1_PIN 6 // Redundant pin required to enable power in combination with PS_ON_PIN + + //#define PS_ON_EDM_PIN 8 // External Device Monitoring pins for external power control relay feedback. Fault on mismatch. + //#define PS_ON1_EDM_PIN 9 + #define PS_EDM_RESPONSE 250 // (ms) Time to allow for relay action #define PSU_OFF_REDUNDANT // Second pin for redundant power control //#define PSU_OFF_REDUNDANT_OPPOSING // Redundant pin works opposite standard pin @@ -672,7 +681,7 @@ * MPCTEMP : Predictive Model temperature control. (~1.8K without auto-tune) */ #define PIDTEMP // See the PID Tuning Guide at https://reprap.org/wiki/PID_Tuning -//#define MPCTEMP // ** EXPERIMENTAL ** See https://marlinfw.org/docs/features/model_predictive_control.html +//#define MPCTEMP // See https://marlinfw.org/docs/features/model_predictive_control.html #define PID_MAX 255 // Limit hotend current while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current #define PID_K1 0.95 // Smoothing factor within any PID loop @@ -1015,9 +1024,6 @@ // Radius around the center where the arm cannot reach #define MIDDLE_DEAD_ZONE_R 0 // (mm) - #define THETA_HOMING_OFFSET 0 // Calculated from Calibration Guide and M360 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/ - #define PSI_HOMING_OFFSET 0 // Calculated from Calibration Guide and M364 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/ - #elif ENABLED(MP_SCARA) #define SCARA_OFFSET_THETA1 12 // degrees @@ -1036,23 +1042,19 @@ #define DEFAULT_SEGMENTS_PER_SECOND 200 // Length of inner and outer support arms. Measure arm lengths precisely. - #define TPARA_LINKAGE_1 120 // (mm) - #define TPARA_LINKAGE_2 120 // (mm) + #define TPARA_LINKAGE_1 120 // (mm) + #define TPARA_LINKAGE_2 120 // (mm) - // SCARA tower offset (position of Tower relative to bed zero position) - // This needs to be reasonably accurate as it defines the printbed position in the SCARA space. - #define TPARA_OFFSET_X 0 // (mm) - #define TPARA_OFFSET_Y 0 // (mm) - #define TPARA_OFFSET_Z 0 // (mm) + // TPARA tower offset (position of Tower relative to bed zero position) + // This needs to be reasonably accurate as it defines the printbed position in the TPARA space. + #define TPARA_OFFSET_X 0 // (mm) + #define TPARA_OFFSET_Y 0 // (mm) + #define TPARA_OFFSET_Z 0 // (mm) #define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly // Radius around the center where the arm cannot reach #define MIDDLE_DEAD_ZONE_R 0 // (mm) - - // Calculated from Calibration Guide and M360 / M114. See https://www.morgan3dp.com/morgan-calibration-guide/ - #define THETA_HOMING_OFFSET 0 - #define PSI_HOMING_OFFSET 0 #endif // @section polar @@ -1300,6 +1302,7 @@ #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.3 + #define DEFAULT_EJERK 5.0 //#define DEFAULT_IJERK 0.3 //#define DEFAULT_JJERK 0.3 //#define DEFAULT_KJERK 0.3 @@ -1315,8 +1318,6 @@ #endif #endif -#define DEFAULT_EJERK 5.0 // May be used by Linear Advance - /** * Junction Deviation Factor * @@ -1456,6 +1457,17 @@ //#define BD_SENSOR_PROBE_NO_STOP // Probe bed without stopping at each probe point #endif +/** + * BIQU MicroProbe + * + * A lightweight, solenoid-driven probe. + * For information about this sensor https://github.com/bigtreetech/MicroProbe + * + * Also requires: PROBE_ENABLE_DISABLE + */ +//#define BIQU_MICROPROBE_V1 // Triggers HIGH +//#define BIQU_MICROPROBE_V2 // Triggers LOW + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE @@ -2215,7 +2227,7 @@ #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 tramming points - #define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between tramming points + #define BED_TRAMMING_Z_HOP 4.0 // (mm) Z raise between tramming 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) @@ -2633,9 +2645,9 @@ #define DISPLAY_CHARSET_HD44780 JAPANESE /** - * Info Screen Style (0:Classic, 1:Průša) + * Info Screen Style (0:Classic, 1:Průša, 2:CNC) * - * :[0:'Classic', 1:'Průša'] + * :[0:'Classic', 1:'Průša', 2:'CNC'] */ #define LCD_INFO_SCREEN_STYLE 0 @@ -3036,7 +3048,7 @@ // // Factory display for Creality CR-10 / CR-7 / Ender-3 -// https://www.aliexpress.com/item/32833148327.html +// https://marlinfw.org/docs/hardware/controllers.html#cr10_stockdisplay // // Connect to EXP1 on RAMPS and compatible boards. // @@ -3413,7 +3425,6 @@ #define BUTTON_DELAY_MENU 250 // (ms) Button repeat delay for menus //#define DISABLE_ENCODER // Disable the click encoder, if any - //#define TOUCH_IDLE_SLEEP_MINS 5 // (minutes) Display Sleep after a period of inactivity. Set with M255 S. #define TOUCH_SCREEN_CALIBRATION diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index f8aca9aa99..bdf4a42e08 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -459,7 +459,7 @@ #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 #else - #define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed) + #define PID_FAN_SCALING_LIN_FACTOR (0) // Power-loss due to cooling = Kf * (fan_speed) #define DEFAULT_Kf 10 // A constant value added to the PID-tuner #define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING #endif @@ -1185,33 +1185,32 @@ * Zero Vibration (ZV) Input Shaping for X and/or Y movements. * * This option uses a lot of SRAM for the step buffer. The buffer size is - * calculated automatically from SHAPING_FREQ_[XY], DEFAULT_AXIS_STEPS_PER_UNIT, + * calculated automatically from SHAPING_FREQ_[XYZ], DEFAULT_AXIS_STEPS_PER_UNIT, * DEFAULT_MAX_FEEDRATE and ADAPTIVE_STEP_SMOOTHING. The default calculation can * be overridden by setting SHAPING_MIN_FREQ and/or SHAPING_MAX_FEEDRATE. * The higher the frequency and the lower the feedrate, the smaller the buffer. * If the buffer is too small at runtime, input shaping will have reduced * effectiveness during high speed movements. * - * Tune with M593 D F: - * - * D Set the zeta/damping factor. If axes (X, Y, etc.) are not specified, set for all axes. - * F Set the frequency. If axes (X, Y, etc.) are not specified, set for all axes. - * T[map] Input Shaping type, 0:ZV, 1:EI, 2:2H EI (not implemented yet) - * X<1> Set the given parameters only for the X axis. - * Y<1> Set the given parameters only for the Y axis. + * Tune with M593 D F */ //#define INPUT_SHAPING_X //#define INPUT_SHAPING_Y -#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y) +//#define INPUT_SHAPING_Z +#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y, INPUT_SHAPING_Z) #if ENABLED(INPUT_SHAPING_X) - #define SHAPING_FREQ_X 40 // (Hz) The default dominant resonant frequency on the X axis. - #define SHAPING_ZETA_X 0.15f // Damping ratio of the X axis (range: 0.0 = no damping to 1.0 = critical damping). + #define SHAPING_FREQ_X 40.0 // (Hz) The default dominant resonant frequency on the X axis. + #define SHAPING_ZETA_X 0.15 // Damping ratio of the X axis (range: 0.0 = no damping to 1.0 = critical damping). #endif #if ENABLED(INPUT_SHAPING_Y) - #define SHAPING_FREQ_Y 40 // (Hz) The default dominant resonant frequency on the Y axis. - #define SHAPING_ZETA_Y 0.15f // Damping ratio of the Y axis (range: 0.0 = no damping to 1.0 = critical damping). + #define SHAPING_FREQ_Y 40.0 // (Hz) The default dominant resonant frequency on the Y axis. + #define SHAPING_ZETA_Y 0.15 // Damping ratio of the Y axis (range: 0.0 = no damping to 1.0 = critical damping). #endif - //#define SHAPING_MIN_FREQ 20 // By default the minimum of the shaping frequencies. Override to affect SRAM usage. + #if ENABLED(INPUT_SHAPING_Z) + #define SHAPING_FREQ_Z 40.0 // (Hz) The default dominant resonant frequency on the Z axis. + #define SHAPING_ZETA_Z 0.15 // Damping ratio of the Z axis (range: 0.0 = no damping to 1.0 = critical damping). + #endif + //#define SHAPING_MIN_FREQ 20.0 // (Hz) By default the minimum of the shaping frequencies. Override to affect SRAM usage. //#define SHAPING_MAX_STEPRATE 10000 // By default the maximum total step rate of the shaped axes. Override to affect SRAM usage. //#define SHAPING_MENU // Add a menu to the LCD to set shaping parameters. #endif @@ -1270,11 +1269,11 @@ * XY Frequency limit * Reduce resonance by limiting the frequency of small zigzag infill moves. * See https://hydraraptor.blogspot.com/2010/12/frequency-limit.html - * Use M201 F G to change limits at runtime. + * Use M201 F S to change limits at runtime. */ //#define XY_FREQUENCY_LIMIT 10 // (Hz) Maximum frequency of small zigzag infill moves. Set with M201 F. #ifdef XY_FREQUENCY_LIMIT - #define XY_FREQUENCY_MIN_PERCENT 5 // (%) Minimum FR percentage to apply. Set with M201 G. + #define XY_FREQUENCY_MIN_PERCENT 5 // (%) Minimum FR percentage to apply. Set with M201 S. #endif // @@ -1474,6 +1473,7 @@ #if IS_ULTIPANEL #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" #define ULTIPANEL_FEEDMULTIPLY // Encoder sets the feedrate multiplier on the Status Screen + //#define ULTIPANEL_FLOWPERCENT // Encoder sets the flow percentage on the Status Screen #endif #endif @@ -1539,6 +1539,7 @@ * Axis moves <= 1/2 the axis length and Extruder moves <= EXTRUDE_MAXLENGTH * will be shown in the move submenus. */ + #define MANUAL_MOVE_DISTANCE_MM 10, 1.0, 0.1 // (mm) //#define MANUAL_MOVE_DISTANCE_MM 100, 50, 10, 1.0, 0.1 // (mm) //#define MANUAL_MOVE_DISTANCE_MM 500, 100, 50, 10, 1.0, 0.1 // (mm) @@ -1582,7 +1583,7 @@ #if HAS_MARLINUI_U8GLIB #define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash. #endif - #if ANY(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE) + #if ANY(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, HAS_MARLINUI_HD44780) //#define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup. #endif #endif @@ -1743,21 +1744,26 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) - #define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500) + #define PLR_ENABLED_DEFAULT false // Power-Loss Recovery enabled by default. (Set with 'M413 Sn' & M500) //#define PLR_BED_THRESHOLD BED_MAXTEMP // (°C) Skip user confirmation at or above this bed temperature (0 to disable) - //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss - //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module. - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + + //#define POWER_LOSS_PIN 44 // Pin to detect power-loss. Set to -1 to disable default pin on boards without module, or comment to use board default. + //#define POWER_LOSS_STATE HIGH // State of pin indicating power-loss //#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor //#define POWER_LOSS_PULLDOWN - //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume - //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power-loss with UPS) + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, // especially with "vase mode" printing. Set too high and vases cannot be continued. #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power-loss + #if ENABLED(BACKUP_POWER_SUPPLY) + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail + #endif + // Enable if Z homing is needed for proper recovery. 99.9% of the time this should be disabled! //#define POWER_LOSS_RECOVER_ZHOME #if ENABLED(POWER_LOSS_RECOVER_ZHOME) @@ -1963,17 +1969,6 @@ // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. //#define USE_SMALL_INFOFONT - /** - * Graphical Display Sleep - * - * The U8G library provides sleep / wake functions for SH1106, SSD1306, - * SSD1309, and some other DOGM displays. - * Enable this option to save energy and prevent OLED pixel burn-in. - * Adds the menu item Configuration > LCD Timeout (m) to set a wait period - * from 0 (disabled) to 99 minutes. - */ - //#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen. Set with M255 S. - /** * ST7920-based LCDs can emulate a 16 x 4 character display using * the ST7920 character-generator for very fast screen updates. @@ -2222,13 +2217,20 @@ //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan #endif -// -// LCD Backlight Timeout -// Requires a display with a controllable backlight -// +/** + * Display Sleep + * Enable this option to save energy and prevent OLED pixel burn-in. + */ +//#define DISPLAY_SLEEP_MINUTES 2 // (minutes) Timeout before turning off the screen + +/** + * LCD Backlight Timeout + * Requires a display with a controllable backlight + */ //#define LCD_BACKLIGHT_TIMEOUT_MINS 1 // (minutes) Timeout before turning off the backlight + #if defined(DISPLAY_SLEEP_MINUTES) || defined(LCD_BACKLIGHT_TIMEOUT_MINS) - #define EDITABLE_DISPLAY_TIMEOUT // Edit timeout with M255 S and a menu item + #define EDITABLE_DISPLAY_TIMEOUT // Edit sleep / backlight timeout with M255 S and a menu item #endif // @@ -2319,7 +2321,6 @@ #endif //#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L. //#define LA_DEBUG // Print debug information to serial during operation. Disable for production use. - #define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends. //#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz. #endif @@ -2696,7 +2697,7 @@ * This feature is EXPERIMENTAL so use with caution and test thoroughly. * Enable this option to receive data on the serial ports via the onboard DMA * controller for more stable and reliable high-speed serial communication. - * Only some STM32 MCUs are currently supported. + * Support is currently limited to some STM32 MCUs and all HC32 MCUs. * Note: This has no effect on emulated USB serial ports. */ //#define SERIAL_DMA @@ -2951,15 +2952,12 @@ * Some boards have simple jumper connections! See your board's documentation. * - These drivers can also be used with Hardware Serial. * - * The TMC26XStepper library is required for TMC26X stepper drivers. - * https://github.com/MarlinFirmware/TMC26XStepper - * * The TMCStepper library is required for other TMC stepper drivers. * https://github.com/teemuatlut/TMCStepper * * @section tmc/config */ -#if HAS_TRINAMIC_CONFIG || HAS_TMC26X +#if HAS_TRINAMIC_CONFIG #define HOLD_MULTIPLIER 0.7 // Scales down the holding current from run current @@ -2973,7 +2971,7 @@ #define X_CURRENT 800 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_CURRENT_HOME X_CURRENT // (mA) RMS current for sensorless homing #define X_MICROSTEPS 16 // 0..256 - #define X_RSENSE 0.022 // Multiplied x1000 for TMC26X + #define X_RSENSE 0.022 #define X_CHAIN_POS -1 // -1..0: Not chained. 1: MCU MOSI connected. 2: Next in chain, ... //#define X_INTERPOLATE true // Enable to override 'INTERPOLATE' for the X axis //#define X_HOLD_MULTIPLIER 0.5 // Enable to override 'HOLD_MULTIPLIER' for the X axis @@ -3466,7 +3464,7 @@ */ #define TMC_ADV() { } -#endif // HAS_TRINAMIC_CONFIG || HAS_TMC26X +#endif // HAS_TRINAMIC_CONFIG // @section i2cbus @@ -3559,7 +3557,7 @@ * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and * to set spindle speed, spindle direction, and laser power. * - * SuperPid is a router/spindle speed controller used in the CNC milling community. + * SuperPID is a router/spindle speed controller used in the CNC milling community. * Marlin can be used to turn the spindle on and off. It can also be used to set * the spindle speed from 5,000 to 30,000 RPM. * @@ -4262,7 +4260,8 @@ /** * Instant freeze / unfreeze functionality - * Potentially useful for emergency stop that allows being resumed. + * Potentially useful for rapid stop that allows being resumed. Halts stepper movement. + * Note this does NOT pause spindles, lasers, fans, heaters or any other auxiliary device. * @section interface */ //#define FREEZE_FEATURE @@ -4309,6 +4308,7 @@ // See class CodeProfiler. //#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multi-stepping 1 to 128 on this LED matrix row. //#define MAX7219_DEBUG_SLOWDOWN 6 // Count (mod 16) how many times SLOWDOWN has reduced print speed. + //#define MAX7219_REINIT_ON_POWERUP // Re-initialize MAX7129 when power supply turns on #endif /** @@ -4342,7 +4342,7 @@ * Extras for an ESP32-based motherboard with WIFISUPPORT * These options don't apply to add-on WiFi modules based on ESP32 WiFi101. */ -#if ENABLED(WIFISUPPORT) +#if ANY(WIFISUPPORT, ESP3D_WIFISUPPORT) //#define WEBSUPPORT // Start a webserver (which may include auto-discovery) using SPIFFS //#define OTASUPPORT // Support over-the-air firmware updates //#define WIFI_CUSTOM_COMMAND // Accept feature config commands (e.g., WiFi ESP3D) from the host @@ -4525,3 +4525,6 @@ // Report uncleaned reset reason from register r2 instead of MCUSR. Supported by Optiboot on AVR. //#define OPTIBOOT_RESET_REASON + +// Shrink the build for smaller boards by sacrificing some serial feedback +//#define MARLIN_SMALL_BUILD diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino index 81652000a8..066cc1717d 100644 --- a/Marlin/Marlin.ino +++ b/Marlin/Marlin.ino @@ -2,7 +2,7 @@ Marlin Firmware - (c) 2011-2023 MarlinFirmware + (c) 2011-2024 MarlinFirmware Portions of Marlin are (c) by their respective authors. All code complies with GPLv2 and/or GPLv3 diff --git a/Marlin/Version.h b/Marlin/Version.h index 808dafa70c..e24e66077b 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2024-01-14" +//#define STRING_DISTRIBUTION_DATE "2024-05-24" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/HAL/AVR/HAL_SPI.cpp b/Marlin/src/HAL/AVR/HAL_SPI.cpp index 32c0361d03..db6a12734d 100644 --- a/Marlin/src/HAL/AVR/HAL_SPI.cpp +++ b/Marlin/src/HAL/AVR/HAL_SPI.cpp @@ -119,7 +119,6 @@ void spiBegin() { while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ } } - /** begin spi transaction */ void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { // Based on Arduino SPI library @@ -175,7 +174,6 @@ void spiBegin() { SPSR = clockDiv | 0x01; } - #else // SOFTWARE_SPI || FORCE_SOFT_SPI // ------------------------ diff --git a/Marlin/src/HAL/AVR/Servo.cpp b/Marlin/src/HAL/AVR/Servo.cpp index 0a1ef5337a..8ce9bc11b8 100644 --- a/Marlin/src/HAL/AVR/Servo.cpp +++ b/Marlin/src/HAL/AVR/Servo.cpp @@ -63,7 +63,6 @@ static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval) - /************ static functions common to all instances ***********************/ static inline void handle_interrupts(const timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) { diff --git a/Marlin/src/HAL/AVR/eeprom.cpp b/Marlin/src/HAL/AVR/eeprom.cpp index 6465e47025..45c7abd1db 100644 --- a/Marlin/src/HAL/AVR/eeprom.cpp +++ b/Marlin/src/HAL/AVR/eeprom.cpp @@ -35,14 +35,14 @@ #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE size_t(E2END + 1) #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { return true; } bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { uint16_t written = 0; while (size--) { - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); uint8_t v = *value; if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); @@ -61,7 +61,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/AVR/endstop_interrupts.h b/Marlin/src/HAL/AVR/endstop_interrupts.h index 2532624d39..91cb336e24 100644 --- a/Marlin/src/HAL/AVR/endstop_interrupts.h +++ b/Marlin/src/HAL/AVR/endstop_interrupts.h @@ -91,7 +91,6 @@ void endstop_ISR() { endstops.update(); } #endif - // Install Pin change interrupt for a pin. Can be called multiple times. void pciSetup(const int8_t pin) { if (digitalPinHasPCICR(pin)) { diff --git a/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h b/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h index 0c434b157c..51c5e09658 100644 --- a/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h +++ b/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h @@ -679,7 +679,6 @@ #define PF7_PWM 0 #define PF7_DDR DDRF - /** * Some of the pin mapping functions of the Teensduino extension to the Arduino IDE * do not function the same as the other Arduino extensions. diff --git a/Marlin/src/HAL/AVR/inc/Conditionals_type.h b/Marlin/src/HAL/AVR/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/AVR/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/AVR/pinsDebug.h b/Marlin/src/HAL/AVR/pinsDebug.h index fc51f41ef8..15db63b4d7 100644 --- a/Marlin/src/HAL/AVR/pinsDebug.h +++ b/Marlin/src/HAL/AVR/pinsDebug.h @@ -163,7 +163,6 @@ bool pwm_status(uint8_t pin) { SERIAL_ECHO_SP(2); } // pwm_status - const volatile uint8_t* const PWM_other[][3] PROGMEM = { { &TCCR0A, &TCCR0B, &TIMSK0 }, { &TCCR1A, &TCCR1B, &TIMSK1 }, @@ -181,7 +180,6 @@ const volatile uint8_t* const PWM_other[][3] PROGMEM = { #endif }; - const volatile uint8_t* const PWM_OCR[][3] PROGMEM = { #ifdef TIMER0A @@ -217,7 +215,6 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = { #endif }; - #define TCCR_A(T) pgm_read_word(&PWM_other[T][0]) #define TCCR_B(T) pgm_read_word(&PWM_other[T][1]) #define TIMSK(T) pgm_read_word(&PWM_other[T][2]) diff --git a/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp b/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp index 79bafe2939..131174b06c 100644 --- a/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp +++ b/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp @@ -120,7 +120,6 @@ void u8g_spiSend_sw_AVR_mode_3(uint8_t val) { U8G_ATOMIC_END(); } - #if ENABLED(FYSETC_MINI_12864) #define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_3 #else diff --git a/Marlin/src/HAL/DUE/HAL_SPI.cpp b/Marlin/src/HAL/DUE/HAL_SPI.cpp index 63ebf164f2..c2fabb0d49 100644 --- a/Marlin/src/HAL/DUE/HAL_SPI.cpp +++ b/Marlin/src/HAL/DUE/HAL_SPI.cpp @@ -42,7 +42,7 @@ // Public functions // ------------------------ -#if ANY(DUE_SOFTWARE_SPI, FORCE_SOFT_SPI) +#if ANY(SOFTWARE_SPI, FORCE_SOFT_SPI) // ------------------------ // Software SPI diff --git a/Marlin/src/HAL/DUE/MarlinSerial.cpp b/Marlin/src/HAL/DUE/MarlinSerial.cpp index 638f7a1007..90efe55fc2 100644 --- a/Marlin/src/HAL/DUE/MarlinSerial.cpp +++ b/Marlin/src/HAL/DUE/MarlinSerial.cpp @@ -474,7 +474,6 @@ void MarlinSerial::flushTX() { } } - // If not using the USB port as serial port #if defined(SERIAL_PORT) && SERIAL_PORT >= 0 template class MarlinSerial< MarlinSerialCfg >; diff --git a/Marlin/src/HAL/DUE/eeprom_flash.cpp b/Marlin/src/HAL/DUE/eeprom_flash.cpp index a0ed6cc843..a5c7ab836d 100644 --- a/Marlin/src/HAL/DUE/eeprom_flash.cpp +++ b/Marlin/src/HAL/DUE/eeprom_flash.cpp @@ -958,14 +958,14 @@ static void ee_Init() { #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { ee_Init(); return true; } bool PersistentStore::access_finish() { ee_Flush(); return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { uint16_t written = 0; while (size--) { - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); uint8_t v = *value; if (v != ee_Read(uint32_t(p))) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! ee_Write(uint32_t(p), v); @@ -984,7 +984,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { - uint8_t c = ee_Read(uint32_t(pos)); + uint8_t c = ee_Read(uint32_t(REAL_EEPROM_ADDR(pos))); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/DUE/eeprom_wired.cpp b/Marlin/src/HAL/DUE/eeprom_wired.cpp index 24f8c06d2e..84338ccb4b 100644 --- a/Marlin/src/HAL/DUE/eeprom_wired.cpp +++ b/Marlin/src/HAL/DUE/eeprom_wired.cpp @@ -36,14 +36,14 @@ #ifndef MARLIN_EEPROM_SIZE #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM." #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { uint16_t written = 0; while (size--) { - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); uint8_t v = *value; if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); @@ -62,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp b/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp index 800915ff69..5cf86f147c 100644 --- a/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp +++ b/Marlin/src/HAL/DUE/fastio/G2_PWM.cpp @@ -61,7 +61,7 @@ #else #define G2_PWM_Z 0 #endif -#if PIN_EXISTS(MOTOR_CURRENT_PWM_E) +#if HAS_MOTOR_CURRENT_PWM_E #define G2_PWM_E 1 #else #define G2_PWM_E 0 diff --git a/Marlin/src/HAL/DUE/fastio/G2_PWM.h b/Marlin/src/HAL/DUE/fastio/G2_PWM.h index 2afe246cea..054eb2cf80 100644 --- a/Marlin/src/HAL/DUE/fastio/G2_PWM.h +++ b/Marlin/src/HAL/DUE/fastio/G2_PWM.h @@ -49,7 +49,6 @@ extern volatile uint32_t *SODR_A, *SODR_B, *CODR_A, *CODR_B; #define PWM_MAP_INIT_ROW(IO,ZZ) { ZZ == 'A' ? SODR_A : SODR_B, ZZ == 'A' ? CODR_A : CODR_B, 1 << _PIN(IO) } - #define PWM_MAP_INIT { PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_X_PIN, 'B'), \ PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Y_PIN, 'B'), \ PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Z_PIN, 'B'), \ diff --git a/Marlin/src/HAL/DUE/fastio/G2_pins.h b/Marlin/src/HAL/DUE/fastio/G2_pins.h index 80c87bd392..38fcc5e5df 100644 --- a/Marlin/src/HAL/DUE/fastio/G2_pins.h +++ b/Marlin/src/HAL/DUE/fastio/G2_pins.h @@ -168,7 +168,6 @@ const G2_PinDescription G2_g_APinDescription[] = { { PIOB, PIO_PB21, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 52 { PIOB, PIO_PB14, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 53 - // 54 .. 65 - Analog pins // ---------------------- { PIOA, PIO_PA16X1_AD7, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC0, ADC7, NOT_ON_PWM, NOT_ON_TIMER }, // AD0 diff --git a/Marlin/src/HAL/DUE/inc/Conditionals_type.h b/Marlin/src/HAL/DUE/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/DUE/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/DUE/inc/SanityCheck.h b/Marlin/src/HAL/DUE/inc/SanityCheck.h index a8f5de8298..1eaa2fbd8c 100644 --- a/Marlin/src/HAL/DUE/inc/SanityCheck.h +++ b/Marlin/src/HAL/DUE/inc/SanityCheck.h @@ -72,10 +72,10 @@ #if HAS_MEDIA && HAS_DRIVER(TMC2130) #if ENABLED(TMC_USE_SW_SPI) - #if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK)) + #if DISABLED(SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK)) #error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs." #endif - #elif ENABLED(DUE_SOFTWARE_SPI) + #elif ENABLED(SOFTWARE_SPI) #error "DUE software SPI is required but is incompatible with TMC2130 hardware SPI. Enable TMC_USE_SW_SPI to fix." #endif #endif diff --git a/Marlin/src/HAL/DUE/spi_pins.h b/Marlin/src/HAL/DUE/spi_pins.h index cec22c2c37..41ac7a8b58 100644 --- a/Marlin/src/HAL/DUE/spi_pins.h +++ b/Marlin/src/HAL/DUE/spi_pins.h @@ -48,7 +48,7 @@ #define SD_MOSI_PIN 75 #else // defaults - #define DUE_SOFTWARE_SPI + #define SOFTWARE_SPI #ifndef SD_SCK_PIN #define SD_SCK_PIN 52 #endif diff --git a/Marlin/src/HAL/DUE/usb/compiler.h b/Marlin/src/HAL/DUE/usb/compiler.h index 633197914e..27c554cdb7 100644 --- a/Marlin/src/HAL/DUE/usb/compiler.h +++ b/Marlin/src/HAL/DUE/usb/compiler.h @@ -142,7 +142,6 @@ */ #define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack()) - /** * \brief Set aligned boundary. */ @@ -283,7 +282,6 @@ typedef double F64; //!< 64-bit floating-point number. typedef uint32_t iram_size_t; //! @} - /*! \name Status Types */ //! @{ @@ -291,7 +289,6 @@ typedef bool Status_bool_t; //!< Boolean status. typedef U8 Status_t; //!< 8-bit-coded status. //! @} - /*! \name Aliasing Aggregate Types */ //! @{ @@ -462,7 +459,6 @@ typedef struct #endif //! @} - #ifndef __ASSEMBLY__ // not for assembling. //! \name Optimization Control @@ -581,7 +577,6 @@ typedef struct //! @} - /*! \name Zero-Bit Counting * * Under GCC, __builtin_clz and __builtin_ctz behave like macros when @@ -692,7 +687,6 @@ typedef struct //! @} - /*! \name Bit Reversing */ //! @{ @@ -732,7 +726,6 @@ typedef struct //! @} - /*! \name Alignment */ //! @{ @@ -798,7 +791,6 @@ typedef struct */ #define Long_call(addr) ((*(void (*)(void))(addr))()) - /*! \name MCU Endianism Handling * ARM is MCU little endianism. */ @@ -868,7 +860,6 @@ typedef struct #define CPU_TO_BE32(x) swap32(x) //! @} - /*! \name Endianism Conversion * * The same considerations as for clz and ctz apply here but GCC's @@ -955,7 +946,6 @@ typedef struct //! @} - /*! \name Target Abstraction */ //! @{ @@ -997,7 +987,6 @@ typedef U8 Byte; //!< 8-bit unsigned integer. #endif // #ifndef __ASSEMBLY__ - #ifdef __ICCARM__ #define SHORTENUM __packed #elif defined(__GNUC__) diff --git a/Marlin/src/HAL/DUE/usb/conf_access.h b/Marlin/src/HAL/DUE/usb/conf_access.h index f401685223..0ea5fe2287 100644 --- a/Marlin/src/HAL/DUE/usb/conf_access.h +++ b/Marlin/src/HAL/DUE/usb/conf_access.h @@ -81,7 +81,6 @@ #define LUN_0_NAME "\"SD/MMC Card\"" //! @} - /*! \name Actions Associated with Memory Accesses * * Write here the action to associate with each memory access. @@ -112,5 +111,4 @@ #define GLOBAL_WR_PROTECT false //!< Management of a global write protection. //! @} - #endif // _CONF_ACCESS_H_ diff --git a/Marlin/src/HAL/DUE/usb/conf_clock.h b/Marlin/src/HAL/DUE/usb/conf_clock.h index 97e70e99a5..0c7815ee4d 100644 --- a/Marlin/src/HAL/DUE/usb/conf_clock.h +++ b/Marlin/src/HAL/DUE/usb/conf_clock.h @@ -96,5 +96,4 @@ // - UPLL frequency: 480MHz // - USB clock: 480 / 1 = 480MHz - #endif /* CONF_CLOCK_H_INCLUDED */ diff --git a/Marlin/src/HAL/DUE/usb/conf_usb.h b/Marlin/src/HAL/DUE/usb/conf_usb.h index f66194c6e6..fb4ef34241 100644 --- a/Marlin/src/HAL/DUE/usb/conf_usb.h +++ b/Marlin/src/HAL/DUE/usb/conf_usb.h @@ -88,7 +88,6 @@ #endif //@} - /** * USB Device Callbacks definitions (Optional) * @{ @@ -150,7 +149,6 @@ //@} - /** * USB Interface Configuration * @{ @@ -210,7 +208,6 @@ //@} //@} - /** * Configuration of MSC interface * @{ @@ -245,7 +242,6 @@ //@} - /** * Description of Composite Device * @{ diff --git a/Marlin/src/HAL/DUE/usb/ctrl_access.c b/Marlin/src/HAL/DUE/usb/ctrl_access.c index 99f97f62cb..b766ed1273 100644 --- a/Marlin/src/HAL/DUE/usb/ctrl_access.c +++ b/Marlin/src/HAL/DUE/usb/ctrl_access.c @@ -68,7 +68,6 @@ #endif #include "ctrl_access.h" - //_____ D E F I N I T I O N S ______________________________________________ #ifdef FREERTOS_USED @@ -112,7 +111,6 @@ static xSemaphoreHandle ctrl_access_semphr = NULL; #endif // FREERTOS_USED - #if MAX_LUN /*! \brief Initializes an entry of the LUN descriptor table. @@ -242,17 +240,14 @@ static const struct #endif - #if GLOBAL_WR_PROTECT == true bool g_wr_protect; #endif - /*! \name Control Interface */ //! @{ - #ifdef FREERTOS_USED bool ctrl_access_init(void) @@ -270,7 +265,6 @@ bool ctrl_access_init(void) return true; } - /*! \brief Locks accesses to LUNs. * * \return \c true if the access was successfully locked, else \c false. @@ -288,7 +282,6 @@ static bool ctrl_access_lock(void) #endif // FREERTOS_USED - U8 get_nb_lun(void) { #if MEM_USB == ENABLE @@ -309,13 +302,11 @@ U8 get_nb_lun(void) #endif } - U8 get_cur_lun(void) { return LUN_ID_0; } - Ctrl_status mem_test_unit_ready(U8 lun) { Ctrl_status status; @@ -337,7 +328,6 @@ Ctrl_status mem_test_unit_ready(U8 lun) return status; } - Ctrl_status mem_read_capacity(U8 lun, U32 *u32_nb_sector) { Ctrl_status status; @@ -359,7 +349,6 @@ Ctrl_status mem_read_capacity(U8 lun, U32 *u32_nb_sector) return status; } - U8 mem_sector_size(U8 lun) { U8 sector_size; @@ -381,7 +370,6 @@ U8 mem_sector_size(U8 lun) return sector_size; } - bool mem_unload(U8 lun, bool unload) { bool unloaded; @@ -433,7 +421,6 @@ bool mem_wr_protect(U8 lun) return wr_protect; } - bool mem_removal(U8 lun) { bool removal; @@ -458,7 +445,6 @@ bool mem_removal(U8 lun) return removal; } - const char *mem_name(U8 lun) { #if MAX_LUN==0 @@ -475,17 +461,14 @@ const char *mem_name(U8 lun) #endif } - //! @} - #if ACCESS_USB == true /*! \name MEM <-> USB Interface */ //! @{ - Ctrl_status memory_2_usb(U8 lun, U32 addr, U16 nb_sector) { Ctrl_status status; @@ -505,7 +488,6 @@ Ctrl_status memory_2_usb(U8 lun, U32 addr, U16 nb_sector) return status; } - Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector) { Ctrl_status status; @@ -525,19 +507,16 @@ Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector) return status; } - //! @} #endif // ACCESS_USB == true - #if ACCESS_MEM_TO_RAM == true /*! \name MEM <-> RAM Interface */ //! @{ - Ctrl_status memory_2_ram(U8 lun, U32 addr, void *ram) { Ctrl_status status; @@ -564,7 +543,6 @@ Ctrl_status memory_2_ram(U8 lun, U32 addr, void *ram) return status; } - Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram) { Ctrl_status status; @@ -591,19 +569,16 @@ Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram) return status; } - //! @} #endif // ACCESS_MEM_TO_RAM == true - #if ACCESS_STREAM == true /*! \name Streaming MEM <-> MEM Interface */ //! @{ - #if ACCESS_MEM_TO_MEM == true #include "fat.h" @@ -625,21 +600,18 @@ Ctrl_status stream_mem_to_mem(U8 src_lun, U32 src_addr, U8 dest_lun, U32 dest_ad #endif // ACCESS_MEM_TO_MEM == true - Ctrl_status stream_state(U8 id) { UNUSED(id); return CTRL_GOOD; } - U16 stream_stop(U8 id) { UNUSED(id); return 0; } - //! @} #endif // ACCESS_STREAM diff --git a/Marlin/src/HAL/DUE/usb/ctrl_access.h b/Marlin/src/HAL/DUE/usb/ctrl_access.h index b33839076e..d9cb05da74 100644 --- a/Marlin/src/HAL/DUE/usb/ctrl_access.h +++ b/Marlin/src/HAL/DUE/usb/ctrl_access.h @@ -56,7 +56,6 @@ * Support and FAQ: visit Atmel Support */ - #ifndef _CTRL_ACCESS_H_ #define _CTRL_ACCESS_H_ @@ -89,7 +88,6 @@ typedef enum CTRL_BUSY = FAIL + 2 //!< Memory not initialized or changed. } Ctrl_status; - // FYI: Each Logical Unit Number (LUN) corresponds to a memory. // Check LUN defines. @@ -136,7 +134,6 @@ typedef enum #define LUN_ID_USB (MAX_LUN) //!< First dynamic LUN (USB host mass storage). //! @} - // Include LUN header files. #if LUN_0 == ENABLE #include LUN_0_INCLUDE @@ -166,13 +163,11 @@ typedef enum #include LUN_USB_INCLUDE #endif - // Check the configuration of write protection in conf_access.h. #ifndef GLOBAL_WR_PROTECT #error GLOBAL_WR_PROTECT must be defined as true or false in conf_access.h #endif - #if GLOBAL_WR_PROTECT == true //! Write protect. @@ -180,7 +175,6 @@ extern bool g_wr_protect; #endif - /*! \name Control Interface */ //! @{ @@ -279,7 +273,6 @@ extern const char *mem_name(U8 lun); //! @} - #if ACCESS_USB == true /*! \name MEM <-> USB Interface @@ -310,7 +303,6 @@ extern Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector); #endif // ACCESS_USB == true - #if ACCESS_MEM_TO_RAM == true /*! \name MEM <-> RAM Interface @@ -341,7 +333,6 @@ extern Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram); #endif // ACCESS_MEM_TO_RAM == true - #if ACCESS_STREAM == true /*! \name Streaming MEM <-> MEM Interface diff --git a/Marlin/src/HAL/DUE/usb/mrepeat.h b/Marlin/src/HAL/DUE/usb/mrepeat.h index 8363d9cde3..10a8237545 100644 --- a/Marlin/src/HAL/DUE/usb/mrepeat.h +++ b/Marlin/src/HAL/DUE/usb/mrepeat.h @@ -57,7 +57,6 @@ #include "preprocessor.h" - //! Maximal number of repetitions supported by MREPEAT. #define MREPEAT_LIMIT 256 diff --git a/Marlin/src/HAL/DUE/usb/osc.h b/Marlin/src/HAL/DUE/usb/osc.h index c0ae24381a..1585018ed8 100644 --- a/Marlin/src/HAL/DUE/usb/osc.h +++ b/Marlin/src/HAL/DUE/usb/osc.h @@ -128,7 +128,6 @@ static inline void osc_enable(uint32_t ul_id) { pmc_switch_sclk_to_32kxtal(PMC_OSC_BYPASS); break; - case OSC_MAINCK_4M_RC: pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_4_MHz); break; @@ -141,7 +140,6 @@ static inline void osc_enable(uint32_t ul_id) { pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_12_MHz); break; - case OSC_MAINCK_XTAL: pmc_switch_mainck_to_xtal(PMC_OSC_XTAL/*, pmc_us_to_moscxtst(BOARD_OSC_STARTUP_US, diff --git a/Marlin/src/HAL/DUE/usb/preprocessor.h b/Marlin/src/HAL/DUE/usb/preprocessor.h index c12d01cb64..fe796c4fb8 100644 --- a/Marlin/src/HAL/DUE/usb/preprocessor.h +++ b/Marlin/src/HAL/DUE/usb/preprocessor.h @@ -51,5 +51,4 @@ #include "stringz.h" #include "mrepeat.h" - #endif // _PREPROCESSOR_H_ diff --git a/Marlin/src/HAL/DUE/usb/sbc_protocol.h b/Marlin/src/HAL/DUE/usb/sbc_protocol.h index 983ec7adca..cdd4caa3cd 100644 --- a/Marlin/src/HAL/DUE/usb/sbc_protocol.h +++ b/Marlin/src/HAL/DUE/usb/sbc_protocol.h @@ -86,7 +86,6 @@ enum scsi_sbc_mode { SCSI_MS_MODE_CACHING = 0x08, //!< Caching mode page }; - //! \name SBC-2 Device-Specific Parameter //@{ #define SCSI_MS_SBC_WP 0x80 //!< Write Protected diff --git a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp index 65a926ff36..e64c6755bf 100644 --- a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp +++ b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp @@ -18,30 +18,30 @@ extern "C" { void sd_mmc_spi_mem_init() { } -Ctrl_status sd_mmc_spi_test_unit_ready() { - #ifdef DISABLE_DUE_SD_MMC - return CTRL_NO_PRESENT; - #endif - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) - return CTRL_NO_PRESENT; - return CTRL_GOOD; -} - -// NOTE: This function is defined as returning the address of the last block -// in the card, which is cardSize() - 1 -Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) - return CTRL_NO_PRESENT; - *nb_sector = card.diskIODriver()->cardSize() - 1; - return CTRL_GOOD; +inline bool media_ready() { + return IS_SD_INSERTED() && !IS_SD_PRINTING() && !IS_SD_FILE_OPEN() && card.isMounted(); } bool sd_mmc_spi_unload(bool) { return true; } bool sd_mmc_spi_wr_protect() { return false; } -bool sd_mmc_spi_removal() { - return (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()); +bool sd_mmc_spi_removal() { return !media_ready(); } + +Ctrl_status sd_mmc_spi_test_unit_ready() { + #ifdef DISABLE_DUE_SD_MMC + return CTRL_NO_PRESENT; + #endif + if (!media_ready()) return CTRL_NO_PRESENT; + return CTRL_GOOD; +} + +// NOTE: This function is defined as returning the address of the last block +// in the card, which is cardSize() - 1 +Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) { + if (!media_ready()) return CTRL_NO_PRESENT; + *nb_sector = card.diskIODriver()->cardSize() - 1; + return CTRL_GOOD; } #if ACCESS_USB == true @@ -61,8 +61,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) { #ifdef DISABLE_DUE_SD_MMC return CTRL_NO_PRESENT; #endif - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) - return CTRL_NO_PRESENT; + if (!media_ready()) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC { @@ -101,8 +100,7 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) { #ifdef DISABLE_DUE_SD_MMC return CTRL_NO_PRESENT; #endif - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted()) - return CTRL_NO_PRESENT; + if (!media_ready()) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC { diff --git a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h index 553fd3c29a..464d106e52 100644 --- a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h +++ b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h @@ -45,7 +45,6 @@ * Support and FAQ: visit Atmel Support */ - #ifndef _SD_MMC_SPI_MEM_H_ #define _SD_MMC_SPI_MEM_H_ @@ -63,22 +62,19 @@ #error sd_mmc_spi_mem.h is #included although SD_MMC_SPI_MEM is disabled #endif - #include "ctrl_access.h" - //_____ D E F I N I T I O N S ______________________________________________ #define SD_MMC_REMOVED 0 #define SD_MMC_INSERTED 1 #define SD_MMC_REMOVING 2 - //---- CONTROL FUNCTIONS ---- //! //! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI. //!/ -extern void sd_mmc_spi_mem_init(void); +void sd_mmc_spi_mem_init(); //! //! @brief This function tests the state of the SD_MMC memory and sends it to the Host. @@ -91,7 +87,7 @@ extern void sd_mmc_spi_mem_init(void); //! Media not present -> CTRL_NO_PRESENT //! Media has changed -> CTRL_BUSY //!/ -extern Ctrl_status sd_mmc_spi_test_unit_ready(void); +Ctrl_status sd_mmc_spi_test_unit_ready(); //! //! @brief This function gives the address of the last valid sector. @@ -102,7 +98,7 @@ extern Ctrl_status sd_mmc_spi_test_unit_ready(void); //! Media ready -> CTRL_GOOD //! Media not present -> CTRL_NO_PRESENT //!/ -extern Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector); +Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector); /*! \brief Unload/Load the SD/MMC card selected * @@ -113,7 +109,7 @@ extern Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector); * * \return \c true if unload/load done success. */ -extern bool sd_mmc_spi_unload(bool unload); +bool sd_mmc_spi_unload(bool unload); //! //! @brief This function returns the write protected status of the memory. @@ -124,15 +120,14 @@ extern bool sd_mmc_spi_unload(bool unload); //! //! @return false -> the memory is not write-protected (always) //!/ -extern bool sd_mmc_spi_wr_protect(void); +bool sd_mmc_spi_wr_protect(); //! //! @brief This function tells if the memory has been removed or not. //! //! @return false -> The memory isn't removed //! -extern bool sd_mmc_spi_removal(void); - +bool sd_mmc_spi_removal(); //---- ACCESS DATA FUNCTIONS ---- @@ -152,7 +147,7 @@ extern bool sd_mmc_spi_removal(void); //! It is ready -> CTRL_GOOD //! A error occur -> CTRL_FAIL //! -extern Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector); +Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector); //! This function initializes the SD/MMC memory for a write operation //! @@ -166,7 +161,7 @@ extern Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector); //! It is ready -> CTRL_GOOD //! An error occurs -> CTRL_FAIL //! -extern Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector); +Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector); #endif // #if ACCESS_USB == true diff --git a/Marlin/src/HAL/DUE/usb/sysclk.h b/Marlin/src/HAL/DUE/usb/sysclk.h index 0623378615..4001366868 100644 --- a/Marlin/src/HAL/DUE/usb/sysclk.h +++ b/Marlin/src/HAL/DUE/usb/sysclk.h @@ -212,7 +212,6 @@ extern "C" { #define CONFIG_USBCLK_DIV #endif - extern void sysclk_enable_usb(void); extern void sysclk_disable_usb(void); diff --git a/Marlin/src/HAL/DUE/usb/udc.c b/Marlin/src/HAL/DUE/usb/udc.c index 60bf0cfff3..f6a4243d1d 100644 --- a/Marlin/src/HAL/DUE/usb/udc.c +++ b/Marlin/src/HAL/DUE/usb/udc.c @@ -83,7 +83,6 @@ static usb_iface_desc_t UDC_DESC_STORAGE *udc_ptr_iface; //! @} - //! \name Internal structure to store the USB device main strings //! @{ diff --git a/Marlin/src/HAL/DUE/usb/udc.h b/Marlin/src/HAL/DUE/usb/udc.h index 6230a81b35..aba08d956e 100644 --- a/Marlin/src/HAL/DUE/usb/udc.h +++ b/Marlin/src/HAL/DUE/usb/udc.h @@ -685,6 +685,4 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void); } \endcode */ - - #endif // _UDC_H_ diff --git a/Marlin/src/HAL/DUE/usb/udd.h b/Marlin/src/HAL/DUE/usb/udd.h index 6eda465e54..4e482784e1 100644 --- a/Marlin/src/HAL/DUE/usb/udd.h +++ b/Marlin/src/HAL/DUE/usb/udd.h @@ -213,7 +213,6 @@ void udd_send_remotewakeup(void); */ void udd_set_setup_payload( uint8_t *payload, uint16_t payload_size ); - /** * \name Endpoint Management * diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc.c b/Marlin/src/HAL/DUE/usb/udi_cdc.c index 89debe57f1..26788570c6 100644 --- a/Marlin/src/HAL/DUE/usb/udi_cdc.c +++ b/Marlin/src/HAL/DUE/usb/udi_cdc.c @@ -457,7 +457,6 @@ void udi_cdc_data_sof_notify(void) #endif } - // ------------------------ //------- Internal routines to control serial line @@ -520,7 +519,6 @@ static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask) udi_cdc_ctrl_state_notify(port, ep_comm); } - static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep) { #if UDI_CDC_PORT_NB == 1 // To optimize code @@ -542,7 +540,6 @@ static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep) } } - static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) { uint8_t port; @@ -578,11 +575,9 @@ static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, udi_cdc_ctrl_state_notify(port, ep); } - // ------------------------ //------- Internal routines to process data transfer - static bool udi_cdc_rx_start(uint8_t port) { irqflags_t flags; @@ -632,7 +627,6 @@ static bool udi_cdc_rx_start(uint8_t port) udi_cdc_data_received); } - static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) { uint8_t buf_sel_trans; @@ -668,7 +662,6 @@ static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_ udi_cdc_rx_start(port); } - static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) { uint8_t port; @@ -700,7 +693,6 @@ static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t udi_cdc_tx_send(port); } - static void udi_cdc_tx_send(uint8_t port) { irqflags_t flags; @@ -780,11 +772,9 @@ static void udi_cdc_tx_send(uint8_t port) udi_cdc_data_sent); } - // ------------------------ //------- Application interface - //------- Application interface void udi_cdc_ctrl_signal_dcd(bool b_set) diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc.h b/Marlin/src/HAL/DUE/usb/udi_cdc.h index 2bc5fff187..e9c6abbbb2 100644 --- a/Marlin/src/HAL/DUE/usb/udi_cdc.h +++ b/Marlin/src/HAL/DUE/usb/udi_cdc.h @@ -106,7 +106,6 @@ typedef struct { usb_ep_desc_t ep_notify; } udi_cdc_comm_desc_t; - /** * \brief Data Class interface descriptor * @@ -121,7 +120,6 @@ typedef struct { usb_ep_desc_t ep_out; } udi_cdc_data_desc_t; - //! CDC communication endpoints size for all speeds #define UDI_CDC_COMM_EP_SIZE 64 //! CDC data endpoints size for FS speed (8B, 16B, 32B, 64B) diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c b/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c index 4c79e8df13..bcae362cef 100644 --- a/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c +++ b/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c @@ -109,7 +109,6 @@ UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = { .bNumConfigurations = 1 }; - #ifdef USB_DEVICE_HS_SUPPORT //! USB Device Qualifier Descriptor for HS COMPILER_WORD_ALIGNED diff --git a/Marlin/src/HAL/DUE/usb/udi_composite_desc.c b/Marlin/src/HAL/DUE/usb/udi_composite_desc.c index b10d043b9f..8fa5acbb3f 100644 --- a/Marlin/src/HAL/DUE/usb/udi_composite_desc.c +++ b/Marlin/src/HAL/DUE/usb/udi_composite_desc.c @@ -93,7 +93,6 @@ UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = { .bNumConfigurations = 1 }; - #ifdef USB_DEVICE_HS_SUPPORT //! USB Device Qualifier Descriptor for HS COMPILER_WORD_ALIGNED @@ -147,7 +146,6 @@ UDC_DESC_STORAGE udc_desc_t udc_desc_hs = { }; #endif - /** * \name UDC structures which contains all USB Device definitions */ diff --git a/Marlin/src/HAL/DUE/usb/udi_msc.c b/Marlin/src/HAL/DUE/usb/udi_msc.c index 3f70a8fb18..56664f4bf7 100644 --- a/Marlin/src/HAL/DUE/usb/udi_msc.c +++ b/Marlin/src/HAL/DUE/usb/udi_msc.c @@ -86,7 +86,6 @@ UDC_DESC_STORAGE udi_api_t udi_api_msc = { }; //@} - /** * \ingroup udi_msc_group * \defgroup udi_msc_group_internal Implementation of UDI MSC @@ -137,7 +136,6 @@ volatile bool udi_msc_b_reset_trans = true; //@} - /** * \name Internal routines */ @@ -190,7 +188,6 @@ static void udi_msc_cbw_received(udd_ep_status_t status, static bool udi_msc_cbw_validate(uint32_t alloc_len, uint8_t dir_flag); //@} - /** * \name Routines to process small data packet */ @@ -217,7 +214,6 @@ static void udi_msc_data_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep); //@} - /** * \name Routines to process CSW packet */ @@ -250,7 +246,6 @@ static void udi_msc_csw_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep); //@} - /** * \name Routines manage sense data */ @@ -307,7 +302,6 @@ static void udi_msc_sense_fail_cdb_invalid(void); static void udi_msc_sense_command_invalid(void); //@} - /** * \name Routines manage SCSI Commands */ diff --git a/Marlin/src/HAL/DUE/usb/uotghs_device_due.c b/Marlin/src/HAL/DUE/usb/uotghs_device_due.c index 5a988b7421..01dda7e7fe 100644 --- a/Marlin/src/HAL/DUE/usb/uotghs_device_due.c +++ b/Marlin/src/HAL/DUE/usb/uotghs_device_due.c @@ -293,7 +293,6 @@ do { \ # endif #endif - /** * \name Power management routine. */ @@ -310,7 +309,6 @@ static bool udd_b_idle; //! State of sleep manager static bool udd_b_sleep_initialized = false; - /*! \brief Authorize or not the CPU powerdown mode * * \param b_enable true to authorize idle mode @@ -338,7 +336,6 @@ static void udd_sleep_mode(bool b_idle) //@} - /** * \name Control endpoint low level management routine. * @@ -410,7 +407,6 @@ static void udd_ctrl_send_zlp_out(void); //! \brief Call callback associated to setup request static void udd_ctrl_endofrequest(void); - /** * \brief Main interrupt routine for control endpoint * @@ -422,7 +418,6 @@ static bool udd_ctrl_interrupt(void); //@} - /** * \name Management of bulk/interrupt/isochronous endpoints * @@ -460,7 +455,6 @@ typedef struct { uint8_t stall_requested:1; } udd_ep_job_t; - //! Array to register a job on bulk/interrupt/isochronous endpoint static udd_ep_job_t udd_ep_job[USB_DEVICE_MAX_EP]; @@ -522,7 +516,6 @@ static bool udd_ep_interrupt(void); #endif // (0!=USB_DEVICE_MAX_EP) //@} - // ------------------------ //--- INTERNAL ROUTINES TO MANAGED GLOBAL EVENTS @@ -671,13 +664,11 @@ udd_interrupt_sof_end: return; } - bool udd_include_vbus_monitoring(void) { return true; } - void udd_enable(void) { irqflags_t flags; @@ -764,7 +755,6 @@ void udd_enable(void) cpu_irq_restore(flags); } - void udd_disable(void) { irqflags_t flags; @@ -866,7 +856,6 @@ void udd_attach(void) cpu_irq_restore(flags); } - void udd_detach(void) { otg_unfreeze_clock(); @@ -883,7 +872,6 @@ void udd_detach(void) udd_sleep_mode(false); } - bool udd_is_high_speed(void) { #ifdef USB_DEVICE_HS_SUPPORT @@ -893,7 +881,6 @@ bool udd_is_high_speed(void) #endif } - void udd_set_address(uint8_t address) { udd_disable_address(); @@ -901,13 +888,11 @@ void udd_set_address(uint8_t address) udd_enable_address(); } - uint8_t udd_getaddress(void) { return udd_get_configured_address(); } - uint16_t udd_get_frame_number(void) { return udd_frame_number(); @@ -930,14 +915,12 @@ void udd_send_remotewakeup(void) } } - void udd_set_setup_payload(uint8_t *payload, uint16_t payload_size) { udd_g_ctrlreq.payload = payload; udd_g_ctrlreq.payload_size = payload_size; } - #if (0 != USB_DEVICE_MAX_EP) bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes, uint16_t MaxEndpointSize) @@ -1061,7 +1044,6 @@ bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes, return true; } - void udd_ep_free(udd_ep_id_t ep) { uint8_t ep_index = ep & USB_EP_ADDR_MASK; @@ -1074,14 +1056,12 @@ void udd_ep_free(udd_ep_id_t ep) udd_ep_job[ep_index - 1].stall_requested = false; } - bool udd_ep_is_halted(udd_ep_id_t ep) { uint8_t ep_index = ep & USB_EP_ADDR_MASK; return Is_udd_endpoint_stall_requested(ep_index); } - bool udd_ep_set_halt(udd_ep_id_t ep) { uint8_t ep_index = ep & USB_EP_ADDR_MASK; @@ -1122,7 +1102,6 @@ bool udd_ep_set_halt(udd_ep_id_t ep) return true; } - bool udd_ep_clear_halt(udd_ep_id_t ep) { uint8_t ep_index = ep & USB_EP_ADDR_MASK; @@ -1163,7 +1142,6 @@ bool udd_ep_clear_halt(udd_ep_id_t ep) return true; } - bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket, uint8_t * buf, iram_size_t buf_size, udd_callback_trans_t callback) @@ -1230,7 +1208,6 @@ bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket, #endif } - void udd_ep_abort(udd_ep_id_t ep) { uint8_t ep_index = ep & USB_EP_ADDR_MASK; @@ -1259,7 +1236,6 @@ void udd_ep_abort(udd_ep_id_t ep) udd_ep_abort_job(ep); } - bool udd_ep_wait_stall_clear(udd_ep_id_t ep, udd_callback_halt_cleared_t callback) { @@ -1294,7 +1270,6 @@ bool udd_ep_wait_stall_clear(udd_ep_id_t ep, } #endif // (0 != USB_DEVICE_MAX_EP) - #ifdef USB_DEVICE_HS_SUPPORT void udd_test_mode_j(void) @@ -1303,20 +1278,17 @@ void udd_test_mode_j(void) udd_enable_hs_test_mode_j(); } - void udd_test_mode_k(void) { udd_enable_hs_test_mode(); udd_enable_hs_test_mode_k(); } - void udd_test_mode_se0_nak(void) { udd_enable_hs_test_mode(); } - void udd_test_mode_packet(void) { uint8_t i; @@ -1360,8 +1332,6 @@ void udd_test_mode_packet(void) } #endif // USB_DEVICE_HS_SUPPORT - - // ------------------------ //--- INTERNAL ROUTINES TO MANAGED THE CONTROL ENDPOINT @@ -1411,7 +1381,6 @@ static void udd_ctrl_init(void) udd_ep_control_state = UDD_EPCTRL_SETUP; } - static void udd_ctrl_setup_received(void) { irqflags_t flags; @@ -1473,7 +1442,6 @@ static void udd_ctrl_setup_received(void) } } - static void udd_ctrl_in_sent(void) { static bool b_shortpacket = false; @@ -1557,7 +1525,6 @@ static void udd_ctrl_in_sent(void) cpu_irq_restore(flags); } - static void udd_ctrl_out_received(void) { irqflags_t flags; @@ -1648,7 +1615,6 @@ static void udd_ctrl_out_received(void) cpu_irq_restore(flags); } - static void udd_ctrl_underflow(void) { if (Is_udd_out_received(0)) @@ -1665,7 +1631,6 @@ static void udd_ctrl_underflow(void) } } - static void udd_ctrl_overflow(void) { if (Is_udd_in_send(0)) @@ -1681,7 +1646,6 @@ static void udd_ctrl_overflow(void) } } - static void udd_ctrl_stall_data(void) { // Stall all packets on IN & OUT control endpoint @@ -1689,7 +1653,6 @@ static void udd_ctrl_stall_data(void) udd_enable_stall_handshake(0); } - static void udd_ctrl_send_zlp_in(void) { irqflags_t flags; @@ -1707,7 +1670,6 @@ static void udd_ctrl_send_zlp_in(void) cpu_irq_restore(flags); } - static void udd_ctrl_send_zlp_out(void) { irqflags_t flags; @@ -1723,7 +1685,6 @@ static void udd_ctrl_send_zlp_out(void) cpu_irq_restore(flags); } - static void udd_ctrl_endofrequest(void) { // If a callback is registered then call it @@ -1732,7 +1693,6 @@ static void udd_ctrl_endofrequest(void) } } - static bool udd_ctrl_interrupt(void) { @@ -1783,7 +1743,6 @@ static bool udd_ctrl_interrupt(void) return false; } - // ------------------------ //--- INTERNAL ROUTINES TO MANAGED THE BULK/INTERRUPT/ISOCHRONOUS ENDPOINTS @@ -1798,7 +1757,6 @@ static void udd_ep_job_table_reset(void) } } - static void udd_ep_job_table_kill(void) { uint8_t i; @@ -1809,7 +1767,6 @@ static void udd_ep_job_table_kill(void) } } - static void udd_ep_abort_job(udd_ep_id_t ep) { ep &= USB_EP_ADDR_MASK; @@ -1818,7 +1775,6 @@ static void udd_ep_abort_job(udd_ep_id_t ep) udd_ep_finish_job(&udd_ep_job[ep - 1], true, ep); } - static void udd_ep_finish_job(udd_ep_job_t * ptr_job, bool b_abort, uint8_t ep_num) { if (ptr_job->busy == false) { @@ -1889,7 +1845,6 @@ static void udd_ep_trans_done(udd_ep_id_t ep) udd_dma_ctrl |= UOTGHS_DEVDMACONTROL_END_BUFFIT | UOTGHS_DEVDMACONTROL_CHANN_ENB; - // Disable IRQs to have a short sequence // between read of EOT_STA and DMA enable flags = cpu_irq_save(); diff --git a/Marlin/src/HAL/DUE/usb/uotghs_device_due.h b/Marlin/src/HAL/DUE/usb/uotghs_device_due.h index 6df26d63df..99ad492c1f 100644 --- a/Marlin/src/HAL/DUE/usb/uotghs_device_due.h +++ b/Marlin/src/HAL/DUE/usb/uotghs_device_due.h @@ -129,7 +129,6 @@ extern "C" { #define Is_udd_vbus_transition() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_VBUSTI)) //! @} - //! @name UOTGHS device attach control //! These macros manage the UOTGHS Device attach. //! @{ @@ -141,7 +140,6 @@ extern "C" { #define Is_udd_detached() (Tst_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_DETACH)) //! @} - //! @name UOTGHS device bus events control //! These macros manage the UOTGHS Device bus events. //! @{ @@ -246,7 +244,6 @@ extern "C" { #define udd_get_configured_address() (Rd_bitfield(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_UADD_Msk)) //! @} - //! @name UOTGHS Device endpoint drivers //! These macros manage the common features of the endpoints. //! @{ @@ -330,7 +327,6 @@ extern "C" { #define udd_data_toggle(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_DTSEQ_Msk)) //! @} - //! @name UOTGHS Device control endpoint //! These macros control the endpoints. //! @{ @@ -530,7 +526,6 @@ extern "C" { //! Tests if IN sending interrupt is enabled #define Is_udd_in_send_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_TXINE)) - //! Get 64-, 32-, 16- or 8-bit access to FIFO data register of selected endpoint. //! @param ep Endpoint of which to access FIFO data register //! @param scale Data scale in bits: 64, 32, 16 or 8 @@ -652,7 +647,6 @@ typedef struct { //! @} //! @} - /// @cond 0 /**INDENT-OFF**/ #ifdef __cplusplus diff --git a/Marlin/src/HAL/DUE/usb/uotghs_otg.h b/Marlin/src/HAL/DUE/usb/uotghs_otg.h index f0e55c896f..8c12a3e291 100644 --- a/Marlin/src/HAL/DUE/usb/uotghs_otg.h +++ b/Marlin/src/HAL/DUE/usb/uotghs_otg.h @@ -53,7 +53,6 @@ extern "C" { #endif - //! \ingroup usb_group //! \defgroup otg_group UOTGHS OTG Driver //! UOTGHS low-level driver for OTG features @@ -74,7 +73,6 @@ bool otg_dual_enable(void); */ void otg_dual_disable(void); - //! @name UOTGHS OTG ID pin management //! The ID pin come from the USB OTG connector (A and B receptable) and //! allows to select the USB mode host or device. diff --git a/Marlin/src/HAL/DUE/usb/usb_protocol.h b/Marlin/src/HAL/DUE/usb/usb_protocol.h index 4540247df8..9bf0a1ba60 100644 --- a/Marlin/src/HAL/DUE/usb/usb_protocol.h +++ b/Marlin/src/HAL/DUE/usb/usb_protocol.h @@ -374,7 +374,6 @@ typedef struct { uint8_t bNumDeviceCaps; } usb_dev_bos_desc_t; - /** * \brief USB Device Capabilities - USB 2.0 Extension Descriptor structure * @@ -411,7 +410,6 @@ typedef struct { uint8_t iFunction; //!< Index of string descriptor } usb_association_desc_t; - /** * \brief Standard USB configuration descriptor structure */ @@ -426,7 +424,6 @@ typedef struct { uint8_t bMaxPower; } usb_conf_desc_t; - #define USB_CONFIG_ATTR_MUST_SET (1 << 7) //!< Must always be set #define USB_CONFIG_ATTR_BUS_POWERED (0 << 6) //!< Bus-powered #define USB_CONFIG_ATTR_SELF_POWERED (1 << 6) //!< Self-powered @@ -475,7 +472,6 @@ typedef struct { uint8_t bInterval; } usb_ep_desc_t; - /** * \brief A standard USB string descriptor structure */ diff --git a/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h b/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h index 9b82afc624..769e7589bc 100644 --- a/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h +++ b/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h @@ -168,7 +168,6 @@ COMPILER_PACK_SET(1) //! \name USB CDC Descriptors //@{ - //! CDC Header Functional Descriptor typedef struct { uint8_t bFunctionLength; @@ -203,7 +202,6 @@ typedef struct { uint8_t bSlaveInterface0; } usb_cdc_union_desc_t; - //! \name USB CDC Call Management Capabilities //@{ //! Device handles call management itself @@ -278,7 +276,6 @@ typedef struct { //@} //@} - //! \name USB CDC notification message //@{ diff --git a/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h b/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h index cc30a94e4f..227a13dc53 100644 --- a/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h +++ b/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h @@ -47,7 +47,6 @@ #ifndef _USB_PROTOCOL_MSC_H_ #define _USB_PROTOCOL_MSC_H_ - /** * \ingroup usb_protocol_group * \defgroup usb_msc_protocol USB Mass Storage Class (MSC) protocol definitions @@ -89,7 +88,6 @@ #define MSC_PROTOCOL_BULK 0x50 //!< Bulk-only //@} - /** * \brief MSC USB requests (bRequest) */ @@ -98,7 +96,6 @@ enum usb_reqid_msc { USB_REQ_MSC_GET_MAX_LUN = 0xFE //!< Get Max LUN }; - COMPILER_PACK_SET(1) /** @@ -122,7 +119,6 @@ struct usb_msc_cbw { #define USB_CBW_LEN_MASK 0x1F //!< Valid bits in bCBWCBLength //@} - /** * \name A Command Status Wrapper (CSW). */ diff --git a/Marlin/src/HAL/ESP32/eeprom.cpp b/Marlin/src/HAL/ESP32/eeprom.cpp index cb5f881284..ca4a806361 100644 --- a/Marlin/src/HAL/ESP32/eeprom.cpp +++ b/Marlin/src/HAL/ESP32/eeprom.cpp @@ -31,24 +31,28 @@ #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { return EEPROM.begin(MARLIN_EEPROM_SIZE); } bool PersistentStore::access_finish() { EEPROM.end(); return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { for (size_t i = 0; i < size; i++) { - EEPROM.write(pos++, value[i]); + const int p = REAL_EEPROM_ADDR(pos); + EEPROM.write(p, value[i]); crc16(crc, &value[i], 1); + ++pos; } return false; } bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { for (size_t i = 0; i < size; i++) { - uint8_t c = EEPROM.read(pos++); + const int p = REAL_EEPROM_ADDR(pos); + uint8_t c = EEPROM.read(p); if (writing) value[i] = c; crc16(crc, &c, 1); + ++pos; } return false; } diff --git a/Marlin/src/HAL/ESP32/inc/Conditionals_type.h b/Marlin/src/HAL/ESP32/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/ESP32/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HC32/HAL.h b/Marlin/src/HAL/HC32/HAL.h index dd02183dd0..cbcedd3537 100644 --- a/Marlin/src/HAL/HC32/HAL.h +++ b/Marlin/src/HAL/HC32/HAL.h @@ -142,12 +142,31 @@ // ADC // #define HAL_ADC_VREF_MV 3300 -#define HAL_ADC_RESOLUTION 10 +#define HAL_ADC_RESOLUTION 12 #define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_INDEX(pin) pin #define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) +// +// Debug port disable +// JTMS / SWDIO = PA13 +// JTCK / SWCLK = PA14 +// JTDI = PA15 +// JTDO = PB3 +// NJTRST = PB4 +// +#define DBG_SWCLK _BV(0) +#define DBG_SWDIO _BV(1) +#define DBG_TDO _BV(2) +#define DBG_TDI _BV(3) +#define DBG_TRST _BV(4) +#define DBG_ALL (DBG_SWCLK | DBG_SWDIO | DBG_TDO | DBG_TDI | DBG_TRST) + +#define JTAGSWD_RESET() PORT_DebugPortSetting(DBG_ALL, Enable); +#define JTAG_DISABLE() PORT_DebugPortSetting(DBG_TDO | DBG_TDI | DBG_TRST, Disable); +#define JTAGSWD_DISABLE() PORT_DebugPortSetting(DBG_ALL, Disable); + // // MarlinHAL implementation // diff --git a/Marlin/src/HAL/HC32/MarlinHAL.cpp b/Marlin/src/HAL/HC32/MarlinHAL.cpp index 1ab374fbf1..f1d85f1694 100644 --- a/Marlin/src/HAL/HC32/MarlinHAL.cpp +++ b/Marlin/src/HAL/HC32/MarlinHAL.cpp @@ -123,6 +123,11 @@ void MarlinHAL::init() { // Register min serial TERN_(POSTMORTEM_DEBUGGING, install_min_serial()); + + // warn if low memory after init + if (freeMemory() < 1024) { + SERIAL_WARN_MSG("HAL: low memory after init!\n"); + } } void MarlinHAL::init_board() {} @@ -147,7 +152,31 @@ void MarlinHAL::delay_ms(const int ms) { delay(ms); } -void MarlinHAL::idletask() {} +void MarlinHAL::idletask() { + #if ENABLED(MARLIN_DEV_MODE) + // check & print serial RX errors + MSerialT *serials[] = { &MSerial1, &MSerial2 }; + for (int serial = 0; serial < 2; serial++) { + usart_receive_error_t err = serials[serial]->getReceiveError(); + if (err != usart_receive_error_t::None) { + // "Warning: MSerial[n] RX [Framing|Parity|Overrun] Error" + SERIAL_WARN_START(); + SERIAL_ECHOPGM(" MSerial"); + SERIAL_ECHO(serial + 1); + SERIAL_ECHOPGM(" RX "); + switch(err) { + case usart_receive_error_t::FramingError: SERIAL_ECHOPGM("Framing"); break; + case usart_receive_error_t::ParityError: SERIAL_ECHOPGM("Parity"); break; + case usart_receive_error_t::OverrunError: SERIAL_ECHOPGM("Overrun"); break; + case usart_receive_error_t::RxDataDropped: SERIAL_ECHOPGM("DataDropped"); break; + default: break; + } + SERIAL_ECHOPGM(" Error"); + SERIAL_EOL(); + } + } + #endif +} uint8_t MarlinHAL::get_reset_source() { // Query reset cause from RMU @@ -203,7 +232,9 @@ int MarlinHAL::freeMemory() { return &top - _sbrk(0); } -void MarlinHAL::adc_init() {} +void MarlinHAL::adc_init() { + analogReadResolution(HAL_ADC_RESOLUTION); +} void MarlinHAL::adc_enable(const pin_t pin) { #if TEMP_SENSOR_SOC diff --git a/Marlin/src/HAL/HC32/MarlinSerial.cpp b/Marlin/src/HAL/HC32/MarlinSerial.cpp index 168533f664..11d4abfab9 100644 --- a/Marlin/src/HAL/HC32/MarlinSerial.cpp +++ b/Marlin/src/HAL/HC32/MarlinSerial.cpp @@ -27,7 +27,7 @@ /** * Not every MarlinSerial instance should handle emergency parsing, as - * it would not make sense to parse GCode from TMC responses + * it would not make sense to parse G-Code from TMC responses */ constexpr bool serial_handles_emergency(int port) { return false @@ -46,14 +46,34 @@ constexpr bool serial_handles_emergency(int port) { // // Define serial ports // -#define DEFINE_HWSERIAL_MARLIN(name, n) \ + +// serial port where RX and TX use IRQs +#define DEFINE_IRQ_SERIAL_MARLIN(name, n) \ MSerialT name(serial_handles_emergency(n), \ &USART##n##_config, \ BOARD_USART##n##_TX_PIN, \ BOARD_USART##n##_RX_PIN); -DEFINE_HWSERIAL_MARLIN(MSerial1, 1); -DEFINE_HWSERIAL_MARLIN(MSerial2, 2); +// serial port where RX uses DMA and TX uses IRQs +// all serial ports use DMA1 +// since there are 4 USARTs and 4 DMA channels, we can use the USART number as the DMA channel +#define DEFINE_DMA_SERIAL_MARLIN(name, n) \ + MSerialT name(serial_handles_emergency(n), \ + &USART##n##_config, \ + BOARD_USART##n##_TX_PIN, \ + BOARD_USART##n##_RX_PIN, \ + M4_DMA1, \ + ((en_dma_channel_t)(n - 1))); // map USART1 to DMA channel 0, USART2 to DMA channel 1, etc. + +#define DEFINE_SERIAL_MARLIN(name, n) TERN(SERIAL_DMA, DEFINE_DMA_SERIAL_MARLIN(name, n), DEFINE_IRQ_SERIAL_MARLIN(name, n)) + +DEFINE_SERIAL_MARLIN(MSerial1, 1); +DEFINE_SERIAL_MARLIN(MSerial2, 2); + +// TODO: remove this warning when SERIAL_DMA has been tested some more +#if ENABLED(SERIAL_DMA) + #warning "SERIAL_DMA may be unstable on HC32F460." +#endif // // Serial port assertions diff --git a/Marlin/src/HAL/HC32/MarlinSerial.h b/Marlin/src/HAL/HC32/MarlinSerial.h index 08eeef4395..bb4630eb1d 100644 --- a/Marlin/src/HAL/HC32/MarlinSerial.h +++ b/Marlin/src/HAL/HC32/MarlinSerial.h @@ -25,17 +25,42 @@ #include // Optionally set uart IRQ priority to reduce overflow errors -// #define UART_IRQ_PRIO 1 +//#define UART_RX_IRQ_PRIO 1 +//#define UART_TX_IRQ_PRIO 1 +//#define UART_RX_DMA_IRQ_PRIO 1 struct MarlinSerial : public Usart { - MarlinSerial(struct usart_config_t *usart_device, gpio_pin_t tx_pin, gpio_pin_t rx_pin) : Usart(usart_device, tx_pin, rx_pin) {} + MarlinSerial( + struct usart_config_t *usart_device, + gpio_pin_t tx_pin, + gpio_pin_t rx_pin + #if ENABLED(SERIAL_DMA) + , M4_DMA_TypeDef *dma_unit = nullptr, + en_dma_channel_t rx_dma_channel = DmaCh0 + #endif + ) : Usart(usart_device, tx_pin, rx_pin) { + #if ENABLED(SERIAL_DMA) + if (dma_unit != nullptr) { + enableRxDma(dma_unit, rx_dma_channel); + } + #endif + } - #ifdef UART_IRQ_PRIO + #if defined(UART_RX_IRQ_PRIO) || defined(UART_TX_IRQ_PRIO) || defined(UART_RX_DMA_IRQ_PRIO) void setPriority() { - NVIC_SetPriority(c_dev()->interrupts.rx_data_available.interrupt_number, UART_IRQ_PRIO); - NVIC_SetPriority(c_dev()->interrupts.rx_error.interrupt_number, UART_IRQ_PRIO); - NVIC_SetPriority(c_dev()->interrupts.tx_buffer_empty.interrupt_number, UART_IRQ_PRIO); - NVIC_SetPriority(c_dev()->interrupts.tx_complete.interrupt_number, UART_IRQ_PRIO); + #if defined(UART_RX_IRQ_PRIO) + NVIC_SetPriority(c_dev()->interrupts.rx_data_available.interrupt_number, UART_RX_IRQ_PRIO); + NVIC_SetPriority(c_dev()->interrupts.rx_error.interrupt_number, UART_RX_IRQ_PRIO); + #endif + + #if defined(UART_TX_IRQ_PRIO) + NVIC_SetPriority(c_dev()->interrupts.tx_buffer_empty.interrupt_number, UART_TX_IRQ_PRIO); + NVIC_SetPriority(c_dev()->interrupts.tx_complete.interrupt_number, UART_TX_IRQ_PRIO); + #endif + + #if defined(UART_RX_DMA_IRQ_PRIO) && ENABLED(SERIAL_DMA) + NVIC_SetPriority(c_dev()->dma.rx.rx_data_available_dma_btc.interrupt_number, UART_RX_DMA_IRQ_PRIO); + #endif } void begin(uint32_t baud) { @@ -47,7 +72,12 @@ struct MarlinSerial : public Usart { Usart::begin(baud, config); setPriority(); } - #endif + + void begin(uint32_t baud, const stc_usart_uart_init_t *config, const bool rxNoiseFilter = true) { + Usart::begin(baud, config, rxNoiseFilter); + setPriority(); + } + #endif // UART_RX_IRQ_PRIO || UART_TX_IRQ_PRIO || UART_RX_DMA_IRQ_PRIO }; typedef Serial1Class MSerialT; diff --git a/Marlin/src/HAL/HC32/app_config.h b/Marlin/src/HAL/HC32/app_config.h new file mode 100644 index 0000000000..fb291419fc --- /dev/null +++ b/Marlin/src/HAL/HC32/app_config.h @@ -0,0 +1,75 @@ +/** + * app_config.h is included by the hc32f460 arduino build script for every source file. + * it is used to configure the arduino core (and ddl) automatically according + * to the settings in Configuration.h and Configuration_adv.h. + */ +#pragma once +#ifndef _HC32_APP_CONFIG_H_ +#define _HC32_APP_CONFIG_H_ + +#include "../../inc/MarlinConfigPre.h" + +// +// dev mode +// +#if ENABLED(MARLIN_DEV_MODE) + #define __DEBUG 1 + #define __CORE_DEBUG 1 +#endif + +// +// Fault Handlers and Panic +// + +#if ENABLED(POSTMORTEM_DEBUGGING) + // disable arduino core fault handler, as we define our own + #define CORE_DISABLE_FAULT_HANDLER 1 +#endif + +// force-enable panic handler so that we can use our custom one (in MinSerial) +#define PANIC_ENABLE 1 + +// use short filenames in ddl debug and core panic output +#define __DEBUG_SHORT_FILENAMES 1 +#define __PANIC_SHORT_FILENAMES 1 + +// omit panic messages in core panic output +#define __OMIT_PANIC_MESSAGE 1 + +// +// Usart +// + +// disable serial globals (Serial1, Serial2, ...), as we define our own +#define DISABLE_SERIAL_GLOBALS 1 + +// increase the size of the Usart buffers (both RX and TX) +// NOTE: +// the heap usage will increase by (SERIAL_BUFFER_SIZE - 64) * "number of serial ports used" +// if running out of heap, the system may become unstable +//#define SERIAL_BUFFER_SIZE 256 + +// enable support for Usart Clock Divider / Oversampling auto config +#define USART_AUTO_CLKDIV_OS_CONFIG 1 + +// enable USART_RX_DMA_SUPPORT core option when SERIAL_DMA is enabled +#if ENABLED(SERIAL_DMA) + #define USART_RX_DMA_SUPPORT 1 +#endif + +// +// Misc. +// + +// redirect printf to host serial +#define REDIRECT_PRINTF_TO_SERIAL 1 + +// F_CPU must be known at compile time, but on HC32F460 it's not. +// Thus we assume HCLK to be 200MHz, as that's what is configured in +// 'core_hook_sysclock_init' in 'sysclock.cpp'. +// If you face issues with this assumption, please double-check with the values +// printed by 'MarlinHAL::HAL_clock_frequencies_dump'. +// see also: HAL_TIMER_RATE in timers.h +#define F_CPU 200000000 // 200MHz HCLK + +#endif // _HC32_APP_CONFIG_H_ diff --git a/Marlin/src/HAL/HC32/eeprom_bl24cxx.cpp b/Marlin/src/HAL/HC32/eeprom_bl24cxx.cpp index fe4a91384a..59da99b3f5 100644 --- a/Marlin/src/HAL/HC32/eeprom_bl24cxx.cpp +++ b/Marlin/src/HAL/HC32/eeprom_bl24cxx.cpp @@ -37,7 +37,7 @@ #error "MARLIN_EEPROM_SIZE is required for IIC_BL24CXX_EEPROM." #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { eeprom_init(); @@ -49,7 +49,7 @@ bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { uint8_t v = *value; - uint8_t *const p = (uint8_t *const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); // EEPROM has only ~100,000 write cycles, // so only write bytes that have changed! @@ -70,16 +70,10 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui return false; } -bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, - uint16_t *crc, const bool writing /*=true*/) { +bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing /*=true*/) { do { - uint8_t *const p = (uint8_t *const)pos; - uint8_t c = eeprom_read_byte(p); - if (writing) - { - *value = c; - } - + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); + if (writing) *value = c; crc16(crc, &c, 1); pos++; value++; diff --git a/Marlin/src/HAL/HC32/eeprom_sdcard.cpp b/Marlin/src/HAL/HC32/eeprom_sdcard.cpp index ec77c441a0..601e86dd30 100644 --- a/Marlin/src/HAL/HC32/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/HC32/eeprom_sdcard.cpp @@ -38,9 +38,7 @@ #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif -size_t PersistentStore::capacity() { - return MARLIN_EEPROM_SIZE; -} +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } #define _ALIGN(x) __attribute__((aligned(x))) static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE]; @@ -85,11 +83,10 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing /*=true*/) { for (size_t i = 0; i < size; i++) { - uint8_t c = HAL_eeprom_data[pos + i]; + const uint8_t c = HAL_eeprom_data[pos + i]; if (writing) value[i] = c; crc16(crc, &c, 1); } - pos += size; return false; } diff --git a/Marlin/src/HAL/HC32/eeprom_wired.cpp b/Marlin/src/HAL/HC32/eeprom_wired.cpp index 42c2563588..d9be65b4c0 100644 --- a/Marlin/src/HAL/HC32/eeprom_wired.cpp +++ b/Marlin/src/HAL/HC32/eeprom_wired.cpp @@ -35,7 +35,7 @@ #ifndef MARLIN_EEPROM_SIZE #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM." #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_finish() { return true; } @@ -56,7 +56,7 @@ bool PersistentStore::access_start() { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { - uint8_t *const p = (uint8_t *const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); uint8_t v = *value; // EEPROM has only ~100,000 write cycles, // so only write bytes that have changed! @@ -77,10 +77,8 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing /*=true*/) { do { - uint8_t c = eeprom_read_byte((uint8_t *)pos); - if (writing && value) { - *value = c; - } + const uint8_t c = eeprom_read_byte((uint8_t *)REAL_EEPROM_ADDR(pos)); + if (writing && value) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/HC32/endstop_interrupts.cpp b/Marlin/src/HAL/HC32/endstop_interrupts.cpp index a976fa1d3c..99987ec76f 100644 --- a/Marlin/src/HAL/HC32/endstop_interrupts.cpp +++ b/Marlin/src/HAL/HC32/endstop_interrupts.cpp @@ -40,9 +40,15 @@ void endstopIRQHandler() { CHECK(X_MAX); CHECK(X_MIN); + CHECK(X2_MAX); + CHECK(X2_MIN); + CHECK(Y_MAX); CHECK(Y_MIN); + CHECK(Y2_MAX); + CHECK(Y2_MIN); + CHECK(Z_MAX); CHECK(Z_MIN); @@ -52,6 +58,9 @@ void endstopIRQHandler() { CHECK(Z3_MAX); CHECK(Z3_MIN); + CHECK(Z4_MAX); + CHECK(Z4_MIN); + CHECK(Z_MIN_PROBE); // Update endstops @@ -69,9 +78,15 @@ void setup_endstop_interrupts() { SETUP(X_MAX); SETUP(X_MIN); + SETUP(X2_MAX); + SETUP(X2_MIN); + SETUP(Y_MAX); SETUP(Y_MIN); + SETUP(Y2_MAX); + SETUP(Y2_MIN); + SETUP(Z_MAX); SETUP(Z_MIN); @@ -81,6 +96,9 @@ void setup_endstop_interrupts() { SETUP(Z3_MAX); SETUP(Z3_MIN); + SETUP(Z4_MAX); + SETUP(Z4_MIN); + SETUP(Z_MIN_PROBE); #undef SETUP @@ -88,7 +106,7 @@ void setup_endstop_interrupts() { // Ensure 1 - 10 IRQs are registered // Disable some endstops if you encounter this error -#define ENDSTOPS_INTERRUPTS_COUNT COUNT_ENABLED(USE_X_MAX, USE_X_MIN, USE_Y_MAX, USE_Y_MIN, USE_Z_MAX, USE_Z_MIN, USE_Z2_MAX, USE_Z2_MIN, USE_Z3_MAX, USE_Z3_MIN, USE_Z_MIN_PROBE) +#define ENDSTOPS_INTERRUPTS_COUNT COUNT_ENABLED(USE_X_MAX, USE_X_MIN, USE_X2_MAX, USE_X2_MIN, USE_Y_MAX, USE_Y_MIN, USE_Y2_MAX, USE_Y2_MIN, USE_Z_MAX, USE_Z_MIN, USE_Z2_MAX, USE_Z2_MIN, USE_Z3_MAX, USE_Z3_MIN, USE_Z4_MAX, USE_Z4_MIN, USE_Z_MIN_PROBE) #if ENDSTOPS_INTERRUPTS_COUNT > 10 #error "Too many endstop interrupts! HC32F460 only supports 10 endstop interrupts." #elif ENDSTOPS_INTERRUPTS_COUNT == 0 diff --git a/Marlin/src/HAL/HC32/inc/Conditionals_type.h b/Marlin/src/HAL/HC32/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/HC32/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/HC32/inc/SanityCheck.h b/Marlin/src/HAL/HC32/inc/SanityCheck.h index d7c6894039..6b12e4d047 100644 --- a/Marlin/src/HAL/HC32/inc/SanityCheck.h +++ b/Marlin/src/HAL/HC32/inc/SanityCheck.h @@ -20,6 +20,20 @@ * */ #pragma once +#include + +#if !defined(ARDUINO_CORE_VERSION_INT) || !defined(GET_VERSION_INT) + // version macros were introduced in arduino core version 1.1.0 + // below that version, we polyfill them + #define GET_VERSION_INT(major, minor, patch) ((major * 100000) + (minor * 1000) + patch) + #define ARDUINO_CORE_VERSION_INT GET_VERSION_INT(1, 0, 0) +#endif + +#if ARDUINO_CORE_VERSION_INT < GET_VERSION_INT(1, 1, 0) + // because we use app_config.h introduced in arduino core version 1.1.0, the + // HAL is not compatible with older versions + #error "The HC32 HAL is not compatible with Arduino Core versions < 1.1.0. Consider updating the Arduino Core." +#endif #ifndef BOARD_XTAL_FREQUENCY #error "BOARD_XTAL_FREQUENCY is required for HC32F460." @@ -58,11 +72,9 @@ #endif #if TEMP_SENSOR_SOC - #if !defined(TEMP_SOC_PIN) + #ifndef TEMP_SOC_PIN #error "TEMP_SOC_PIN must be defined to use TEMP_SENSOR_SOC." - #endif - - #if defined(TEMP_SOC_PIN) && IS_GPIO_PIN(TEMP_SOC_PIN) + #elif IS_GPIO_PIN(TEMP_SOC_PIN) #error "TEMP_SOC_PIN must not be a valid GPIO pin to avoid conflicts." #endif #endif @@ -76,3 +88,18 @@ #error "HC32 HAL uses a custom panic handler. Do not define PANIC_USARTx_TX_PIN." #endif #endif + +#if ENABLED(SERIAL_DMA) + #if !defined(USART_RX_DMA_SUPPORT) + #error "SERIAL_DMA requires USART_RX_DMA_SUPPORT to be enabled in the arduino core." + #endif + + // USART_RX_DMA_SUPPORT does not implement core_hook_usart_rx_irq, which is required for the emergency parser + #if ENABLED(EMERGENCY_PARSER) + #error "EMERGENCY_PARSER is not supported with SERIAL_DMA. Please disable either SERIAL_DMA or EMERGENCY_PARSER." + #endif + + #if ARDUINO_CORE_VERSION_INT < GET_VERSION_INT(1, 1, 0) + #error "SERIAL_DMA is not supported with arduino core version < 1.1.0." + #endif +#endif diff --git a/Marlin/src/HAL/HC32/printf_retarget.cpp b/Marlin/src/HAL/HC32/printf_retarget.cpp index 2c98415dff..8a48aca3d4 100644 --- a/Marlin/src/HAL/HC32/printf_retarget.cpp +++ b/Marlin/src/HAL/HC32/printf_retarget.cpp @@ -23,7 +23,7 @@ #ifdef ARDUINO_ARCH_HC32 #ifdef REDIRECT_PRINTF_TO_SERIAL -#if !defined(__GNUC__) +#ifndef __GNUC__ #error "only GCC is supported" #endif diff --git a/Marlin/src/HAL/HC32/sdio.cpp b/Marlin/src/HAL/HC32/sdio.cpp index 4360d715ff..3c4038f92d 100644 --- a/Marlin/src/HAL/HC32/sdio.cpp +++ b/Marlin/src/HAL/HC32/sdio.cpp @@ -54,7 +54,7 @@ fn \ } -stc_sd_handle_t *handle; +stc_sd_handle_t *handle = nullptr; bool SDIO_Init() { // Configure SDIO pins @@ -66,36 +66,45 @@ bool SDIO_Init() { GPIO_SetFunc(BOARD_SDIO_CMD, Func_Sdio); GPIO_SetFunc(BOARD_SDIO_DET, Func_Sdio); + // If a handle is already initialized, free it before creating a new one + // otherwise, we will leak memory, which will eventually crash the system + if (handle != nullptr) { + delete handle->pstcDmaInitCfg; + delete handle->pstcCardInitCfg; + delete handle; + handle = nullptr; + } + // Create DMA configuration stc_sdcard_dma_init_t *dmaConf = new stc_sdcard_dma_init_t; dmaConf->DMAx = SDIO_DMA_PERIPHERAL; dmaConf->enDmaCh = SDIO_DMA_CHANNEL; + // Create card configuration + // This should be a fairly safe configuration for most cards + stc_sdcard_init_t *cardConf = new stc_sdcard_init_t; + cardConf->enBusWidth = SdiocBusWidth4Bit; + cardConf->enClkFreq = SdiocClk400K; + cardConf->enSpeedMode = SdiocNormalSpeedMode; + cardConf->pstcInitCfg = nullptr; + // Create handle in DMA mode handle = new stc_sd_handle_t; handle->SDIOCx = SDIO_PERIPHERAL; handle->enDevMode = SdCardDmaMode; handle->pstcDmaInitCfg = dmaConf; - - // Create card configuration - // This should be a fairly safe configuration for most cards - stc_sdcard_init_t cardConf = { - .enBusWidth = SdiocBusWidth4Bit, - .enClkFreq = SdiocClk400K, - .enSpeedMode = SdiocNormalSpeedMode, - //.pstcInitCfg = NULL, - }; + //handle->pstcCardInitCfg = cardConf; // assigned in SDCARD_Init // Initialize sd card - en_result_t rc = SDCARD_Init(handle, &cardConf); + en_result_t rc = SDCARD_Init(handle, cardConf); if (rc != Ok) printf("SDIO_Init() error (rc=%u)\n", rc); return rc == Ok; } bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { - CORE_ASSERT(handle != NULL, "SDIO not initialized"); - CORE_ASSERT(dst != NULL, "SDIO_ReadBlock dst is NULL"); + CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false); + CORE_ASSERT(dst != nullptr, "SDIO_ReadBlock dst is NULL", return false); WITH_RETRY(SDIO_READ_RETRIES, { en_result_t rc = SDCARD_ReadBlocks(handle, block, 1, dst, SDIO_READ_TIMEOUT); @@ -107,8 +116,8 @@ bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { } bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { - CORE_ASSERT(handle != NULL, "SDIO not initialized"); - CORE_ASSERT(src != NULL, "SDIO_WriteBlock src is NULL"); + CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false); + CORE_ASSERT(src != nullptr, "SDIO_WriteBlock src is NULL", return false); WITH_RETRY(SDIO_WRITE_RETRIES, { en_result_t rc = SDCARD_WriteBlocks(handle, block, 1, (uint8_t *)src, SDIO_WRITE_TIMEOUT); @@ -120,12 +129,12 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { } bool SDIO_IsReady() { - CORE_ASSERT(handle != NULL, "SDIO not initialized"); + CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false); return bool(handle->stcCardStatus.READY_FOR_DATA); } uint32_t SDIO_GetCardSize() { - CORE_ASSERT(handle != NULL, "SDIO not initialized"); + CORE_ASSERT(handle != nullptr, "SDIO not initialized", return 0); // Multiply number of blocks with block size to get size in bytes const uint64_t cardSizeBytes = uint64_t(handle->stcSdCardInfo.u32LogBlockNbr) * uint64_t(handle->stcSdCardInfo.u32LogBlockSize); diff --git a/Marlin/src/HAL/HC32/sysclock.cpp b/Marlin/src/HAL/HC32/sysclock.cpp index d205d725cc..3057da1a02 100644 --- a/Marlin/src/HAL/HC32/sysclock.cpp +++ b/Marlin/src/HAL/HC32/sysclock.cpp @@ -96,29 +96,44 @@ void core_hook_sysclock_init() { #endif #endif - // Setup clock divisors for sysclk = 200 MHz: + // sysclk is now configured according to F_CPU (i.e., 200MHz PLL output) + constexpr uint32_t sysclock = F_CPU; + + // Setup clock divisors for sysclk = 200 MHz // Note: PCLK1 is used for step+temp timers, and need to be kept at 50 MHz (until there is a better solution) - stc_clk_sysclk_cfg_t sysClkConf = { + constexpr stc_clk_sysclk_cfg_t sysClkConf = { .enHclkDiv = ClkSysclkDiv1, // HCLK = 200 MHz (CPU) .enExclkDiv = ClkSysclkDiv2, // EXCLK = 100 MHz (SDIO) - .enPclk0Div = ClkSysclkDiv1, // PCLK0 = 200 MHz (Timer6 (not used)) + .enPclk0Div = ClkSysclkDiv2, // PCLK0 = 100 MHz (Timer6 (not used)) .enPclk1Div = ClkSysclkDiv4, // PCLK1 = 50 MHz (USART, SPI, I2S, Timer0 (step+temp), TimerA (Servo)) - .enPclk2Div = ClkSysclkDiv4, // PCLK2 = 50 MHz (ADC) - .enPclk3Div = ClkSysclkDiv4, // PCLK3 = 50 MHz (I2C, WDT) + .enPclk2Div = ClkSysclkDiv8, // PCLK2 = 25 MHz (ADC) + .enPclk3Div = ClkSysclkDiv8, // PCLK3 = 25 MHz (I2C, WDT) .enPclk4Div = ClkSysclkDiv2, // PCLK4 = 100 MHz (ADC ctl) }; + + #if ARDUINO_CORE_VERSION_INT >= GET_VERSION_INT(1, 2, 0) + assert_system_clocks_valid< + sysclock, + sysClkConf.enHclkDiv, + sysClkConf.enPclk0Div, + sysClkConf.enPclk1Div, + sysClkConf.enPclk2Div, + sysClkConf.enPclk3Div, + sysClkConf.enPclk4Div, + sysClkConf.enExclkDiv + >(); + #endif + sysclock_set_clock_dividers(&sysClkConf); // Set power mode - #define POWER_MODE_SYSTEM_CLOCK 200000000 // 200 MHz - power_mode_update_pre(POWER_MODE_SYSTEM_CLOCK); + power_mode_update_pre(sysclock); // Switch to MPLL as sysclk source CLK_SetSysClkSource(CLKSysSrcMPLL); // Set power mode - power_mode_update_post(POWER_MODE_SYSTEM_CLOCK); - #undef POWER_MODE_SYSTEM_CLOCK + power_mode_update_post(sysclock); } #endif // ARDUINO_ARCH_HC32 diff --git a/Marlin/src/HAL/HC32/timers.h b/Marlin/src/HAL/HC32/timers.h index 17d8967982..f5a590deb1 100644 --- a/Marlin/src/HAL/HC32/timers.h +++ b/Marlin/src/HAL/HC32/timers.h @@ -38,44 +38,48 @@ extern Timer0 step_timer; // Timer Configurations // -// TODO: some calculations (step irq min_step_rate) require the timer rate to be known at compile time -// this is not possible with the HC32F460, as the timer rate depends on PCLK1 -// as a workaround, PCLK1 = 50MHz is assumed (check with clock dump in MarlinHAL::init()) -#define HAL_TIMER_RATE 50000000 // 50MHz -// #define HAL_TIMER_RATE TIMER0_BASE_FREQUENCY - -// TODO: CYCLES_PER_MICROSECOND seems to be used by Marlin to calculate the number of cycles per microsecond in the timer ISRs -// by default, it uses F_CPU, but since that is not known at compile time for HC32, we overwrite it here -#undef CYCLES_PER_MICROSECOND -#define CYCLES_PER_MICROSECOND (HAL_TIMER_RATE / 1000000UL) +/** + * HAL_TIMER_RATE must be known at compile time since it's used to calculate + * STEPPER_TIMER_RATE, which is used in 'constexpr' calculations. + * On the HC32F460 the timer rate depends on PCLK1, which is derived from the + * system clock configured at runtime. As a workaround, we use the existing + * assumption of a 200MHz clock, defining F_CPU as 200000000, then configure PCLK1 + * as F_CPU with a divider of 4 in 'sysclock.cpp::core_hook_sysclock_init'. + * + * If you face issues with this assumption, please double-check with the values + * printed by 'MarlinHAL::HAL_clock_frequencies_dump'. + * + * TODO: If the 'constexpr' requirement is ever lifted, use TIMER0_BASE_FREQUENCY instead + */ +#define HAL_TIMER_RATE (F_CPU / 4) // i.e., 50MHz +//#define HAL_TIMER_RATE TIMER0_BASE_FREQUENCY // Temperature timer -#define TEMP_TIMER_NUM (&temp_timer) -#define TEMP_TIMER_PRIORITY DDL_IRQ_PRIORITY_02 -#define TEMP_TIMER_PRESCALE 16ul -#define TEMP_TIMER_RATE 1000 // 1kHz -#define TEMP_TIMER_FREQUENCY TEMP_TIMER_RATE // Alias for Marlin +#define TEMP_TIMER_NUM (&temp_timer) +#define TEMP_TIMER_PRIORITY DDL_IRQ_PRIORITY_02 +#define TEMP_TIMER_PRESCALE 16UL // 12.5MHz +#define TEMP_TIMER_RATE 1000 // 1kHz +#define TEMP_TIMER_FREQUENCY TEMP_TIMER_RATE // 1kHz also // Stepper timer -#define STEP_TIMER_NUM (&step_timer) -#define STEP_TIMER_PRIORITY DDL_IRQ_PRIORITY_01 -#define STEPPER_TIMER_PRESCALE 16ul +#define STEP_TIMER_NUM (&step_timer) +#define STEP_TIMER_PRIORITY DDL_IRQ_PRIORITY_00 // Top priority, nothing else uses it +#define STEPPER_TIMER_PRESCALE 16UL // 12.5MHz -// TODO: STEPPER_TIMER_RATE seems to work fine like this, but requires further testing... -#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // 50MHz / 16 = 3.125MHz -#define STEPPER_TIMER_TICKS_PER_US (STEPPER_TIMER_RATE / 1000000) +#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // 50MHz / 16 = 3.125MHz +#define STEPPER_TIMER_TICKS_PER_US (STEPPER_TIMER_RATE / 1000000UL) // Integer 3 // Pulse timer (== stepper timer) -#define PULSE_TIMER_NUM STEP_TIMER_NUM -#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE -#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US +#define PULSE_TIMER_NUM STEP_TIMER_NUM +#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE +#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US // // Channel aliases // -#define MF_TIMER_TEMP TEMP_TIMER_NUM -#define MF_TIMER_STEP STEP_TIMER_NUM -#define MF_TIMER_PULSE PULSE_TIMER_NUM +#define MF_TIMER_TEMP TEMP_TIMER_NUM +#define MF_TIMER_STEP STEP_TIMER_NUM +#define MF_TIMER_PULSE PULSE_TIMER_NUM // // HAL functions diff --git a/Marlin/src/HAL/LINUX/eeprom.cpp b/Marlin/src/HAL/LINUX/eeprom.cpp index f878bba6a5..2b9b37e66d 100644 --- a/Marlin/src/HAL/LINUX/eeprom.cpp +++ b/Marlin/src/HAL/LINUX/eeprom.cpp @@ -35,7 +35,7 @@ uint8_t buffer[MARLIN_EEPROM_SIZE]; char filename[] = "eeprom.dat"; -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { const char eeprom_erase_value = 0xFF; diff --git a/Marlin/src/HAL/LINUX/hardware/Timer.cpp b/Marlin/src/HAL/LINUX/hardware/Timer.cpp index 9f0d6a8f3a..013690a404 100644 --- a/Marlin/src/HAL/LINUX/hardware/Timer.cpp +++ b/Marlin/src/HAL/LINUX/hardware/Timer.cpp @@ -37,7 +37,10 @@ Timer::Timer() { } Timer::~Timer() { - timer_delete(timerid); + if (timerid != 0) { + timer_delete(timerid); + timerid = 0; + } } void Timer::init(uint32_t sig_id, uint32_t sim_freq, callback_fn* fn) { diff --git a/Marlin/src/HAL/LINUX/inc/Conditionals_type.h b/Marlin/src/HAL/LINUX/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/LINUX/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/LINUX/main.cpp b/Marlin/src/HAL/LINUX/main.cpp index f2af2ff33f..27a066d619 100644 --- a/Marlin/src/HAL/LINUX/main.cpp +++ b/Marlin/src/HAL/LINUX/main.cpp @@ -21,6 +21,7 @@ */ #ifdef __PLAT_LINUX__ +#ifndef UNIT_TEST //#define GPIO_LOGGING // Full GPIO and Positional Logging @@ -135,4 +136,5 @@ int main() { read_serial.join(); } +#endif // UNIT_TEST #endif // __PLAT_LINUX__ diff --git a/Marlin/src/HAL/LINUX/servo_private.h b/Marlin/src/HAL/LINUX/servo_private.h index bcc8d2037f..11e1c2b93c 100644 --- a/Marlin/src/HAL/LINUX/servo_private.h +++ b/Marlin/src/HAL/LINUX/servo_private.h @@ -60,7 +60,6 @@ #define INVALID_SERVO 255 // flag indicating an invalid servo index - // Types typedef struct { diff --git a/Marlin/src/HAL/LINUX/spi_pins.h b/Marlin/src/HAL/LINUX/spi_pins.h index 7bd2498be7..607b964281 100644 --- a/Marlin/src/HAL/LINUX/spi_pins.h +++ b/Marlin/src/HAL/LINUX/spi_pins.h @@ -21,9 +21,6 @@ */ #pragma once -#include "../../core/macros.h" -#include "../../inc/MarlinConfigPre.h" - #if ALL(HAS_MARLINUI_U8GLIB, HAS_MEDIA) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) #define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently // needed due to the speed and mode required for communicating with each device being different. diff --git a/Marlin/src/HAL/LPC1768/eeprom_flash.cpp b/Marlin/src/HAL/LPC1768/eeprom_flash.cpp index 38d2705d51..9f873d5774 100644 --- a/Marlin/src/HAL/LPC1768/eeprom_flash.cpp +++ b/Marlin/src/HAL/LPC1768/eeprom_flash.cpp @@ -61,7 +61,7 @@ static uint8_t ram_eeprom[MARLIN_EEPROM_SIZE] __attribute__((aligned(4))) = {0}; static bool eeprom_dirty = false; static int current_slot = 0; -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { uint32_t first_nblank_loc, first_nblank_val; @@ -112,7 +112,8 @@ bool PersistentStore::access_finish() { } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - for (size_t i = 0; i < size; i++) ram_eeprom[pos + i] = value[i]; + const int p = REAL_EEPROM_ADDR(pos); + for (size_t i = 0; i < size; i++) ram_eeprom[p + i] = value[i]; eeprom_dirty = true; crc16(crc, value, size); pos += size; @@ -120,8 +121,9 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui } bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { + const int p = REAL_EEPROM_ADDR(pos); const uint8_t * const buff = writing ? &value[0] : &ram_eeprom[pos]; - if (writing) for (size_t i = 0; i < size; i++) value[i] = ram_eeprom[pos + i]; + if (writing) for (size_t i = 0; i < size; i++) value[i] = ram_eeprom[p + i]; crc16(crc, buff, size); pos += size; return false; // return true for any error diff --git a/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp b/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp index 4f1797dc6a..30ecb01a09 100644 --- a/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp @@ -49,7 +49,7 @@ bool eeprom_file_open = false; #define MARLIN_EEPROM_SIZE size_t(0x1000) // 4KiB of Emulated EEPROM #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { const char eeprom_erase_value = 0xFF; diff --git a/Marlin/src/HAL/LPC1768/eeprom_wired.cpp b/Marlin/src/HAL/LPC1768/eeprom_wired.cpp index 1bbc39d4a2..3230e29afc 100644 --- a/Marlin/src/HAL/LPC1768/eeprom_wired.cpp +++ b/Marlin/src/HAL/LPC1768/eeprom_wired.cpp @@ -36,7 +36,7 @@ #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE 0x8000 // 32K #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } @@ -45,7 +45,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui uint16_t written = 0; while (size--) { uint8_t v = *value; - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes @@ -64,7 +64,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { // Read from external EEPROM - const uint8_t c = eeprom_read_byte((uint8_t*)pos); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/LPC1768/inc/Conditionals_type.h b/Marlin/src/HAL/LPC1768/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/LPC1768/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/LPC1768/spi_pins.h b/Marlin/src/HAL/LPC1768/spi_pins.h index babe8a11d7..295d6462fd 100644 --- a/Marlin/src/HAL/LPC1768/spi_pins.h +++ b/Marlin/src/HAL/LPC1768/spi_pins.h @@ -21,9 +21,7 @@ */ #pragma once -#include "../../core/macros.h" - -#if ALL(HAS_MEDIA, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) +#if ALL(HAS_MARLINUI_U8GLIB, HAS_MEDIA) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) #define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently // needed due to the speed and mode required for communicating with each device being different. // This requirement can be removed if the SPI access to these devices is updated to use diff --git a/Marlin/src/HAL/LPC1768/win_usb_driver/lpc176x_usb_driver.inf b/Marlin/src/HAL/LPC1768/win_usb_driver/lpc176x_usb_driver.inf index 4732eb8552..37d9a617db 100644 --- a/Marlin/src/HAL/LPC1768/win_usb_driver/lpc176x_usb_driver.inf +++ b/Marlin/src/HAL/LPC1768/win_usb_driver/lpc176x_usb_driver.inf @@ -8,14 +8,12 @@ DriverVer =04/14/2008, 5.1.2600.5512 [Manufacturer] %PROVIDER%=DeviceList,ntamd64 - [DeviceList] %DESCRIPTION%=LPC1768USB, USB\VID_1D50&PID_6029&MI_00 [DeviceList.ntamd64] %DESCRIPTION%=LPC1768USB, USB\VID_1D50&PID_6029&MI_00 - [LPC1768USB] include=mdmcpq.inf CopyFiles=FakeModemCopyFileSection @@ -28,9 +26,8 @@ AddService=usbser, 0x00000002, LowerFilter_Service_Inst [SerialPropPageAddReg] HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" - [Strings] PROVIDER = "marlinfw.org" DRIVER.SVC = "Marlin USB Driver" DESCRIPTION= "Marlin USB Serial" -COMPOSITE = "Marlin USB VCOM" \ No newline at end of file +COMPOSITE = "Marlin USB VCOM" diff --git a/Marlin/src/HAL/NATIVE_SIM/inc/Conditionals_type.h b/Marlin/src/HAL/NATIVE_SIM/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/NATIVE_SIM/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/NATIVE_SIM/servo_private.h b/Marlin/src/HAL/NATIVE_SIM/servo_private.h index 06be1893f6..e0eb30ab28 100644 --- a/Marlin/src/HAL/NATIVE_SIM/servo_private.h +++ b/Marlin/src/HAL/NATIVE_SIM/servo_private.h @@ -61,7 +61,6 @@ #define INVALID_SERVO 255 // flag indicating an invalid servo index - // Types typedef struct { diff --git a/Marlin/src/HAL/NATIVE_SIM/spi_pins.h b/Marlin/src/HAL/NATIVE_SIM/spi_pins.h index 9b1bae9a58..d9911bf56c 100644 --- a/Marlin/src/HAL/NATIVE_SIM/spi_pins.h +++ b/Marlin/src/HAL/NATIVE_SIM/spi_pins.h @@ -21,9 +21,6 @@ */ #pragma once -#include "../../core/macros.h" -#include "../../inc/MarlinConfigPre.h" - #if ALL(HAS_MARLINUI_U8GLIB, HAS_MEDIA) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_EN == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN) #define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently // needed due to the speed and mode required for communicating with each device being different. diff --git a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h index c27c84e8c3..39af4d7e68 100644 --- a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h +++ b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h @@ -31,7 +31,6 @@ * resulted in using about about 25% of the CPU's time. */ - #ifdef __cplusplus extern "C" { #endif diff --git a/Marlin/src/HAL/SAMD21/HAL.cpp b/Marlin/src/HAL/SAMD21/HAL.cpp index 1bc0406ab3..3656d97190 100644 --- a/Marlin/src/HAL/SAMD21/HAL.cpp +++ b/Marlin/src/HAL/SAMD21/HAL.cpp @@ -40,8 +40,6 @@ DefaultSerial3 MSerial2(false, Serial2); #endif - - #define WDT_CONFIG_PER_7_Val 0x9u #define WDT_CONFIG_PER_Pos 0 #define WDT_CONFIG_PER_7 (WDT_CONFIG_PER_7_Val << WDT_CONFIG_PER_Pos) @@ -165,7 +163,6 @@ void MarlinHAL::adc_init() { ADC->REFCTRL.reg = ADC_REFCTRL_REFSEL_INTVCC1; ADC->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_32| ADC_AVGCTRL_ADJRES(4);; - ADC->CTRLB.reg = ADC_CTRLB_PRESCALER_DIV128 | ADC_CTRLB_RESSEL_16BIT | ADC_CTRLB_FREERUN; diff --git a/Marlin/src/HAL/SAMD21/HAL.h b/Marlin/src/HAL/SAMD21/HAL.h index fe72859549..95f391fa86 100644 --- a/Marlin/src/HAL/SAMD21/HAL.h +++ b/Marlin/src/HAL/SAMD21/HAL.h @@ -47,7 +47,6 @@ typedef ForwardSerial1Class< decltype(Serial2) > DefaultSerial3; extern DefaultSerial2 MSerial0; extern DefaultSerial3 MSerial1; - #define __MSERIAL(X) MSerial##X #define _MSERIAL(X) __MSERIAL(X) #define MSERIAL(X) _MSERIAL(INCREMENT(X)) diff --git a/Marlin/src/HAL/SAMD21/SAMD21.h b/Marlin/src/HAL/SAMD21/SAMD21.h index 8e9d17fc50..b64c5ce725 100644 --- a/Marlin/src/HAL/SAMD21/SAMD21.h +++ b/Marlin/src/HAL/SAMD21/SAMD21.h @@ -57,8 +57,6 @@ : (P == 3 && WITHIN(B, 20, 21)) ? 10 + (B) - 20 \ : -1) - - #define A2_AIN 3 #define A3_AIN 4 #define A4_AIN 5 diff --git a/Marlin/src/HAL/SAMD21/Servo.cpp b/Marlin/src/HAL/SAMD21/Servo.cpp index 38b995fc9a..704d0a2904 100644 --- a/Marlin/src/HAL/SAMD21/Servo.cpp +++ b/Marlin/src/HAL/SAMD21/Servo.cpp @@ -55,7 +55,6 @@ #define TIMER_TCCHANNEL(t) ((t) & 1) #define TC_COUNTER_START_VAL 0xFFFF - static volatile int8_t currentServoIndex[_Nbr_16timers]; // index for the servo being pulsed for each timer (or -1 if refresh interval) FORCE_INLINE static uint16_t getTimerCount() { diff --git a/Marlin/src/HAL/SAMD21/eeprom_flash.cpp b/Marlin/src/HAL/SAMD21/eeprom_flash.cpp index 4a4e328d1a..66329bff19 100644 --- a/Marlin/src/HAL/SAMD21/eeprom_flash.cpp +++ b/Marlin/src/HAL/SAMD21/eeprom_flash.cpp @@ -37,19 +37,24 @@ static const uint8_t flashdata[TOTAL_FLASH_SIZE] __attribute__((__aligned__(256 #include "../shared/eeprom_api.h" -size_t PersistentStore::capacity() { - return MARLIN_EEPROM_SIZE; - /* const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ, +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } + +/* +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } + const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ, sblk = NVMCTRL->SEESTAT.bit.SBLK; - return (!psz && !sblk) ? 0 - : (psz <= 2) ? (0x200 << psz) - : (sblk == 1 || psz == 3) ? 4096 - : (sblk == 2 || psz == 4) ? 8192 - : (sblk <= 4 || psz == 5) ? 16384 - : (sblk >= 9 && psz == 7) ? 65536 - : 32768;*/ + return ( + (!psz && !sblk) ? 0 + : (psz <= 2) ? (0x200 << psz) + : (sblk == 1 || psz == 3) ? 4096 + : (sblk == 2 || psz == 4) ? 8192 + : (sblk <= 4 || psz == 5) ? 16384 + : (sblk >= 9 && psz == 7) ? 65536 + : 32768 + ) - eeprom_exclude_size; } +*/ uint32_t PAGE_SIZE; uint32_t ROW_SIZE; @@ -99,8 +104,7 @@ bool PersistentStore::access_finish() { volatile uint32_t *dst_addr = (volatile uint32_t *) &flashdata; uint32_t *pointer = (uint32_t *) buffer; - for (uint32_t i = 0; i < TOTAL_FLASH_SIZE; i+=4) { - + for (uint32_t i = 0; i < TOTAL_FLASH_SIZE; i += 4) { *dst_addr = (uint32_t) *pointer; pointer++; dst_addr ++; @@ -120,19 +124,19 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (!hasWritten) { // init temp buffer buffer = (uint8_t *) malloc(MARLIN_EEPROM_SIZE); - hasWritten=true; + hasWritten = true; } - memcpy(buffer+pos,value,size); + memcpy(buffer + REAL_EEPROM_ADDR(pos), value, size); pos += size; return false; } bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { - volatile uint8_t *dst_addr = (volatile uint8_t *) &flashdata; - dst_addr += pos; + volatile uint8_t *dst_addr = (volatile uint8_t *) &flashdata; + dst_addr += REAL_EEPROM_ADDR(pos); - memcpy(value,(const void *) dst_addr,size); + memcpy(value, (const void *)dst_addr, size); pos += size; return false; } diff --git a/Marlin/src/HAL/SAMD21/eeprom_qspi.cpp b/Marlin/src/HAL/SAMD21/eeprom_qspi.cpp index 587dcb0b14..12977a178c 100644 --- a/Marlin/src/HAL/SAMD21/eeprom_qspi.cpp +++ b/Marlin/src/HAL/SAMD21/eeprom_qspi.cpp @@ -38,7 +38,7 @@ static bool initialized; -size_t PersistentStore::capacity() { return qspi.size(); } +size_t PersistentStore::capacity() { return qspi.size() - eeprom_exclude_size; } bool PersistentStore::access_start() { if (!initialized) { @@ -56,7 +56,7 @@ bool PersistentStore::access_finish() { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { const uint8_t v = *value; - qspi.writeByte(pos, v); + qspi.writeByte(REAL_EEPROM_ADDR(pos), v); crc16(crc, &v, 1); pos++; value++; @@ -66,7 +66,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { while (size--) { - uint8_t c = qspi.readByte(pos); + const uint8_t c = qspi.readByte(REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/SAMD21/eeprom_wired.cpp b/Marlin/src/HAL/SAMD21/eeprom_wired.cpp index ab71e616fc..da0eb1b0c8 100644 --- a/Marlin/src/HAL/SAMD21/eeprom_wired.cpp +++ b/Marlin/src/HAL/SAMD21/eeprom_wired.cpp @@ -42,7 +42,7 @@ #ifndef MARLIN_EEPROM_SIZE #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM." #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } @@ -51,7 +51,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui uint16_t written = 0; while (size--) { const uint8_t v = *value; - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes @@ -69,7 +69,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { while (size--) { - uint8_t c = eeprom_read_byte((uint8_t*)pos); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/SAMD21/inc/Conditionals_type.h b/Marlin/src/HAL/SAMD21/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/SAMD21/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp b/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp index 42630a6ce5..2e2b0d8f8d 100644 --- a/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp +++ b/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp @@ -85,7 +85,6 @@ void u8g_SetPILevel(u8g_t *u8g, uint8_t pin_index, uint8_t level) { uint8_t u8g_com_samd21_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - switch (msg) { case U8G_COM_MSG_STOP: break; diff --git a/Marlin/src/HAL/SAMD51/Servo.cpp b/Marlin/src/HAL/SAMD51/Servo.cpp index e533eee301..059955e11a 100644 --- a/Marlin/src/HAL/SAMD51/Servo.cpp +++ b/Marlin/src/HAL/SAMD51/Servo.cpp @@ -54,7 +54,6 @@ #define TIMER_TCCHANNEL(t) ((t) & 1) #define TC_COUNTER_START_VAL 0xFFFF - static volatile int8_t currentServoIndex[_Nbr_16timers]; // index for the servo being pulsed for each timer (or -1 if refresh interval) FORCE_INLINE static uint16_t getTimerCount() { diff --git a/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp b/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp index 1c82ede040..a39e4c4fa3 100644 --- a/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp +++ b/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp @@ -35,7 +35,7 @@ static bool initialized; -size_t PersistentStore::capacity() { return qspi.size(); } +size_t PersistentStore::capacity() { return qspi.size() - eeprom_exclude_size; } bool PersistentStore::access_start() { if (!initialized) { @@ -53,7 +53,7 @@ bool PersistentStore::access_finish() { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { const uint8_t v = *value; - qspi.writeByte(pos, v); + qspi.writeByte(REAL_EEPROM_ADDR(pos), v); crc16(crc, &v, 1); pos++; value++; @@ -63,7 +63,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { while (size--) { - uint8_t c = qspi.readByte(pos); + const uint8_t c = qspi.readByte(REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/SAMD51/eeprom_wired.cpp b/Marlin/src/HAL/SAMD51/eeprom_wired.cpp index 7a03d4eaa3..00a739a587 100644 --- a/Marlin/src/HAL/SAMD51/eeprom_wired.cpp +++ b/Marlin/src/HAL/SAMD51/eeprom_wired.cpp @@ -40,7 +40,7 @@ #ifndef MARLIN_EEPROM_SIZE #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM." #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } @@ -49,7 +49,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui uint16_t written = 0; while (size--) { const uint8_t v = *value; - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes @@ -67,7 +67,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { while (size--) { - uint8_t c = eeprom_read_byte((uint8_t*)pos); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/SAMD51/inc/Conditionals_type.h b/Marlin/src/HAL/SAMD51/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/SAMD51/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/STM32/HardwareSerial.cpp b/Marlin/src/HAL/STM32/HardwareSerial.cpp index a6f97f356e..2a389447b7 100644 --- a/Marlin/src/HAL/STM32/HardwareSerial.cpp +++ b/Marlin/src/HAL/STM32/HardwareSerial.cpp @@ -126,7 +126,7 @@ void serialEvent2() __attribute__((weak)); #endif #ifdef USING_HW_SERIAL3 - HAL_HardwareSerial Serial3(USART3); + HAL_HardwareSerial HSerial3(USART3); void serialEvent3() __attribute__((weak)); #endif #ifdef USING_HW_SERIAL4 @@ -147,11 +147,11 @@ #endif #ifdef USING_HW_SERIAL6 #ifdef USART6 - HAL_HardwareSerial HSerial5(USART6); + HAL_HardwareSerial HSerial6(USART6); #else - HAL_HardwareSerial HSerial5(UART6); + HAL_HardwareSerial HSerial6(UART6); #endif - void serialEvent5() __attribute__((weak)); + void serialEvent6() __attribute__((weak)); #endif // Constructors //////////////////////////////////////////////////////////////// diff --git a/Marlin/src/HAL/STM32/MarlinSerial.h b/Marlin/src/HAL/STM32/MarlinSerial.h index 4ab1e4e75a..d9311a98da 100644 --- a/Marlin/src/HAL/STM32/MarlinSerial.h +++ b/Marlin/src/HAL/STM32/MarlinSerial.h @@ -53,6 +53,7 @@ inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); } void _rx_complete_irq(serial_t *obj); + FORCE_INLINE static uint8_t buffer_overruns() { return 0; } // Not implemented. Void to avoid platform-dependent code. protected: usart_rx_callback_t _rx_callback; diff --git a/Marlin/src/HAL/STM32/eeprom_bl24cxx.cpp b/Marlin/src/HAL/STM32/eeprom_bl24cxx.cpp index f30b3dedb2..3e0bb58dad 100644 --- a/Marlin/src/HAL/STM32/eeprom_bl24cxx.cpp +++ b/Marlin/src/HAL/STM32/eeprom_bl24cxx.cpp @@ -44,7 +44,7 @@ #error "MARLIN_EEPROM_SIZE is required for IIC_BL24CXX_EEPROM." #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } @@ -53,7 +53,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui uint16_t written = 0; while (size--) { uint8_t v = *value; - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes @@ -71,8 +71,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { - uint8_t * const p = (uint8_t * const)pos; - uint8_t c = eeprom_read_byte(p); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/STM32/eeprom_flash.cpp b/Marlin/src/HAL/STM32/eeprom_flash.cpp index 69511c6de4..37963ad501 100644 --- a/Marlin/src/HAL/STM32/eeprom_flash.cpp +++ b/Marlin/src/HAL/STM32/eeprom_flash.cpp @@ -101,7 +101,7 @@ static bool eeprom_data_written = false; #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE size_t(E2END + 1) #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { @@ -245,14 +245,15 @@ bool PersistentStore::access_finish() { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { uint8_t v = *value; + const int p = REAL_EEPROM_ADDR(pos); #if ENABLED(FLASH_EEPROM_LEVELING) - if (v != ram_eeprom[pos]) { - ram_eeprom[pos] = v; + if (v != ram_eeprom[p]) { + ram_eeprom[p] = v; eeprom_data_written = true; } #else - if (v != eeprom_buffered_read_byte(pos)) { - eeprom_buffered_write_byte(pos, v); + if (v != eeprom_buffered_read_byte(p)) { + eeprom_buffered_write_byte(p, v); eeprom_data_written = true; } #endif @@ -265,7 +266,8 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { - const uint8_t c = TERN(FLASH_EEPROM_LEVELING, ram_eeprom[pos], eeprom_buffered_read_byte(pos)); + const int p = REAL_EEPROM_ADDR(pos); + const uint8_t c = TERN(FLASH_EEPROM_LEVELING, ram_eeprom[p], eeprom_buffered_read_byte(p)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp index 1b5c0ae5b2..071d0bac00 100644 --- a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp @@ -40,7 +40,7 @@ #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } #define _ALIGN(x) __attribute__ ((aligned(x))) static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE]; diff --git a/Marlin/src/HAL/STM32/eeprom_sram.cpp b/Marlin/src/HAL/STM32/eeprom_sram.cpp index 9bd84ff4fe..58a67f1759 100644 --- a/Marlin/src/HAL/STM32/eeprom_sram.cpp +++ b/Marlin/src/HAL/STM32/eeprom_sram.cpp @@ -33,7 +33,7 @@ #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { return true; } bool PersistentStore::access_finish() { return true; } diff --git a/Marlin/src/HAL/STM32/eeprom_wired.cpp b/Marlin/src/HAL/STM32/eeprom_wired.cpp index 6fb9d9b51b..5440030bd4 100644 --- a/Marlin/src/HAL/STM32/eeprom_wired.cpp +++ b/Marlin/src/HAL/STM32/eeprom_wired.cpp @@ -38,7 +38,7 @@ #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE size_t(E2END + 1) #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } @@ -47,7 +47,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui uint16_t written = 0; while (size--) { uint8_t v = *value; - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes @@ -66,7 +66,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { // Read from either external EEPROM, program flash or Backup SRAM - const uint8_t c = eeprom_read_byte((uint8_t*)pos); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/STM32/inc/Conditionals_type.h b/Marlin/src/HAL/STM32/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/STM32/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/STM32/inc/SanityCheck.h b/Marlin/src/HAL/STM32/inc/SanityCheck.h index 80d0314dbb..e35b4e59cf 100644 --- a/Marlin/src/HAL/STM32/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32/inc/SanityCheck.h @@ -28,7 +28,6 @@ // #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector" //#endif - #if ENABLED(SDCARD_EEPROM_EMULATION) && !HAS_MEDIA #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise #if USE_FALLBACK_EEPROM @@ -59,8 +58,9 @@ * Check for common serial pin conflicts */ #define _CHECK_SERIAL_PIN(N) (( \ - BTN_EN1 == N || DOGLCD_CS == N || HEATER_BED_PIN == N || FAN0_PIN == N || \ - SDIO_D2_PIN == N || SDIO_D3_PIN == N || SDIO_CK_PIN == N || SDIO_CMD_PIN == N \ + BTN_EN1 == N || BTN_EN2 == N ||DOGLCD_CS == N || HEATER_BED_PIN == N || FAN0_PIN == N || \ + SDIO_D2_PIN == N || SDIO_D3_PIN == N || SDIO_CK_PIN == N || SDIO_CMD_PIN == N || \ + Y_STEP_PIN == N || Y_ENABLE_PIN == N || E0_ENABLE_PIN == N || POWER_LOSS_PIN == N \ )) #define CHECK_SERIAL_PIN(T,N) defined(UART##N##_##T##_PIN) && _CHECK_SERIAL_PIN(UART##N##_##T##_PIN) #if SERIAL_IN_USE(1) diff --git a/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp b/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp index 8e4f97d0a3..4dffe8b4fc 100644 --- a/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_fsmc.cpp @@ -37,50 +37,61 @@ LCD_CONTROLLER_TypeDef *TFT_FSMC::LCD; void TFT_FSMC::init() { uint32_t controllerAddress; - FSMC_NORSRAM_TimingTypeDef timing, extTiming; + FMC_OR_FSMC(NORSRAM_TimingTypeDef) timing, extTiming; uint32_t nsBank = (uint32_t)pinmap_peripheral(digitalPinToPinName(TFT_CS_PIN), pinMap_FSMC_CS); // Perform the SRAM1 memory initialization sequence - SRAMx.Instance = FSMC_NORSRAM_DEVICE; - SRAMx.Extended = FSMC_NORSRAM_EXTENDED_DEVICE; + SRAMx.Instance = FMC_OR_FSMC(NORSRAM_DEVICE); + SRAMx.Extended = FMC_OR_FSMC(NORSRAM_EXTENDED_DEVICE); + // SRAMx.Init SRAMx.Init.NSBank = nsBank; - SRAMx.Init.DataAddressMux = FSMC_DATA_ADDRESS_MUX_DISABLE; - SRAMx.Init.MemoryType = FSMC_MEMORY_TYPE_SRAM; - SRAMx.Init.MemoryDataWidth = TERN(TFT_INTERFACE_FSMC_8BIT, FSMC_NORSRAM_MEM_BUS_WIDTH_8, FSMC_NORSRAM_MEM_BUS_WIDTH_16); - SRAMx.Init.BurstAccessMode = FSMC_BURST_ACCESS_MODE_DISABLE; - SRAMx.Init.WaitSignalPolarity = FSMC_WAIT_SIGNAL_POLARITY_LOW; - SRAMx.Init.WrapMode = FSMC_WRAP_MODE_DISABLE; - SRAMx.Init.WaitSignalActive = FSMC_WAIT_TIMING_BEFORE_WS; - SRAMx.Init.WriteOperation = FSMC_WRITE_OPERATION_ENABLE; - SRAMx.Init.WaitSignal = FSMC_WAIT_SIGNAL_DISABLE; - SRAMx.Init.ExtendedMode = FSMC_EXTENDED_MODE_ENABLE; - SRAMx.Init.AsynchronousWait = FSMC_ASYNCHRONOUS_WAIT_DISABLE; - SRAMx.Init.WriteBurst = FSMC_WRITE_BURST_DISABLE; - #ifdef STM32F4xx - SRAMx.Init.PageSize = FSMC_PAGE_SIZE_NONE; + SRAMx.Init.DataAddressMux = FMC_OR_FSMC(DATA_ADDRESS_MUX_DISABLE); + SRAMx.Init.MemoryType = FMC_OR_FSMC(MEMORY_TYPE_SRAM); + #ifdef STM32F446xx + SRAMx.Init.MemoryDataWidth = TERN(TFT_INTERFACE_FMC_8BIT, FMC_NORSRAM_MEM_BUS_WIDTH_8, FMC_NORSRAM_MEM_BUS_WIDTH_16); + #else + SRAMx.Init.MemoryDataWidth = TERN(TFT_INTERFACE_FSMC_8BIT, FSMC_NORSRAM_MEM_BUS_WIDTH_8, FSMC_NORSRAM_MEM_BUS_WIDTH_16); #endif + SRAMx.Init.BurstAccessMode = FMC_OR_FSMC(BURST_ACCESS_MODE_DISABLE); + SRAMx.Init.WaitSignalPolarity = FMC_OR_FSMC(WAIT_SIGNAL_POLARITY_LOW); + SRAMx.Init.WrapMode = FMC_OR_FSMC(WRAP_MODE_DISABLE); + SRAMx.Init.WaitSignalActive = FMC_OR_FSMC(WAIT_TIMING_BEFORE_WS); + SRAMx.Init.WriteOperation = FMC_OR_FSMC(WRITE_OPERATION_ENABLE); + SRAMx.Init.WaitSignal = FMC_OR_FSMC(WAIT_SIGNAL_DISABLE); + SRAMx.Init.ExtendedMode = FMC_OR_FSMC(EXTENDED_MODE_ENABLE); + SRAMx.Init.AsynchronousWait = FMC_OR_FSMC(ASYNCHRONOUS_WAIT_DISABLE); + SRAMx.Init.WriteBurst = FMC_OR_FSMC(WRITE_BURST_DISABLE); + #if defined(STM32F446xx) || defined(STM32F4xx) + SRAMx.Init.PageSize = FMC_OR_FSMC(PAGE_SIZE_NONE); + #endif + // Read Timing - relatively slow to ensure ID information is correctly read from TFT controller - // Can be decreases from 15-15-24 to 4-4-8 with risk of stability loss - timing.AddressSetupTime = 15; - timing.AddressHoldTime = 15; - timing.DataSetupTime = 24; - timing.BusTurnAroundDuration = 0; - timing.CLKDivision = 16; - timing.DataLatency = 17; - timing.AccessMode = FSMC_ACCESS_MODE_A; + // Can be decreased from 15-15-24 to 4-4-8 with risk of stability loss + timing.AddressSetupTime = 15; + timing.AddressHoldTime = 15; + timing.DataSetupTime = 24; + timing.BusTurnAroundDuration = 0; + timing.CLKDivision = 16; + timing.DataLatency = 17; + timing.AccessMode = FMC_OR_FSMC(ACCESS_MODE_A); + // Write Timing // Can be decreased from 8-15-8 to 0-0-1 with risk of stability loss - extTiming.AddressSetupTime = 8; - extTiming.AddressHoldTime = 15; - extTiming.DataSetupTime = 8; - extTiming.BusTurnAroundDuration = 0; - extTiming.CLKDivision = 16; - extTiming.DataLatency = 17; - extTiming.AccessMode = FSMC_ACCESS_MODE_A; + extTiming.AddressSetupTime = 8; + extTiming.AddressHoldTime = 15; + extTiming.DataSetupTime = 8; + extTiming.BusTurnAroundDuration = 0; + extTiming.CLKDivision = 16; + extTiming.DataLatency = 17; + extTiming.AccessMode = FMC_OR_FSMC(ACCESS_MODE_A); - __HAL_RCC_FSMC_CLK_ENABLE(); + #ifdef STM32F446xx + __HAL_RCC_FMC_CLK_ENABLE(); + #else + __HAL_RCC_FSMC_CLK_ENABLE(); + #endif for (uint16_t i = 0; pinMap_FSMC[i].pin != NC; i++) pinmap_pinout(pinMap_FSMC[i].pin, pinMap_FSMC); @@ -90,9 +101,9 @@ void TFT_FSMC::init() { controllerAddress = FSMC_BANK1_1; #ifdef PF0 switch (nsBank) { - case FSMC_NORSRAM_BANK2: controllerAddress = FSMC_BANK1_2 ; break; - case FSMC_NORSRAM_BANK3: controllerAddress = FSMC_BANK1_3 ; break; - case FSMC_NORSRAM_BANK4: controllerAddress = FSMC_BANK1_4 ; break; + case FMC_OR_FSMC(NORSRAM_BANK2): controllerAddress = FSMC_BANK1_2; break; + case FMC_OR_FSMC(NORSRAM_BANK3): controllerAddress = FSMC_BANK1_3; break; + case FMC_OR_FSMC(NORSRAM_BANK4): controllerAddress = FSMC_BANK1_4; break; } #endif @@ -100,49 +111,44 @@ void TFT_FSMC::init() { HAL_SRAM_Init(&SRAMx, &timing, &extTiming); + __HAL_RCC_DMA2_CLK_ENABLE(); + #ifdef STM32F1xx - __HAL_RCC_DMA1_CLK_ENABLE(); - DMAtx.Instance = DMA1_Channel1; + DMAtx.Instance = DMA2_Channel1; #elif defined(STM32F4xx) - __HAL_RCC_DMA2_CLK_ENABLE(); - DMAtx.Instance = DMA2_Stream0; - DMAtx.Init.Channel = DMA_CHANNEL_0; - DMAtx.Init.FIFOMode = DMA_FIFOMODE_ENABLE; - DMAtx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; - DMAtx.Init.MemBurst = DMA_MBURST_SINGLE; - DMAtx.Init.PeriphBurst = DMA_PBURST_SINGLE; + DMAtx.Instance = DMA2_Stream0; + DMAtx.Init.Channel = DMA_CHANNEL_0; + DMAtx.Init.FIFOMode = DMA_FIFOMODE_ENABLE; + DMAtx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; + DMAtx.Init.MemBurst = DMA_MBURST_SINGLE; + DMAtx.Init.PeriphBurst = DMA_PBURST_SINGLE; #endif - DMAtx.Init.Direction = DMA_MEMORY_TO_MEMORY; - DMAtx.Init.MemInc = DMA_MINC_DISABLE; - DMAtx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; - DMAtx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; - DMAtx.Init.Mode = DMA_NORMAL; - DMAtx.Init.Priority = DMA_PRIORITY_HIGH; + DMAtx.Init.Direction = DMA_MEMORY_TO_MEMORY; + DMAtx.Init.MemInc = DMA_MINC_DISABLE; + DMAtx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; + DMAtx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; + DMAtx.Init.Mode = DMA_NORMAL; + DMAtx.Init.Priority = DMA_PRIORITY_HIGH; LCD = (LCD_CONTROLLER_TypeDef *)controllerAddress; } uint32_t TFT_FSMC::getID() { - uint32_t id; writeReg(0); - id = LCD->RAM; - - if (id == 0) - id = readID(LCD_READ_ID); - if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF) - id = readID(LCD_READ_ID4); + uint32_t id = LCD->RAM; + if (id == 0) id = readID(LCD_READ_ID); + if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF) id = readID(LCD_READ_ID4); return id; } -uint32_t TFT_FSMC::readID(const tft_data_t inReg) { - uint32_t id; +uint32_t TFT_FSMC::readID(tft_data_t inReg) { writeReg(inReg); - id = LCD->RAM; // dummy read + uint32_t id = LCD->RAM; // dummy read id = inReg << 24; id |= (LCD->RAM & 0x00FF) << 16; id |= (LCD->RAM & 0x00FF) << 8; - id |= LCD->RAM & 0x00FF; + id |= (LCD->RAM & 0x00FF); return id; } @@ -155,7 +161,9 @@ bool TFT_FSMC::isBusy() { #define __IS_DMA_CONFIGURED(__HANDLE__) ((__HANDLE__)->Instance->PAR != 0) #endif - if (!__IS_DMA_CONFIGURED(&DMAtx)) return false; + #ifdef __IS_DMA_CONFIGURED + if (!__IS_DMA_CONFIGURED(&DMAtx)) return false; + #endif // Check if DMA transfer error or transfer complete flags are set if ((__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TE_FLAG_INDEX(&DMAtx)) == 0) && (__HAL_DMA_GET_FLAG(&DMAtx, __HAL_DMA_GET_TC_FLAG_INDEX(&DMAtx)) == 0)) return true; @@ -174,8 +182,6 @@ void TFT_FSMC::transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t cou DMAtx.Init.PeriphInc = memoryIncrease; HAL_DMA_Init(&DMAtx); HAL_DMA_Start(&DMAtx, (uint32_t)data, (uint32_t)&(LCD->RAM), count); - - TERN_(TFT_SHARED_IO, while (isBusy())); } void TFT_FSMC::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) { diff --git a/Marlin/src/HAL/STM32/tft/tft_fsmc.h b/Marlin/src/HAL/STM32/tft/tft_fsmc.h index 1776cbdb0f..2647923e8e 100644 --- a/Marlin/src/HAL/STM32/tft/tft_fsmc.h +++ b/Marlin/src/HAL/STM32/tft/tft_fsmc.h @@ -28,11 +28,7 @@ #elif defined(STM32F4xx) #include "stm32f4xx_hal.h" #else - #error "FSMC TFT is currently only supported on STM32F1 and STM32F4 hardware." -#endif - -#ifndef HAL_SRAM_MODULE_ENABLED - #error "SRAM module disabled for the STM32 framework (HAL_SRAM_MODULE_ENABLED)! Please consult the development team." + #error "FSMC/FMC TFT is currently only supported on STM32F1 and STM32F4 hardware." #endif #ifndef LCD_READ_ID @@ -55,6 +51,12 @@ typedef struct { __IO tft_data_t RAM; } LCD_CONTROLLER_TypeDef; +#ifdef STM32F446xx + #define FMC_OR_FSMC(N) _CAT(FMC_, N) +#else + #define FMC_OR_FSMC(N) _CAT(FSMC_, N) +#endif + class TFT_FSMC { private: static SRAM_HandleTypeDef SRAMx; @@ -62,7 +64,7 @@ class TFT_FSMC { static LCD_CONTROLLER_TypeDef *LCD; - static uint32_t readID(const tft_data_t reg); + static uint32_t readID(tft_data_t inReg); static void transmit(tft_data_t data) { LCD->RAM = data; __DSB(); } static void transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count); static void transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t count); @@ -94,7 +96,11 @@ class TFT_FSMC { #ifdef STM32F1xx #define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, AFIO_NONE) #elif defined(STM32F4xx) - #define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_FSMC) + #ifdef STM32F446xx + #define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_FMC) + #else + #define FSMC_PIN_DATA STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_FSMC) + #endif #define FSMC_BANK1_1 0x60000000U #define FSMC_BANK1_2 0x64000000U #define FSMC_BANK1_3 0x68000000U @@ -104,35 +110,35 @@ class TFT_FSMC { #endif const PinMap pinMap_FSMC[] = { - {PD_14, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D00 - {PD_15, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D01 - {PD_0, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D02 - {PD_1, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D03 - {PE_7, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D04 - {PE_8, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D05 - {PE_9, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D06 - {PE_10, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D07 + {PD_14, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D00 + {PD_15, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D01 + {PD_0, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D02 + {PD_1, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D03 + {PE_7, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D04 + {PE_8, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D05 + {PE_9, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D06 + {PE_10, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D07 #if DISABLED(TFT_INTERFACE_FSMC_8BIT) - {PE_11, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D08 - {PE_12, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D09 - {PE_13, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D10 - {PE_14, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D11 - {PE_15, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D12 - {PD_8, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D13 - {PD_9, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D14 - {PD_10, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_D15 + {PE_11, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D08 + {PE_12, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D09 + {PE_13, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D10 + {PE_14, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D11 + {PE_15, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D12 + {PD_8, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D13 + {PD_9, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D14 + {PD_10, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_D15 #endif - {PD_4, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_NOE - {PD_5, FSMC_NORSRAM_DEVICE, FSMC_PIN_DATA}, // FSMC_NWE + {PD_4, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_NOE + {PD_5, FMC_OR_FSMC(NORSRAM_DEVICE), FSMC_PIN_DATA}, // FSMC_NWE {NC, NP, 0} }; const PinMap pinMap_FSMC_CS[] = { - {PD_7, (void *)FSMC_NORSRAM_BANK1, FSMC_PIN_DATA}, // FSMC_NE1 + {PD_7, (void *)FMC_OR_FSMC(NORSRAM_BANK1), FSMC_PIN_DATA}, // FSMC_NE1 #ifdef PF0 - {PG_9, (void *)FSMC_NORSRAM_BANK2, FSMC_PIN_DATA}, // FSMC_NE2 - {PG_10, (void *)FSMC_NORSRAM_BANK3, FSMC_PIN_DATA}, // FSMC_NE3 - {PG_12, (void *)FSMC_NORSRAM_BANK4, FSMC_PIN_DATA}, // FSMC_NE4 + {PG_9, (void *)FMC_OR_FSMC(NORSRAM_BANK2), FSMC_PIN_DATA}, // FSMC_NE2 + {PG_10, (void *)FMC_OR_FSMC(NORSRAM_BANK3), FSMC_PIN_DATA}, // FSMC_NE3 + {PG_12, (void *)FMC_OR_FSMC(NORSRAM_BANK4), FSMC_PIN_DATA}, // FSMC_NE4 #endif {NC, NP, 0} }; diff --git a/Marlin/src/HAL/STM32F1/HAL_N32.h b/Marlin/src/HAL/STM32F1/HAL_N32.h index 46ec7ba6db..7162e2b971 100644 --- a/Marlin/src/HAL/STM32F1/HAL_N32.h +++ b/Marlin/src/HAL/STM32F1/HAL_N32.h @@ -850,7 +850,6 @@ typedef struct { __IO uint32_t BDCR; /* compatible */ __IO uint32_t CSR; /* compatible */ - __IO uint32_t AHBRSTR; /* Not compatible, ADC reset here settings */ __IO uint32_t CFGR2; /* Not compatible, ADC clock settings here */ __IO uint32_t CFGR3; /* Not compatible, add a new register */ diff --git a/Marlin/src/HAL/STM32F1/SPI.cpp b/Marlin/src/HAL/STM32F1/SPI.cpp index a180684757..ab111ddbf0 100644 --- a/Marlin/src/HAL/STM32F1/SPI.cpp +++ b/Marlin/src/HAL/STM32F1/SPI.cpp @@ -517,7 +517,6 @@ uint8_t SPIClass::dmaSendAsync(const void * transmitBuf, uint16_t length, bool m return b; } - /** * New functions added to manage callbacks. * Victor Perez 2017 diff --git a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp index 4e25bc69da..1252e77b0b 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp @@ -41,7 +41,7 @@ #error "MARLIN_EEPROM_SIZE is required for IIC_BL24CXX_EEPROM." #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { eeprom_init(); return true; } bool PersistentStore::access_finish() { return true; } @@ -50,7 +50,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui uint16_t written = 0; while (size--) { uint8_t v = *value; - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes @@ -68,8 +68,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { - uint8_t * const p = (uint8_t * const)pos; - uint8_t c = eeprom_read_byte(p); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/STM32F1/eeprom_flash.cpp b/Marlin/src/HAL/STM32F1/eeprom_flash.cpp index 48fb2d286c..afdfefd5f0 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_flash.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_flash.cpp @@ -41,7 +41,7 @@ #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE ((EEPROM_PAGE_SIZE) * 2) #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } static uint8_t ram_eeprom[MARLIN_EEPROM_SIZE] __attribute__((aligned(4))) = {0}; static bool eeprom_dirty = false; diff --git a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp index 9cfa97c1ab..6b72193422 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp @@ -39,7 +39,7 @@ #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE 0x1000 // 4KB #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } #define _ALIGN(x) __attribute__ ((aligned(x))) // SDIO uint32_t* compat. static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE]; diff --git a/Marlin/src/HAL/STM32F1/eeprom_wired.cpp b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp index bc48eef34f..bfb7718094 100644 --- a/Marlin/src/HAL/STM32F1/eeprom_wired.cpp +++ b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp @@ -36,7 +36,7 @@ #ifndef MARLIN_EEPROM_SIZE #error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM." #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_finish() { return true; } @@ -57,7 +57,7 @@ bool PersistentStore::access_start() { bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { uint16_t written = 0; while (size--) { - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); uint8_t v = *value; if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); @@ -76,7 +76,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing && value) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/STM32F1/inc/Conditionals_type.h b/Marlin/src/HAL/STM32F1/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/STM32F1/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/STM32F1/maple_win_usb_driver/maple_serial.inf b/Marlin/src/HAL/STM32F1/maple_win_usb_driver/maple_serial.inf index c39f4ce0ed..0df30d2c42 100644 --- a/Marlin/src/HAL/STM32F1/maple_win_usb_driver/maple_serial.inf +++ b/Marlin/src/HAL/STM32F1/maple_win_usb_driver/maple_serial.inf @@ -48,7 +48,6 @@ ServiceBinary=%12%\usbser.sys ; String Definitions ;------------------------------------------------------------------------------ - [Strings] STM = "LeafLabs" MFGNAME = "LeafLabs" diff --git a/Marlin/src/HAL/STM32F1/onboard_sd.h b/Marlin/src/HAL/STM32F1/onboard_sd.h index f8846e95bc..be1d1d0a6b 100644 --- a/Marlin/src/HAL/STM32F1/onboard_sd.h +++ b/Marlin/src/HAL/STM32F1/onboard_sd.h @@ -47,7 +47,6 @@ typedef enum { RES_PARERR /* 4: Invalid Parameter */ } DRESULT; - #if _DISKIO_ISDIO /* Command structure for iSDIO ioctl command */ typedef struct { diff --git a/Marlin/src/HAL/STM32F1/sdio.h b/Marlin/src/HAL/STM32F1/sdio.h index 2371601e99..08c884666d 100644 --- a/Marlin/src/HAL/STM32F1/sdio.h +++ b/Marlin/src/HAL/STM32F1/sdio.h @@ -60,7 +60,6 @@ #define ACMD41_SD_APP_OP_COND (uint16_t)(SDMMC_ACMD_SD_APP_OP_COND | SDIO_CMD_WAIT_SHORT_RESP) #define ACMD42_SD_APP_SET_CLR_CARD_DETECT (uint16_t)(SDMMC_ACMD_SD_APP_SET_CLR_CARD_DETECT | SDIO_CMD_WAIT_SHORT_RESP) - #define SDMMC_ALLZERO 0x00000000U #define SDMMC_OCR_ERRORBITS 0xFDFFE008U diff --git a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp index 415c692229..cda7e7d16c 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp +++ b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp @@ -120,7 +120,6 @@ void spiSendBlock(uint8_t token, const uint8_t *buf) { SPI.endTransaction(); } - // Begin SPI transaction, set clock, bit order, data mode void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) { spiConfig = SPISettings(spiClock, bitOrder, dataMode); diff --git a/Marlin/src/HAL/TEENSY31_32/eeprom.cpp b/Marlin/src/HAL/TEENSY31_32/eeprom.cpp index d1ff940822..a7e5e590a3 100644 --- a/Marlin/src/HAL/TEENSY31_32/eeprom.cpp +++ b/Marlin/src/HAL/TEENSY31_32/eeprom.cpp @@ -36,7 +36,7 @@ #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE size_t(E2END + 1) #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { return true; } bool PersistentStore::access_finish() { return true; } @@ -44,7 +44,7 @@ bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { uint16_t written = 0; while (size--) { - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); uint8_t v = *value; if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); @@ -63,7 +63,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_type.h b/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/TEENSY35_36/eeprom.cpp b/Marlin/src/HAL/TEENSY35_36/eeprom.cpp index a2afa45343..977cd70ee8 100644 --- a/Marlin/src/HAL/TEENSY35_36/eeprom.cpp +++ b/Marlin/src/HAL/TEENSY35_36/eeprom.cpp @@ -35,7 +35,7 @@ #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE size_t(E2END + 1) #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { return true; } bool PersistentStore::access_finish() { return true; } @@ -43,7 +43,7 @@ bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { uint16_t written = 0; while (size--) { - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); uint8_t v = *value; if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); @@ -62,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_type.h b/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/TEENSY40_41/eeprom.cpp b/Marlin/src/HAL/TEENSY40_41/eeprom.cpp index 87f7dd3cfc..357fed47b0 100644 --- a/Marlin/src/HAL/TEENSY40_41/eeprom.cpp +++ b/Marlin/src/HAL/TEENSY40_41/eeprom.cpp @@ -35,7 +35,7 @@ #ifndef MARLIN_EEPROM_SIZE #define MARLIN_EEPROM_SIZE size_t(E2END + 1) #endif -size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; } +size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; } bool PersistentStore::access_start() { return true; } bool PersistentStore::access_finish() { return true; } @@ -43,7 +43,7 @@ bool PersistentStore::access_finish() { return true; } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { uint16_t written = 0; while (size--) { - uint8_t * const p = (uint8_t * const)pos; + uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos); uint8_t v = *value; if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed! eeprom_write_byte(p, v); @@ -62,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) { do { - uint8_t c = eeprom_read_byte((uint8_t*)pos); + const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos)); if (writing) *value = c; crc16(crc, &c, 1); pos++; diff --git a/Marlin/src/HAL/TEENSY40_41/inc/Conditionals_type.h b/Marlin/src/HAL/TEENSY40_41/inc/Conditionals_type.h new file mode 100644 index 0000000000..82f95a1035 --- /dev/null +++ b/Marlin/src/HAL/TEENSY40_41/inc/Conditionals_type.h @@ -0,0 +1,22 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once diff --git a/Marlin/src/HAL/shared/Delay.cpp b/Marlin/src/HAL/shared/Delay.cpp index fd52eb2c6a..bfcf6bcc42 100644 --- a/Marlin/src/HAL/shared/Delay.cpp +++ b/Marlin/src/HAL/shared/Delay.cpp @@ -161,7 +161,6 @@ } #endif // MARLIN_DEV_MODE - #else void calibrate_delay_loop() {} diff --git a/Marlin/src/HAL/shared/backtrace/unwarm.cpp b/Marlin/src/HAL/shared/backtrace/unwarm.cpp index e72a02e487..823f54c157 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm.cpp @@ -50,7 +50,6 @@ void UnwInvalidateRegisterFile(RegData *regFile) { } while (t < 13); } - /** * Initialize the data used for unwinding. */ @@ -129,7 +128,6 @@ bool UnwReportRetAddr(UnwState * const state, uint32_t addr) { return state->cb->report((void *)state->reportData, &entry); } - /** * Write some register to memory. * This will store some register and meta data onto the virtual stack. diff --git a/Marlin/src/HAL/shared/backtrace/unwarm.h b/Marlin/src/HAL/shared/backtrace/unwarm.h index edae90650e..72ea0b0627 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm.h +++ b/Marlin/src/HAL/shared/backtrace/unwarm.h @@ -41,7 +41,6 @@ typedef enum { REG_VAL_ARITHMETIC = 0x80 } RegValOrigin; - /** Type for tracking information about a register. * This stores the register value, as well as other data that helps unwinding. */ @@ -56,7 +55,6 @@ typedef struct { int o; /* (RegValOrigin) */ } RegData; - /** Structure used to track reads and writes to memory. * This structure is used as a hash to store a small number of writes * to memory. @@ -81,7 +79,6 @@ typedef struct { uint8_t tracked[(MEM_HASH_SIZE + 7) / 8]; } MemData; - /** Structure that is used to keep track of unwinding meta-data. * This data is passed between all the unwinding functions. */ diff --git a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp index d478255678..f4435c733e 100644 --- a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp +++ b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp @@ -26,7 +26,6 @@ #if defined(__arm__) || defined(__thumb__) - /* On ARM CPUs exception handling is quite powerful. diff --git a/Marlin/src/HAL/shared/eeprom_api.h b/Marlin/src/HAL/shared/eeprom_api.h index 7be1e72f7a..33d80695db 100644 --- a/Marlin/src/HAL/shared/eeprom_api.h +++ b/Marlin/src/HAL/shared/eeprom_api.h @@ -26,6 +26,19 @@ #include "../../libs/crc16.h" +// For testing. Define with -DEEPROM_EXCL_ZONE=916,926 in INI files. +//#define EEPROM_EXCL_ZONE 916,926 // Test a range +//#define EEPROM_EXCL_ZONE 333 // Test a single byte + +#ifdef EEPROM_EXCL_ZONE + static constexpr int eeprom_exclude_zone[] = { EEPROM_EXCL_ZONE }, + eeprom_exclude_size = eeprom_exclude_zone[COUNT(eeprom_exclude_zone) - 1] - eeprom_exclude_zone[0] + 1; + #define REAL_EEPROM_ADDR(A) (A < eeprom_exclude_zone[0] ? (A) : (A) + eeprom_exclude_size) +#else + #define REAL_EEPROM_ADDR(A) (A) + static constexpr int eeprom_exclude_size = 0; +#endif + class PersistentStore { public: diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 9d7bada97f..2dba3944e5 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -77,8 +77,6 @@ #include "lcd/e3v2/common/encoder.h" #if ENABLED(DWIN_CREALITY_LCD) #include "lcd/e3v2/creality/dwin.h" - #elif ENABLED(DWIN_LCD_PROUI) - #include "lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "lcd/e3v2/jyersui/dwin.h" #endif @@ -268,7 +266,7 @@ PGMSTR(M112_KILL_STR, "M112 Shutdown"); MarlinState marlin_state = MF_INITIALIZING; // For M109 and M190, this flag may be cleared (by M108) to exit the wait loop -bool wait_for_heatup = true; +bool wait_for_heatup = false; // For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop #if HAS_RESUME_CONTINUE @@ -476,11 +474,16 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) { #if HAS_KILL - // Check if the kill button was pressed and wait just in case it was an accidental - // key kill key press + // Check if the kill button was pressed and wait to ensure the signal is not noise + // typically caused by poor insulation and grounding on LCD cables. + // Lower numbers here will increase response time and therefore safety rating. + // It is recommended to set this as low as possibe without false triggers. // ------------------------------------------------------------------------------- + #ifndef KILL_DELAY + #define KILL_DELAY 250 + #endif + static int killCount = 0; // make the inactivity button a bit less responsive - const int KILL_DELAY = 750; if (kill_state()) killCount++; else if (killCount > 0) @@ -671,23 +674,10 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) { TERN_(HOTEND_IDLE_TIMEOUT, hotend_idle.check()); - #if ANY(PSU_CONTROL, AUTO_POWER_CONTROL) - #if defined(PS_ON_EDM_PIN) - if(ELAPSED(ms, powerManager.last_state_change_ms + PS_EDM_RESPONSE)) - { - if(READ(PS_ON_PIN)!=READ(PS_ON_EDM_PIN)) - kill(GET_TEXT_F(PS_ON_EDM_FAIL)); - } - #endif - - #if defined(PS_ON_EDM_PIN) && ENABLED(PSU_OFF_REDUNDANT) - if(ELAPSED(ms, powerManager.last_state_change_ms + PS_EDM_RESPONSE)) - { - if(extDigitalRead(PS_ON1_PIN)!=extDigitalRead(PS_ON1_EDM_PIN)) - kill(GET_TEXT_F(PS_ON1_EDM_FAIL)); - } - - #endif + #if ANY(PSU_CONTROL, AUTO_POWER_CONTROL) && PIN_EXISTS(PS_ON_EDM) + if ( ELAPSED(ms, powerManager.last_state_change_ms + PS_EDM_RESPONSE) + && (READ(PS_ON_PIN) != READ(PS_ON_EDM_PIN) || TERN0(PSU_OFF_REDUNDANT, extDigitalRead(PS_ON1_PIN) != extDigitalRead(PS_ON1_EDM_PIN))) + ) kill(GET_TEXT_F(MSG_POWER_EDM_FAULT)); #endif #if ENABLED(EXTRUDER_RUNOUT_PREVENT) @@ -1082,7 +1072,7 @@ inline void tmc_standby_setup() { * - Init the buzzer, possibly a custom timer * - Init more optional hardware: * • Color LED illumination - * • Neopixel illumination + * • NeoPixel illumination * • Controller Fan * • Creality DWIN LCD (show boot image) * • Tare the Probe if possible @@ -1607,11 +1597,11 @@ void setup() { SERIAL_ECHO_TERNARY(err, "BL24CXX Check ", "failed", "succeeded", "!\n"); #endif - #if HAS_DWIN_E3V2_BASIC + #if ENABLED(DWIN_CREALITY_LCD) SETUP_RUN(dwinInitScreen()); #endif - #if HAS_SERVICE_INTERVALS && !HAS_DWIN_E3V2_BASIC + #if HAS_SERVICE_INTERVALS && DISABLED(DWIN_CREALITY_LCD) SETUP_RUN(ui.reset_status(true)); // Show service messages or keep current status #endif diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index c2c896bd9f..1c90e3c734 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -131,6 +131,7 @@ #define BOARD_PXMALION_CORE_I3 1164 // Pxmalion Core I3 #define BOARD_PANOWIN_CUTLASS 1165 // Panowin Cutlass (as found in the Panowin F1) #define BOARD_KODAMA_BARDO 1166 // Kodama Bardo V1.x (as found in the Kodama Trinus) +#define BOARD_DAGOMA_D6 1167 // Dagoma D6 (as found in the Dagoma DiscoUltimate V2 TMC) // // RAMBo and derivatives @@ -382,9 +383,9 @@ #define BOARD_CREALITY_V452 5050 // Creality v4.5.2 (STM32F103RC / STM32F103RE) #define BOARD_CREALITY_V453 5051 // Creality v4.5.3 (STM32F103RC / STM32F103RE) #define BOARD_CREALITY_V521 5052 // Creality v5.2.1 (STM32F103VE) as found in the SV04 -#define BOARD_CREALITY_V24S1 5053 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7 -#define BOARD_CREALITY_V24S1_301 5054 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1 -#define BOARD_CREALITY_V25S1 5055 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro +#define BOARD_CREALITY_V24S1 5053 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) CR-FDM-v2.4.S1_v101 as found in the Ender-7 +#define BOARD_CREALITY_V24S1_301 5054 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) CR-FDM-v24S1_301 as found in the Ender-3 S1 +#define BOARD_CREALITY_V25S1 5055 // Creality v2.5.S1 (STM32F103RE) CR-FDM-v2.5.S1_100 as found in the CR-10 Smart Pro #define BOARD_TRIGORILLA_PRO 5056 // Trigorilla Pro (STM32F103ZE) #define BOARD_FLY_MINI 5057 // FLYmaker FLY MINI (STM32F103RC) #define BOARD_FLSUN_HISPEED 5058 // FLSUN HiSpeedV1 (STM32F103VE) @@ -460,7 +461,7 @@ #define BOARD_OPULO_LUMEN_REV4 5242 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG) #define BOARD_FYSETC_SPIDER_KING407 5243 // FYSETC Spider King407 (STM32F407ZG) #define BOARD_MKS_SKIPR_V1 5244 // MKS SKIPR v1.0 all-in-one board (STM32F407VE) -#define BOARD_TRONXY_V10 5245 // TRONXY V10 (STM32F446ZE) +#define BOARD_TRONXY_CXY_446_V10 5245 // TRONXY CXY-446-V10-220413/CXY-V6-191121 (STM32F446ZE) #define BOARD_CREALITY_F401RE 5246 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1 #define BOARD_BLACKPILL_CUSTOM 5247 // Custom board based on STM32F401CDU6. #define BOARD_I3DBEEZ9_V1 5248 // I3DBEEZ9 V1 (STM32F407ZG) @@ -468,6 +469,11 @@ #define BOARD_FYSETC_CHEETAH_V30 5250 // FYSETC Cheetah V3.0 (STM32F446RC) #define BOARD_BLACKBEEZMINI_V1 5251 // BlackBeezMini V1 (STM32F401CCU6) +// +// Other ARM Cortex-M4 +// +#define BOARD_CREALITY_CR4NS 5300 // Creality CR4NS200320C13 (GD32F303RET6) as found in the Ender-3 V3 SE + // // ARM Cortex-M7 // @@ -520,7 +526,9 @@ // // HC32 ARM Cortex-M4 // + #define BOARD_AQUILA_V101 7200 // Voxelab Aquila V1.0.0/V1.0.1/V1.0.2/V1.0.3 as found in the Voxelab Aquila X2 and C2 +#define BOARD_CREALITY_ENDER2P_V24S4 7201 // Creality Ender 2 Pro v2.4.S4_170 (HC32f460kcta) // // Custom board diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index fce8a5a9b2..e28fc1bba7 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -41,8 +41,6 @@ #define _TMC2208_STANDALONE 0x2208B #define _TMC2209 0x2209A #define _TMC2209_STANDALONE 0x2209B -#define _TMC26X 0x2600A -#define _TMC26X_STANDALONE 0x2600B #define _TMC2660 0x2660A #define _TMC2660_STANDALONE 0x2660B #define _TMC5130 0x5130A @@ -107,8 +105,8 @@ #if ( HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2160_STANDALONE) \ || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC2209_STANDALONE) \ - || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) \ - || HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE) ) + || HAS_DRIVER(TMC2660_STANDALONE) || HAS_DRIVER(TMC5130_STANDALONE) \ + || HAS_DRIVER(TMC5160_STANDALONE) ) #define HAS_TRINAMIC_STANDALONE 1 #endif @@ -125,13 +123,13 @@ || AXIS_DRIVER_TYPE(A,TMC2660) \ || AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) ) -#define AXIS_IS_TMC_CONFIG(A) ( AXIS_IS_TMC(A) || AXIS_DRIVER_TYPE(A,TMC26X) ) +#define AXIS_IS_TMC_CONFIG AXIS_IS_TMC // Test for a driver that uses SPI - this allows checking whether a _CS_ pin // is considered sensitive #define AXIS_HAS_SPI(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \ - || AXIS_DRIVER_TYPE(A,TMC26X) || AXIS_DRIVER_TYPE(A,TMC2660) \ - || AXIS_DRIVER_TYPE(A,TMC5130) || AXIS_DRIVER_TYPE(A,TMC5160) ) + || AXIS_DRIVER_TYPE(A,TMC2660) || AXIS_DRIVER_TYPE(A,TMC5130) \ + || AXIS_DRIVER_TYPE(A,TMC5160) ) #define AXIS_HAS_UART(A) ( AXIS_DRIVER_TYPE(A,TMC2208) || AXIS_DRIVER_TYPE(A,TMC2209) ) @@ -184,10 +182,8 @@ #if ANY_AXIS_HAS(SPI) #define HAS_TMC_SPI 1 #endif - -// -// TMC26XX Stepper Drivers -// -#if HAS_DRIVER(TMC26X) - #define HAS_TMC26X 1 +#if HAS_STALLGUARD || HAS_DRIVER(TMC2160_STANDALONE) || HAS_DRIVER(TMC2130_STANDALONE) \ + || HAS_DRIVER(TMC2209_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) \ + || HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE) + #define HAS_DIAG_PINS 1 #endif diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 645725237b..ad84966453 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -89,10 +89,6 @@ #define MACHINE_NAME DEFAULT_MACHINE_NAME #endif -#ifndef MACHINE_UUID - #define MACHINE_UUID DEFAULT_MACHINE_UUID -#endif - #define MARLIN_WEBSITE_URL "marlinfw.org" //#if !defined(STRING_SPLASH_LINE3) && defined(WEBSITE_URL) @@ -139,6 +135,7 @@ #define STR_BUSY_PAUSED_FOR_USER "busy: paused for user" #define STR_BUSY_PAUSED_FOR_INPUT "busy: paused for input" #define STR_Z_MOVE_COMP "Z_move_comp" +#define STR_LINE_NO "Line: " #define STR_RESEND "Resend: " #define STR_UNKNOWN_COMMAND "Unknown command: \"" #define STR_ACTIVE_EXTRUDER "Active Extruder: " diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 784002c769..4f1aba23c8 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -89,7 +89,8 @@ #define HYPOT2(x,y) (sq(x)+sq(y)) #define NORMSQ(x,y,z) (sq(x)+sq(y)+sq(z)) -#define CIRCLE_AREA(R) (float(M_PI) * sq(float(R))) +#define FLOAT_SQ(I) sq(float(I)) +#define CIRCLE_AREA(R) (float(M_PI) * FLOAT_SQ(R)) #define CIRCLE_CIRC(R) (2 * float(M_PI) * float(R)) #define SIGN(a) ({__typeof__(a) _a = (a); (_a>0)-(_a<0);}) diff --git a/Marlin/src/core/mstring.h b/Marlin/src/core/mstring.h index 31e8c8c6e6..b405262d30 100644 --- a/Marlin/src/core/mstring.h +++ b/Marlin/src/core/mstring.h @@ -143,13 +143,13 @@ public: // Set with format string and arguments, like printf template - MString& setf_P(PGM_P const fmt, Args... more) { SNPRINTF_P(str, SIZE, fmt, more...); debug(F("setf_P")); return *this; } + MString& setf_P(PGM_P const pfmt, Args... more) { SNPRINTF_P(str, SIZE, pfmt, more...); debug(F("setf_P")); return *this; } template - MString& setf(const char *fmt, Args... more) { SNPRINTF(str, SIZE, fmt, more...); debug(F("setf")); return *this; } + MString& setf(const char *fmt, Args... more) { SNPRINTF(str, SIZE, fmt, more...); debug(F("setf")); return *this; } template - MString& setf(FSTR_P const fmt, Args... more) { return setf_P(FTOP(fmt), more...); } + MString& setf(FSTR_P const ffmt, Args... more) { return setf_P(FTOP(ffmt), more...); } // Chainable String appenders MString& append() { debug(F("nil")); return *this; } // for macros that might emit no output @@ -206,9 +206,9 @@ public: MString& append(const spaces_t &s) { return append(repchr_t(' ', s.count)); } template - MString& appendf_P(PGM_P const fmt, Args... more) { + MString& appendf_P(PGM_P const pfmt, Args... more) { int sz = length(); - if (sz < SIZE) SNPRINTF_P(str + sz, SIZE - sz, fmt, more...); + if (sz < SIZE) SNPRINTF_P(str + sz, SIZE - sz, pfmt, more...); debug(F("appendf_P")); return *this; } diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index f9b73e6d26..db8d06a297 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -271,13 +271,13 @@ public: SString& set() { super::set(); return *this; } template - SString& setf_P(PGM_P const fmt, Args... more) { super::setf_P(fmt, more...); return *this; } + SString& setf_P(PGM_P const pfmt, Args... more) { super::setf_P(pfmt, more...); return *this; } template - SString& setf(const char *fmt, Args... more) { super::setf(fmt, more...); return *this; } + SString& setf(const char *fmt, Args... more) { super::setf(fmt, more...); return *this; } template - SString& setf(FSTR_P const fmt, Args... more) { super::setf(fmt, more...); return *this; } + SString& setf(FSTR_P const ffmt, Args... more) { super::setf(ffmt, more...); return *this; } template SString& set(const T &v) { super::set(v); return *this; } diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 3d12503461..f5dc231289 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -46,6 +46,7 @@ template struct IF { typedef L type; }; #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_DECL(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_NAMES_LC NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w) #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) @@ -58,17 +59,21 @@ template struct IF { typedef L type; }; #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_AXIS_NAMES LOGICAL_AXIS_LIST(E, X, Y, Z, I, J, K, U, V, W) +#define LOGICAL_AXIS_NAMES_LC LOGICAL_AXIS_LIST(e, x, y, z, i, j, k, u, v, w) #define LOGICAL_AXIS_MAP(F) MAP(F, LOGICAL_AXIS_NAMES) +#define LOGICAL_AXIS_MAP_LC(F) MAP(F, LOGICAL_AXIS_NAMES_LC) #define STR_AXES_LOGICAL LOGICAL_AXIS_GANG("E", "X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W) #if NUM_AXES #define NUM_AXES_SEP , #define MAIN_AXIS_MAP(F) MAP(F, MAIN_AXIS_NAMES) + #define MAIN_AXIS_MAP_LC(F) MAP(F, MAIN_AXIS_NAMES_LC) #define OPTARGS_NUM(T) , NUM_AXIS_ARGS(T) #define OPTARGS_LOGICAL(T) , LOGICAL_AXIS_ARGS(T) #else #define NUM_AXES_SEP #define MAIN_AXIS_MAP(F) + #define MAIN_AXIS_MAP_LC(F) #define OPTARGS_NUM(T) #define OPTARGS_LOGICAL(T) #endif @@ -79,6 +84,7 @@ template struct IF { typedef L type; }; #define NUM_AXIS_ARGS_(T) NUM_AXIS_ARGS(T) NUM_AXES_SEP #define NUM_AXIS_ELEM_(T) NUM_AXIS_ELEM(T) NUM_AXES_SEP #define MAIN_AXIS_NAMES_ MAIN_AXIS_NAMES NUM_AXES_SEP +#define MAIN_AXIS_NAMES_LC_ MAIN_AXIS_NAMES_LC NUM_AXES_SEP #if LOGICAL_AXES #define LOGICAL_AXES_SEP , @@ -92,6 +98,7 @@ template struct IF { typedef L type; }; #define LOGICAL_AXIS_ARGS_(T) LOGICAL_AXIS_ARGS(T) LOGICAL_AXES_SEP #define LOGICAL_AXIS_ELEM_(T) LOGICAL_AXIS_ELEM(T) LOGICAL_AXES_SEP #define LOGICAL_AXIS_NAMES_ LOGICAL_AXIS_NAMES LOGICAL_AXES_SEP +#define LOGICAL_AXIS_NAMES_LC_ LOGICAL_AXIS_NAMES_LC LOGICAL_AXES_SEP #define SECONDARY_AXIS_GANG(V...) GANG_N(SECONDARY_AXES, V) #define SECONDARY_AXIS_CODE(V...) CODE_N(SECONDARY_AXES, V) @@ -159,7 +166,7 @@ template struct IF { typedef L type; }; // General Flags for some number of states template struct Flags { - typedef uvalue_t(N) flagbits_t; + typedef bits_t(N) flagbits_t; typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1; } N8; typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1; } N16; typedef struct { bool b0:1, b1:1, b2:1, b3:1, b4:1, b5:1, b6:1, b7:1, b8:1, b9:1, b10:1, b11:1, b12:1, b13:1, b14:1, b15:1, @@ -219,7 +226,7 @@ typedef struct { // // - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space // - A_AXIS, B_AXIS, and C_AXIS should be used for Steppers, corresponding to XYZ on Cartesians -// - X_HEAD, Y_HEAD, and Z_HEAD should be used for Steppers on Core kinematics +// - X_HEAD, Y_HEAD, and Z_HEAD should be used for axes on Core kinematics // enum AxisEnum : uint8_t { @@ -449,7 +456,7 @@ struct XYval { // Length reduced to one dimension FI constexpr T magnitude() const { return (T)sqrtf(x*x + y*y); } // Pointer to the data as a simple array - FI operator T* () { return pos; } + explicit FI operator T* () { return pos; } // If any element is true then it's true FI constexpr operator bool() const { return x || y; } // Smallest element @@ -599,13 +606,13 @@ struct XYZval { // Length reduced to one dimension FI constexpr T magnitude() const { return (T)TERN(HAS_X_AXIS, sqrtf(NUM_AXIS_GANG(x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)), 0); } // Pointer to the data as a simple array - FI operator T* () { return pos; } + explicit FI operator T* () { return pos; } // If any element is true then it's true FI constexpr operator bool() const { return 0 NUM_AXIS_GANG(|| x, || y, || z, || i, || j, || k, || u, || v, || w); } // Smallest element - FI constexpr T small() const { return TERN(HAS_X_AXIS, _MIN(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)), 0); } + FI constexpr T small() const { return TERN0(HAS_X_AXIS, _MIN(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w))); } // Largest element - FI constexpr T large() const { return TERN(HAS_X_AXIS, _MAX(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)), 0); } + FI constexpr T large() const { return TERN0(HAS_X_AXIS, _MAX(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w))); } // Explicit copy and copies with conversion FI constexpr XYZval copy() const { XYZval o = *this; return o; } @@ -747,7 +754,7 @@ struct XYZEval { // Length reduced to one dimension FI constexpr T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); } // Pointer to the data as a simple array - FI operator T* () { return pos; } + explicit FI operator T* () { return pos; } // If any element is true then it's true FI constexpr operator bool() const { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); } // Smallest element @@ -937,7 +944,7 @@ public: typedef bits_t(NUM_AXIS_ENUMS) el; union { el bits; - // x, y, z ... e0, e1, e2 ... hx, hy, hz + // Axes x, y, z ... e0, e1, e2 ... hx, hy, hz struct { #if NUM_AXES bool NUM_AXIS_LIST(x:1, y:1, z:1, i:1, j:1, k:1, u:1, v:1, w:1); @@ -949,7 +956,7 @@ public: bool hx:1, hy:1, hz:1; #endif }; - // X, Y, Z ... E0, E1, E2 ... HX, HY, HZ + // Axes X, Y, Z ... E0, E1, E2 ... HX, HY, HZ struct { #if NUM_AXES bool NUM_AXIS_LIST(X:1, Y:1, Z:1, I:1, J:1, K:1, U:1, V:1, W:1); @@ -963,7 +970,7 @@ public: }; // a, b, c, e ... ha, hb, hc struct { - bool LOGICAL_AXIS_LIST(e:1, a:1, b:1, c:1, _i:1, _j:1, _k:1, _u:1, _v:1, _w:1); + bool LOGICAL_AXIS_LIST(e:1, a:1, b:1, c:1, ii:1, jj:1, kk:1, uu:1, vv:1, ww:1); #if EXTRUDERS > 1 #define _EN_ITEM(N) bool _e##N:1; REPEAT_S(1,EXTRUDERS,_EN_ITEM) @@ -975,7 +982,7 @@ public: }; // A, B, C, E ... HA, HB, HC struct { - bool LOGICAL_AXIS_LIST(E:1, A:1, B:1, C:1, _I:1, _J:1, _K:1, _U:1, _V:1, _W:1); + bool LOGICAL_AXIS_LIST(E:1, A:1, B:1, C:1, II:1, JJ:1, KK:1, UU:1, VV:1, WW:1); #if EXTRUDERS > 1 #define _EN_ITEM(N) bool _E##N:1; REPEAT_S(1,EXTRUDERS,_EN_ITEM) @@ -1084,6 +1091,7 @@ public: FI bool toggle(const AxisEnum n) { TBI(bits, n); return TEST(bits, n); } FI void bset(const AxisEnum n) { SBI(bits, n); } FI void bclr(const AxisEnum n) { CBI(bits, n); } + FI void bset(const AxisEnum n, const bool b) { if (b) bset(n); else bclr(n); } // Accessor via an AxisEnum (or any integer) [index] FI bool operator[](const int n) const { return TEST(bits, n); } diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index 8476591d4b..b555d9f2a6 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -80,6 +80,8 @@ void safe_delay(millis_t ms) { TERN_(Z_PROBE_ALLEN_KEY, "Z_PROBE_ALLEN_KEY") TERN_(SOLENOID_PROBE, "SOLENOID_PROBE") TERN_(MAGLEV4, "MAGLEV4") + TERN_(BIQU_MICROPROBE_V1, "BIQU_MICROPROBE_V1") + TERN_(BIQU_MICROPROBE_V2, "BIQU_MICROPROBE_V2") IF_DISABLED(PROBE_SELECTED, "NONE") ); diff --git a/Marlin/src/feature/bedlevel/bdl/bdl.cpp b/Marlin/src/feature/bedlevel/bdl/bdl.cpp index d469bb0c06..7e9d583cc1 100644 --- a/Marlin/src/feature/bedlevel/bdl/bdl.cpp +++ b/Marlin/src/feature/bedlevel/bdl/bdl.cpp @@ -46,10 +46,16 @@ BDS_Leveling bdl; #define DEBUG_OUT ENABLED(DEBUG_OUT_BD) #include "../../../core/debug_out.h" -// M102 S-5 Read raw Calibrate data -// M102 S-6 Start Calibrate -// M102 S4 Set the adjustable Z height value (e.g., 'M102 S4' means it will do adjusting while the Z height <= 0.4mm , disable with 'M102 S0'.) -// M102 S-1 Read sensor information +/** + * M102 S<#> : Set adjustable Z height in 0.1mm units (10ths of a mm) + * (e.g., 'M102 S4' enables adjusting for Z <= 0.4mm) + * M102 S0 : Disable adjustable Z height + * + * M102 S-1 : Read BDsensor version + * M102 S-2 : Read BDsensor distance value + * M102 S-5 : Read raw Calibration data + * M102 S-6 : Start Calibration + */ #define MAX_BD_HEIGHT 4.0f #define CMD_READ_VERSION 1016 diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp index f40cbccadd..14216ac424 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp @@ -63,7 +63,7 @@ */ void mesh_bed_leveling::line_to_destination(const_feedRate_t scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) { // Get current and destination cells for this line - xy_int8_t scel = cell_indexes(current_position), ecel = cell_indexes(destination); + xy_uint8_t scel = cell_indexes(current_position), ecel = cell_indexes(destination); NOMORE(scel.x, GRID_MAX_CELLS_X - 1); NOMORE(scel.y, GRID_MAX_CELLS_Y - 1); NOMORE(ecel.x, GRID_MAX_CELLS_X - 1); @@ -80,7 +80,7 @@ float normalized_dist; xyze_pos_t dest; - const int8_t gcx = _MAX(scel.x, ecel.x), gcy = _MAX(scel.y, ecel.y); + const uint8_t gcx = _MAX(scel.x, ecel.x), gcy = _MAX(scel.y, ecel.y); // Crosses on the X and not already split on this X? // The x_splits flags are insurance against rounding errors. diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 7377f7dfc0..b08cb812f8 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -95,7 +95,7 @@ public: static void report_current_mesh(); static void report_state(); static void save_ubl_active_state_and_disable(); - static void restore_ubl_active_state_and_leave(); + static void restore_ubl_active_state(const bool is_done=true); static void display_map(const uint8_t) __O0; static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) __O0; static mesh_index_pair find_furthest_invalid_mesh_point() __O0; diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 560ff71e84..4637bf87e8 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -309,7 +309,7 @@ void unified_bed_leveling::G29() { #if ALL(DWIN_LCD_PROUI, ZHOME_BEFORE_LEVELING) save_ubl_active_state_and_disable(); gcode.process_subcommands_now(F("G28Z")); - restore_ubl_active_state_and_leave(); + restore_ubl_active_state(false); // ...without telling ExtUI "done" #else // Send 'N' to force homing before G29 (internal only) if (axes_should_home() || parser.seen_test('N')) gcode.home_all_axes(); @@ -425,7 +425,7 @@ void unified_bed_leveling::G29() { if (parser.seen_test('J')) { save_ubl_active_state_and_disable(); tilt_mesh_based_on_probed_grid(param.J_grid_size == 0); // Zero size does 3-Point - restore_ubl_active_state_and_leave(); + restore_ubl_active_state(); #if ENABLED(UBL_G29_J_RECENTER) do_blocking_move_to_xy(0.5f * ((MESH_MIN_X) + (MESH_MAX_X)), 0.5f * ((MESH_MIN_Y) + (MESH_MAX_Y))); #endif @@ -615,7 +615,6 @@ void unified_bed_leveling::G29() { #endif // UBL_DEVEL_DEBUGGING - // // Load a Mesh from the EEPROM // @@ -755,7 +754,6 @@ void unified_bed_leveling::shift_mesh_height() { TERN_(HAS_MARLINUI_MENU, ui.capture()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); - TERN_(DWIN_LCD_PROUI, dwinLevelingStart()); save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained grid_count_t count = GRID_MAX_POINTS; @@ -767,9 +765,8 @@ void unified_bed_leveling::shift_mesh_height() { const grid_count_t point_num = (GRID_MAX_POINTS - count) + 1; SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, "."); - TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS))); + TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT_F(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS))); TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout()); - TERN_(DWIN_LCD_PROUI, dwinRedrawScreen()); #if HAS_MARLINUI_MENU if (ui.button_pressed()) { @@ -779,8 +776,7 @@ void unified_bed_leveling::shift_mesh_height() { ui.quick_feedback(); ui.release(); probe.stow(); // Release UI before stow to allow for PAUSE_BEFORE_DEPLOY_STOW - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); - return restore_ubl_active_state_and_leave(); + return restore_ubl_active_state(); } #endif @@ -816,15 +812,12 @@ void unified_bed_leveling::shift_mesh_height() { probe.move_z_after_probing(); - restore_ubl_active_state_and_leave(); - do_blocking_move_to_xy( constrain(nearby.x - probe.offset_xy.x, MESH_MIN_X, MESH_MAX_X), constrain(nearby.y - probe.offset_xy.y, MESH_MIN_Y, MESH_MAX_Y) ); - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); - TERN_(DWIN_LCD_PROUI, dwinLevelingDone()); + restore_ubl_active_state(); } #endif // HAS_BED_PROBE @@ -933,7 +926,7 @@ void set_message_with_feedback(FSTR_P const fstr) { if (param.V_verbosity > 1) SERIAL_ECHOLNPGM("Business Card is ", p_float_t(thickness, 4), "mm thick."); - restore_ubl_active_state_and_leave(); + restore_ubl_active_state(); return thickness; } @@ -988,7 +981,7 @@ void set_message_with_feedback(FSTR_P const fstr) { if (_click_and_hold([]{ SERIAL_ECHOLNPGM("\nMesh only partially populated."); do_z_clearance(Z_CLEARANCE_DEPLOY_PROBE); - })) return restore_ubl_active_state_and_leave(); + })) return restore_ubl_active_state(); // Store the Z position minus the shim height z_values[lpos.x][lpos.y] = current_position.z - thick; @@ -1003,10 +996,8 @@ void set_message_with_feedback(FSTR_P const fstr) { if (do_ubl_mesh_map) display_map(param.T_map_type); // show user where we're probing - restore_ubl_active_state_and_leave(); + restore_ubl_active_state(); do_blocking_move_to_xy_z(pos, Z_CLEARANCE_DEPLOY_PROBE); - - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); } /** @@ -1112,7 +1103,7 @@ void set_message_with_feedback(FSTR_P const fstr) { } while (lpos.x >= 0 && --param.R_repetition > 0); if (do_ubl_mesh_map) display_map(param.T_map_type); - restore_ubl_active_state_and_leave(); + restore_ubl_active_state(); do_blocking_move_to_xy_z(pos, Z_TWEEN_SAFE_CLEARANCE); @@ -1264,17 +1255,20 @@ void unified_bed_leveling::save_ubl_active_state_and_disable() { set_bed_leveling_enabled(false); } -void unified_bed_leveling::restore_ubl_active_state_and_leave() { +void unified_bed_leveling::restore_ubl_active_state(const bool is_done/*=true*/) { TERN_(HAS_MARLINUI_MENU, ui.release()); #if ENABLED(UBL_DEVEL_DEBUGGING) if (--ubl_state_recursion_chk) { - SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); + SERIAL_ECHOLNPGM("restore_ubl_active_state() called too many times."); set_message_with_feedback(GET_TEXT_F(MSG_UBL_RESTORE_ERROR)); return; } #endif set_bed_leveling_enabled(ubl_state_at_invocation); - TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); + + if (is_done) { + TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); + } } mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { @@ -1500,7 +1494,7 @@ void unified_bed_leveling::smart_fill_mesh() { for (uint8_t i = 0; i < 3; ++i) { SERIAL_ECHOLNPGM("Tilting mesh (", i + 1, "/3)"); - TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT(MSG_LCD_TILTING_MESH), i + 1)); + TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT_F(MSG_LCD_TILTING_MESH), i + 1)); measured_z = probe.probe_at_point(points[i], i < 2 ? PROBE_PT_RAISE : PROBE_PT_LAST_STOW, param.V_verbosity); if ((abort_flag = isnan(measured_z))) break; @@ -1556,7 +1550,7 @@ void unified_bed_leveling::smart_fill_mesh() { #endif SERIAL_ECHOLNPGM("Tilting mesh point ", point_num, "/", total_points, "\n"); - TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points)); + TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT_F(MSG_LCD_TILTING_MESH), point_num, total_points)); measured_z = probe.probe_at_point(rpos, parser.seen_test('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling @@ -1817,7 +1811,8 @@ void unified_bed_leveling::smart_fill_mesh() { print_hex_word(i); SERIAL_ECHOPGM(": "); for (uint16_t j = 0; j < 16; j++) { - persistentStore.read_data(i + j, &cccc, sizeof(uint8_t)); + int pos = i + j; + persistentStore.read_data(pos, &cccc, sizeof(uint8_t)); print_hex_byte(cccc); SERIAL_CHAR(' '); } diff --git a/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin/src/feature/digipot/digipot_mcp4018.cpp index f776c5a339..48d7ff492c 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4018.cpp @@ -37,7 +37,7 @@ #ifndef DIGIPOT_A4988_Vrefmax #define DIGIPOT_A4988_Vrefmax 1.666 #endif -#define DIGIPOT_MCP4018_MAX_VALUE 127 +#define DIGIPOT_MCP4018_MAX_VALUE 127 #define DIGIPOT_A4988_Itripmax(Vref) ((Vref) / (8.0 * DIGIPOT_A4988_Rsx)) diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index 7416fe9f8d..e35b42a28b 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -35,8 +35,8 @@ // Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro #if MB(5DPRINT) - #define DIGIPOT_I2C_FACTOR 117.96f - #define DIGIPOT_I2C_MAX_CURRENT 1.736f + #define DIGIPOT_I2C_FACTOR 117.96f + #define DIGIPOT_I2C_MAX_CURRENT 1.736f #elif MB(AZTEEG_X5_MINI, AZTEEG_X5_MINI_WIFI) #define DIGIPOT_I2C_FACTOR 113.5f #define DIGIPOT_I2C_MAX_CURRENT 2.0f diff --git a/Marlin/src/feature/encoder_i2c.cpp b/Marlin/src/feature/encoder_i2c.cpp index 9a8e369c6a..135178456b 100644 --- a/Marlin/src/feature/encoder_i2c.cpp +++ b/Marlin/src/feature/encoder_i2c.cpp @@ -27,7 +27,6 @@ //todo: try faster I2C speed; tweak TWI_FREQ (400000L, or faster?); or just TWBR = ((CPU_FREQ / 400000L) - 16) / 2; //todo: consider Marlin-optimized Wire library; i.e. MarlinWire, like MarlinSerial - #include "../inc/MarlinConfig.h" #if ENABLED(I2C_POSITION_ENCODERS) @@ -462,7 +461,6 @@ void I2CPositionEncoder::reset() { TERN_(I2CPE_ERR_ROLLING_AVERAGE, ZERO(err)); } - bool I2CPositionEncodersMgr::I2CPE_anyaxis; uint8_t I2CPositionEncodersMgr::I2CPE_addr, I2CPositionEncodersMgr::I2CPE_idx; diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index b4ef18a9b9..fff2a1ed39 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -137,7 +137,7 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/)) // Retract by moving from a faux E position back to the current E position current_retract[active_extruder] = base_retract; prepare_internal_move_to_destination( // set current from destination - settings.retract_feedrate_mm_s * TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS)) + MUL_TERN(RETRACT_SYNC_MIXING, settings.retract_feedrate_mm_s, MIXING_STEPPERS) ); // Is a Z hop set, and has the hop not yet been done? @@ -165,8 +165,7 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/)) // Recover E, set_current_to_destination prepare_internal_move_to_destination( - (swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s) - * TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS)) + MUL_TERN(RETRACT_SYNC_MIXING, swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s, MIXING_STEPPERS) ); } @@ -212,6 +211,8 @@ void FWRetract::M207() { } void FWRetract::M207_report() { + TERN_(MARLIN_SMALL_BUILD, return); + SERIAL_ECHOLNPGM_P( PSTR(" M207 S"), LINEAR_UNIT(settings.retract_length) , PSTR(" W"), LINEAR_UNIT(settings.swap_retract_length) @@ -237,6 +238,8 @@ void FWRetract::M208() { } void FWRetract::M208_report() { + TERN_(MARLIN_SMALL_BUILD, return); + SERIAL_ECHOLNPGM( " M208 S", LINEAR_UNIT(settings.retract_recover_extra) , " W", LINEAR_UNIT(settings.swap_retract_recover_extra) @@ -258,10 +261,11 @@ void FWRetract::M208_report() { } void FWRetract::M209_report() { + TERN_(MARLIN_SMALL_BUILD, return); + SERIAL_ECHOLNPGM(" M209 S", AS_DIGIT(autoretract_enabled)); } #endif // FWRETRACT_AUTORETRACT - #endif // FWRETRACT diff --git a/Marlin/src/feature/host_actions.cpp b/Marlin/src/feature/host_actions.cpp index cc5face259..538aa92e91 100644 --- a/Marlin/src/feature/host_actions.cpp +++ b/Marlin/src/feature/host_actions.cpp @@ -186,13 +186,13 @@ void HostUI::action(FSTR_P const fstr, const bool eol) { switch (response) { case 0: // "Purge More" button - #if ALL(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE) + #if ENABLED(M600_PURGE_MORE_RESUMABLE) pause_menu_response = PAUSE_RESPONSE_EXTRUDE_MORE; // Simulate menu selection (menu exits, doesn't extrude more) #endif break; case 1: // "Continue" / "Disable Runout" button - #if ALL(M600_PURGE_MORE_RESUMABLE, ADVANCED_PAUSE_FEATURE) + #if ENABLED(M600_PURGE_MORE_RESUMABLE) pause_menu_response = PAUSE_RESPONSE_RESUME_PRINT; // Simulate menu selection #endif #if HAS_FILAMENT_SENSOR diff --git a/Marlin/src/feature/hotend_idle.h b/Marlin/src/feature/hotend_idle.h index a4229153c9..d215e27bc5 100644 --- a/Marlin/src/feature/hotend_idle.h +++ b/Marlin/src/feature/hotend_idle.h @@ -32,7 +32,9 @@ typedef struct { timeout = HOTEND_IDLE_TIMEOUT_SEC; trigger = HOTEND_IDLE_MIN_TRIGGER; nozzle_target = HOTEND_IDLE_NOZZLE_TARGET; - bed_target = HOTEND_IDLE_BED_TARGET; + #if HAS_HEATED_BED + bed_target = HOTEND_IDLE_BED_TARGET; + #endif } } hotend_idle_settings_t; diff --git a/Marlin/src/feature/leds/neopixel.h b/Marlin/src/feature/leds/neopixel.h index 6cc8b6157e..26f7a07d58 100644 --- a/Marlin/src/feature/leds/neopixel.h +++ b/Marlin/src/feature/leds/neopixel.h @@ -130,7 +130,7 @@ public: } // Accessors - static uint16_t pixels() { return adaneo1.numPixels() * TERN1(NEOPIXEL2_INSERIES, 2); } + static uint16_t pixels() { return MUL_TERN(NEOPIXEL2_INSERIES, adaneo1.numPixels(), 2); } static uint32_t pixel_color(const uint16_t n) { #if ENABLED(NEOPIXEL2_INSERIES) diff --git a/Marlin/src/feature/leds/printer_event_leds.h b/Marlin/src/feature/leds/printer_event_leds.h index 3a037eba96..856826b969 100644 --- a/Marlin/src/feature/leds/printer_event_leds.h +++ b/Marlin/src/feature/leds/printer_event_leds.h @@ -56,7 +56,7 @@ public: #if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER static void onHeatingDone() { leds.set_white(); } - static void onPidTuningDone(LEDColor c) { leds.set_color(c); } + static void onPIDTuningDone(LEDColor c) { leds.set_color(c); } #endif #if HAS_MEDIA diff --git a/Marlin/src/feature/max7219.cpp b/Marlin/src/feature/max7219.cpp index 6089b1a86e..64960f1dfe 100644 --- a/Marlin/src/feature/max7219.cpp +++ b/Marlin/src/feature/max7219.cpp @@ -72,6 +72,26 @@ uint16_t CodeProfiler::call_count = 0; #endif +#if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL + static int16_t last_head_cnt = 0xF, last_tail_cnt = 0xF; +#else + #ifdef MAX7219_DEBUG_PLANNER_HEAD + static int16_t last_head_cnt = 0x1; + #endif + #ifdef MAX7219_DEBUG_PLANNER_TAIL + static int16_t last_tail_cnt = 0x1; + #endif +#endif +#ifdef MAX7219_DEBUG_PLANNER_QUEUE + static int16_t last_depth = 0; +#endif +#ifdef MAX7219_DEBUG_PROFILE + static uint8_t last_time_fraction = 0; +#endif +#ifdef MAX7219_DEBUG_MULTISTEPPING + static uint8_t last_multistepping = 0; +#endif + Max7219 max7219; uint8_t Max7219::led_line[MAX7219_LINES]; // = { 0 }; @@ -550,6 +570,29 @@ void Max7219::init() { #if MAX7219_INIT_TEST start_test_pattern(); #endif + + #ifdef MAX7219_REINIT_ON_POWERUP + #if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL + last_head_cnt = 0xF; + last_tail_cnt = 0xF; + #else + #ifdef MAX7219_DEBUG_PLANNER_HEAD + last_head_cnt = 0x1; + #endif + #ifdef MAX7219_DEBUG_PLANNER_TAIL + last_tail_cnt = 0x1; + #endif + #endif + #ifdef MAX7219_DEBUG_PLANNER_QUEUE + last_depth = 0; + #endif + #ifdef MAX7219_DEBUG_PROFILE + last_time_fraction = 0; + #endif + #ifdef MAX7219_DEBUG_MULTISTEPPING + last_multistepping = 0; + #endif + #endif } /** @@ -676,8 +719,6 @@ void Max7219::idle_tasks() { #if defined(MAX7219_DEBUG_PLANNER_HEAD) && defined(MAX7219_DEBUG_PLANNER_TAIL) && MAX7219_DEBUG_PLANNER_HEAD == MAX7219_DEBUG_PLANNER_TAIL - static int16_t last_head_cnt = 0xF, last_tail_cnt = 0xF; - if (last_head_cnt != head || last_tail_cnt != tail) { range16(MAX7219_DEBUG_PLANNER_HEAD, last_tail_cnt, tail, last_head_cnt, head, &row_change_mask); last_head_cnt = head; @@ -687,7 +728,6 @@ void Max7219::idle_tasks() { #else #ifdef MAX7219_DEBUG_PLANNER_HEAD - static int16_t last_head_cnt = 0x1; if (last_head_cnt != head) { mark16(MAX7219_DEBUG_PLANNER_HEAD, last_head_cnt, head, &row_change_mask); last_head_cnt = head; @@ -695,7 +735,6 @@ void Max7219::idle_tasks() { #endif #ifdef MAX7219_DEBUG_PLANNER_TAIL - static int16_t last_tail_cnt = 0x1; if (last_tail_cnt != tail) { mark16(MAX7219_DEBUG_PLANNER_TAIL, last_tail_cnt, tail, &row_change_mask); last_tail_cnt = tail; @@ -714,7 +753,6 @@ void Max7219::idle_tasks() { #endif #ifdef MAX7219_DEBUG_PROFILE - static uint8_t last_time_fraction = 0; const uint8_t current_time_fraction = (uint16_t(CodeProfiler::get_time_fraction()) * MAX7219_NUMBER_UNITS + 8) / 16; if (current_time_fraction != last_time_fraction) { quantity(MAX7219_DEBUG_PROFILE, last_time_fraction, current_time_fraction, &row_change_mask); diff --git a/Marlin/src/feature/meatpack.h b/Marlin/src/feature/meatpack.h index 37039c3056..0de1f792c1 100644 --- a/Marlin/src/feature/meatpack.h +++ b/Marlin/src/feature/meatpack.h @@ -144,7 +144,6 @@ struct MeatpackSerial : public SerialBase > { void flushTX() { CALL_IF_EXISTS(void, &out, flushTX); } SerialFeature features(serial_index_t index) const { return SerialFeature::MeatPack | CALL_IF_EXISTS(SerialFeature, &out, features, index); } - int available(serial_index_t index) { if (charCount) return charCount; // The buffer still has data if (out.available(index) <= 0) return 0; // No data to read diff --git a/Marlin/src/feature/mmu/mmu2-serial-protocol.md b/Marlin/src/feature/mmu/mmu2-serial-protocol.md index 42f30e418d..088d41b446 100644 --- a/Marlin/src/feature/mmu/mmu2-serial-protocol.md +++ b/Marlin/src/feature/mmu/mmu2-serial-protocol.md @@ -28,11 +28,8 @@ Now we are sure MMU is available and ready. If there was a timeout or other comm - *Build number* is an integer value and has to be >=126, or =>132 if 12V mode is enabled - *FINDA status* is 1 if the filament is loaded to the extruder, 0 otherwise - *Build number* is checked against the required value, if it does not match, printer is halted. - - Toolchange ========== @@ -54,7 +51,6 @@ When done, the MMU sends 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. - FINDA status ============ @@ -63,8 +59,6 @@ FINDA status *FINDA status* is 1 if the is filament loaded to the extruder, 0 otherwise. This could be used as filament runout sensor if probed regularly. - - Load filament ============= @@ -74,7 +68,6 @@ MMU will feed filament down to the extruder, when done - MMU => 'ok\n' - Unload filament ============= @@ -84,8 +77,6 @@ MMU will retract current filament from the extruder, when done - MMU => 'ok\n' - - Eject filament ============== diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index 8756c339e3..74a4f236c0 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -23,6 +23,8 @@ /** * feature/pause.cpp - Pause feature support functions * This may be combined with related G-codes if features are consolidated. + * + * Note: Calls to ui.pause_show_message are passed to either ExtUI or MarlinUI. */ #include "../inc/MarlinConfigPre.h" @@ -60,8 +62,6 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../lcd/e3v2/proui/dwin.h" #endif #include "../lcd/marlinui.h" @@ -148,7 +148,7 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P thermalManager.setTargetHotend(thermalManager.extrude_min_temp, active_extruder); #endif - ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode); UNUSED(mode); + ui.pause_show_message(PAUSE_MESSAGE_HEATING, mode); if (wait) return thermalManager.wait_for_hotend(active_extruder); @@ -288,8 +288,8 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load // Show "Purge More" / "Resume" menu and wait for reply KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = false; - #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) - ui.pause_show_message(PAUSE_MESSAGE_OPTION); // Also sets PAUSE_RESPONSE_WAIT_FOR + #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI) + ui.pause_show_message(PAUSE_MESSAGE_OPTION); // MarlinUI and MKS UI also set PAUSE_RESPONSE_WAIT_FOR #else pause_menu_response = PAUSE_RESPONSE_WAIT_FOR; #endif diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index 304c8a611d..4d968406c2 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -52,10 +52,12 @@ enum PauseMessage : char { PAUSE_MESSAGE_RESUME, PAUSE_MESSAGE_HEAT, PAUSE_MESSAGE_HEATING, - PAUSE_MESSAGE_STATUS + PAUSE_MESSAGE_STATUS, + PAUSE_MESSAGE_COUNT }; #if M600_PURGE_MORE_RESUMABLE + // Input methods can Purge More, Resume, or request input enum PauseMenuResponse : char { PAUSE_RESPONSE_WAIT_FOR, PAUSE_RESPONSE_EXTRUDE_MORE, @@ -105,7 +107,7 @@ void wait_for_confirmation( void resume_print( const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move - const_float_t extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length + const_float_t purge_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length const int8_t max_beep_count=0, // Beep alert for attention const celsius_t targetTemp=0 // (°C) A target temperature for the hotend DXC_PARAMS // Dual-X-Carriage extruder index @@ -114,7 +116,7 @@ void resume_print( bool load_filament( const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move - const_float_t extrude_length=0, // (mm) Purge length + const_float_t purge_length=0, // (mm) Purge length const int8_t max_beep_count=0, // Beep alert for attention const bool show_lcd=false, // Set LCD status messages? const bool pause_for_user=false, // Pause for user before returning? diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 6fa91b3826..20eb63a6f1 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -34,6 +34,10 @@ #include "../module/temperature.h" #include "../MarlinCore.h" +#if ENABLED(MAX7219_REINIT_ON_POWERUP) + #include "max7219.h" +#endif + #if ENABLED(PS_OFF_SOUND) #include "../libs/buzzer.h" #endif @@ -60,7 +64,7 @@ bool Power::psu_on; millis_t Power::lastPowerOn; #endif -#if defined(PS_ON_EDM_PIN) || (defined(PS_ON_EDM_PIN) && ENABLED(PSU_OFF_REDUNDANT)) +#if PSU_TRACK_STATE_MS millis_t Power::last_state_change_ms = 0; #endif @@ -92,18 +96,17 @@ void Power::power_on() { OUT_WRITE(PS_ON_PIN, PSU_ACTIVE_STATE); #if ENABLED(PSU_OFF_REDUNDANT) - #if (ENABLED(PSU_OFF_REDUNDANT_OPPOSING)) - OUT_WRITE(PS_ON1_PIN, !PSU_ACTIVE_STATE); - #else - OUT_WRITE(PS_ON1_PIN, PSU_ACTIVE_STATE); - #endif - #endif - #if defined(PS_ON_EDM_PIN) || (defined(PS_ON_EDM_PIN) && ENABLED(PSU_OFF_REDUNDANT)) - last_state_change_ms = millis(); + OUT_WRITE(PS_ON1_PIN, TERN_(PSU_OFF_REDUNDANT_INVERTED, !)PSU_ACTIVE_STATE); #endif + TERN_(PSU_TRACK_STATE_MS, last_state_change_ms = millis()); + psu_on = true; safe_delay(PSU_POWERUP_DELAY); + restore_stepper_drivers(); + + TERN_(MAX7219_REINIT_ON_POWERUP, max7219.init()); + TERN_(HAS_TRINAMIC_CONFIG, safe_delay(PSU_POWERUP_DELAY)); #ifdef PSU_POWERUP_GCODE @@ -116,12 +119,12 @@ void Power::power_on() { * Processes any PSU_POWEROFF_GCODE and makes a PS_OFF_SOUND if enabled. */ void Power::power_off() { - SERIAL_ECHOLNPGM(STR_POWEROFF); - TERN_(HAS_SUICIDE, suicide()); if (!psu_on) return; + SERIAL_ECHOLNPGM(STR_POWEROFF); + #ifdef PSU_POWEROFF_GCODE gcode.process_subcommands_now(F(PSU_POWEROFF_GCODE)); #endif @@ -132,15 +135,9 @@ void Power::power_off() { OUT_WRITE(PS_ON_PIN, !PSU_ACTIVE_STATE); #if ENABLED(PSU_OFF_REDUNDANT) - #if (ENABLED(PSU_OFF_REDUNDANT_OPPOSING)) - OUT_WRITE(PS_ON1_PIN, PSU_ACTIVE_STATE); - #else - OUT_WRITE(PS_ON1_PIN, !PSU_ACTIVE_STATE); - #endif - #endif - #if defined(PS_ON_EDM_PIN) || (defined(PS_ON_EDM_PIN) && ENABLED(PSU_OFF_REDUNDANT)) - last_state_change_ms = millis(); + OUT_WRITE(PS_ON1_PIN, IF_DISABLED(PSU_OFF_REDUNDANT_INVERTED, !)PSU_ACTIVE_STATE); #endif + TERN_(PSU_TRACK_STATE_MS, last_state_change_ms = millis()); psu_on = false; diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 480c6e8a5b..16f9dbcef5 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -24,8 +24,11 @@ /** * power.h - power control */ +#if PIN_EXISTS(PS_ON_EDM) || (PIN_EXISTS(PS_ON1_EDM) && ENABLED(PSU_OFF_REDUNDANT)) + #define PSU_TRACK_STATE_MS 1 +#endif -#if ANY(AUTO_POWER_CONTROL, POWER_OFF_TIMER) || defined(PS_ON_EDM_PIN) || (defined(PS_ON_EDM_PIN) && ENABLED(PSU_OFF_REDUNDANT)) +#if ANY(AUTO_POWER_CONTROL, POWER_OFF_TIMER, PSU_TRACK_STATE_MS) #include "../core/millis_t.h" #endif @@ -37,7 +40,7 @@ class Power { static void power_on(); static void power_off(); - #if defined(PS_ON_EDM_PIN) || (defined(PS_ON_EDM_PIN) && ENABLED(PSU_OFF_REDUNDANT)) + #if PSU_TRACK_STATE_MS static millis_t last_state_change_ms; #endif diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 7c90bb684a..1867aba6ed 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -48,8 +48,8 @@ uint8_t PrintJobRecovery::queue_index_r; uint32_t PrintJobRecovery::cmd_sdpos, // = 0 PrintJobRecovery::sdpos[BUFSIZE]; -#if HAS_DWIN_E3V2_BASIC - bool PrintJobRecovery::dwin_flag; // = false +#if HAS_PLR_UI_FLAG + bool PrintJobRecovery::ui_flag_resume; // = false #endif #include "../sd/cardreader.h" @@ -75,16 +75,15 @@ uint32_t PrintJobRecovery::cmd_sdpos, // = 0 PrintJobRecovery recovery; -#ifndef POWER_LOSS_PURGE_LEN - #define POWER_LOSS_PURGE_LEN 0 -#endif - #if DISABLED(BACKUP_POWER_SUPPLY) #undef POWER_LOSS_RETRACT_LEN // No retract at outage without backup power #endif #ifndef POWER_LOSS_RETRACT_LEN #define POWER_LOSS_RETRACT_LEN 0 #endif +#ifndef POWER_LOSS_PURGE_LEN + #define POWER_LOSS_PURGE_LEN 0 +#endif // Allow power-loss recovery to be aborted #define PLR_CAN_ABORT @@ -229,6 +228,8 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW TERN_(HAS_HEATED_BED, info.target_temperature_bed = thermalManager.degTargetBed()); + TERN_(HAS_HEATED_CHAMBER, info.target_temperature_chamber = thermalManager.degTargetChamber()); + TERN_(HAS_FAN, COPY(info.fan_speed, thermalManager.fan_speed)); #if HAS_LEVELING @@ -384,6 +385,12 @@ void PrintJobRecovery::resume() { PROCESS_SUBCOMMANDS_NOW(F("M420S0")); #endif + #if HAS_HEATED_CHAMBER + // Restore the chamber temperature + const celsius_t ct = info.target_temperature_chamber; + if (ct) PROCESS_SUBCOMMANDS_NOW(TS(F("M191S"), ct)); + #endif + #if HAS_HEATED_BED // Restore the bed temperature const celsius_t bt = info.target_temperature_bed; @@ -634,6 +641,10 @@ void PrintJobRecovery::resume() { DEBUG_ECHOLNPGM("target_temperature_bed: ", info.target_temperature_bed); #endif + #if HAS_HEATED_CHAMBER + DEBUG_ECHOLNPGM("target_temperature_chamber: ", info.target_temperature_chamber); + #endif + #if HAS_FAN DEBUG_ECHOPGM("fan_speed: "); FANS_LOOP(i) { diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index 1fdc42db26..7de8450c91 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -42,8 +42,11 @@ #define POWER_LOSS_STATE HIGH #endif +#if DISABLED(BACKUP_POWER_SUPPLY) + #undef POWER_LOSS_ZRAISE // No Z raise at outage without backup power +#endif #ifndef POWER_LOSS_ZRAISE - #define POWER_LOSS_ZRAISE 2 + #define POWER_LOSS_ZRAISE 2 // Default Z-raise on outage or resume #endif //#define DEBUG_POWER_LOSS_RECOVERY @@ -84,6 +87,9 @@ typedef struct { #if HAS_HEATED_BED celsius_t target_temperature_bed; #endif + #if HAS_HEATED_CHAMBER + celsius_t target_temperature_chamber; + #endif #if HAS_FAN uint8_t fan_speed[FAN_COUNT]; #endif @@ -145,8 +151,8 @@ class PrintJobRecovery { static uint32_t cmd_sdpos, //!< SD position of the next command sdpos[BUFSIZE]; //!< SD positions of queued commands - #if HAS_DWIN_E3V2_BASIC - static bool dwin_flag; + #if HAS_PLR_UI_FLAG + static bool ui_flag_resume; //!< Flag the UI to show a dialog to Resume (M1000) or Cancel (M1000C) #endif static void init(); diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index 1d684c6b85..2bcb47e99a 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -68,8 +68,6 @@ bool FilamentMonitorBase::enabled = true, #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../lcd/e3v2/proui/dwin.h" #endif void event_filament_runout(const uint8_t extruder) { @@ -88,7 +86,6 @@ void event_filament_runout(const uint8_t extruder) { #endif TERN_(EXTENSIBLE_UI, ExtUI::onFilamentRunout(ExtUI::getTool(extruder))); - TERN_(DWIN_LCD_PROUI, dwinFilamentRunout(extruder)); #if ANY(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS, MULTI_FILAMENT_SENSOR) const char tool = '0' + TERN0(MULTI_FILAMENT_SENSOR, extruder); diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index 43c034020a..c95c39f273 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -341,7 +341,6 @@ class FilamentSensorBase { } }; - /********************************* RESPONSE TYPE *********************************/ #if HAS_FILAMENT_RUNOUT_DISTANCE diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 8908ae6df5..681df2f081 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -38,7 +38,6 @@ #define PCT_TO_PWM(X) ((X) * 255 / 100) #define PCT_TO_SERVO(X) ((X) * 180 / 100) - // Laser/Cutter operation mode enum CutterMode : int8_t { CUTTER_MODE_ERROR = -1, diff --git a/Marlin/src/feature/stepper_driver_safety.cpp b/Marlin/src/feature/stepper_driver_safety.cpp index acdd695909..3ddc05ea1e 100644 --- a/Marlin/src/feature/stepper_driver_safety.cpp +++ b/Marlin/src/feature/stepper_driver_safety.cpp @@ -31,7 +31,7 @@ static uint32_t axis_plug_backward = 0; void stepper_driver_backward_error(FSTR_P const fstr) { SERIAL_ERROR_START(); SERIAL_ECHOLN(fstr, F(" driver is backward!")); - ui.status_printf(2, F(S_FMT S_FMT), FTOP(fstr), GET_TEXT(MSG_DRIVER_BACKWARD)); + ui.status_printf(2, F(S_FMT S_FMT), FTOP(fstr), GET_TEXT_F(MSG_DRIVER_BACKWARD)); } void stepper_driver_backward_check() { diff --git a/Marlin/src/feature/stepper_driver_safety.h b/Marlin/src/feature/stepper_driver_safety.h index 46edf3390d..ac3d8b64f9 100644 --- a/Marlin/src/feature/stepper_driver_safety.h +++ b/Marlin/src/feature/stepper_driver_safety.h @@ -21,7 +21,6 @@ */ #pragma once - #include "../inc/MarlinConfigPre.h" void stepper_driver_backward_check(); diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index bff6872e4d..421f9b0c22 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -763,7 +763,7 @@ SERIAL_CHAR('\t'); st.printLabel(); SERIAL_CHAR('\t'); - print_hex_long(drv_status, ':'); + print_hex_long(drv_status, ':', true); if (drv_status == 0xFFFFFFFF || drv_status == 0) SERIAL_ECHOPGM("\t Bad response!"); SERIAL_EOL(); break; diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index a0a72058aa..7ed070c9b8 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -144,15 +144,13 @@ class TMCMarlin : public TMC, public TMCStorage { #endif #endif - #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) - void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } - #if ENABLED(HYBRID_THRESHOLD) - void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } - #endif - #if USE_SENSORLESS - void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } - #endif + #if ENABLED(HYBRID_THRESHOLD) + void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } + #endif + #if USE_SENSORLESS + void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } #endif static constexpr int8_t sgt_min = -64, @@ -207,12 +205,10 @@ class TMCMarlin : public TMC220 } #endif - #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) - void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } - #if ENABLED(HYBRID_THRESHOLD) - void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } - #endif + #if ENABLED(HYBRID_THRESHOLD) + void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } #endif }; @@ -269,15 +265,13 @@ class TMCMarlin : public TMC220 } #endif - #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) - void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } - #if ENABLED(HYBRID_THRESHOLD) - void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } - #endif - #if USE_SENSORLESS - void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } - #endif + #if ENABLED(HYBRID_THRESHOLD) + void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } + #endif + #if USE_SENSORLESS + void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } #endif static constexpr uint8_t sgt_min = 0, @@ -315,12 +309,10 @@ class TMCMarlin : public TMC266 } #endif - #if ANY(HAS_MARLINUI_MENU, DWIN_LCD_PROUI) - void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } - #if USE_SENSORLESS - void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } - #endif + #if USE_SENSORLESS + void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } #endif static constexpr int8_t sgt_min = -64, diff --git a/Marlin/src/feature/twibus.h b/Marlin/src/feature/twibus.h index 806e2a147a..de23abbed5 100644 --- a/Marlin/src/feature/twibus.h +++ b/Marlin/src/feature/twibus.h @@ -74,7 +74,6 @@ class TWIBus { */ uint8_t buffer[TWIBUS_BUFFER_SIZE]; - public: /** * @brief Target device address diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 7fae11783e..ab940c65ac 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -532,7 +532,7 @@ void GcodeSuite::G26() { if (bedtemp) { if (!WITHIN(bedtemp, 40, BED_MAX_TARGET)) { - SERIAL_ECHOLNPGM("?Specified bed temperature not plausible (40-", BED_MAX_TARGET, "C)."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified bed temperature not plausible (40-", BED_MAX_TARGET, "C).")); return; } g26.bed_temp = bedtemp; @@ -543,7 +543,7 @@ void GcodeSuite::G26() { if (parser.seenval('L')) { g26.layer_height = parser.value_linear_units(); if (!WITHIN(g26.layer_height, 0.0, 2.0)) { - SERIAL_ECHOLNPGM("?Specified layer height not plausible."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified layer height not plausible.")); return; } } @@ -552,12 +552,12 @@ void GcodeSuite::G26() { if (parser.has_value()) { g26.retraction_multiplier = parser.value_float(); if (!WITHIN(g26.retraction_multiplier, 0.05, 15.0)) { - SERIAL_ECHOLNPGM("?Specified Retraction Multiplier not plausible."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified Retraction Multiplier not plausible.")); return; } } else { - SERIAL_ECHOLNPGM("?Retraction Multiplier must be specified."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Retraction Multiplier must be specified.")); return; } } @@ -565,7 +565,7 @@ void GcodeSuite::G26() { if (parser.seenval('S')) { g26.nozzle = parser.value_float(); if (!WITHIN(g26.nozzle, 0.1, 2.0)) { - SERIAL_ECHOLNPGM("?Specified nozzle size not plausible."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified nozzle size not plausible.")); return; } } @@ -575,7 +575,7 @@ void GcodeSuite::G26() { #if HAS_MARLINUI_MENU g26.prime_flag = -1; #else - SERIAL_ECHOLNPGM("?Prime length must be specified when not using an LCD."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Prime length must be specified when not using an LCD.")); return; #endif } @@ -583,7 +583,7 @@ void GcodeSuite::G26() { g26.prime_flag++; g26.prime_length = parser.value_linear_units(); if (!WITHIN(g26.prime_length, 0.0, 25.0)) { - SERIAL_ECHOLNPGM("?Specified prime length not plausible."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified prime length not plausible.")); return; } } @@ -592,7 +592,7 @@ void GcodeSuite::G26() { if (parser.seenval('F')) { g26.filament_diameter = parser.value_linear_units(); if (!WITHIN(g26.filament_diameter, 1.0, 4.0)) { - SERIAL_ECHOLNPGM("?Specified filament size not plausible."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified filament size not plausible.")); return; } } @@ -616,7 +616,7 @@ void GcodeSuite::G26() { // If any preset or temperature was specified if (noztemp) { if (!WITHIN(noztemp, 165, thermalManager.hotend_max_target(active_extruder))) { - SERIAL_ECHOLNPGM("?Specified nozzle temperature not plausible."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified nozzle temperature not plausible.")); return; } g26.hotend_temp = noztemp; @@ -637,12 +637,12 @@ void GcodeSuite::G26() { if (parser.seen('R')) g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1; else { - SERIAL_ECHOLNPGM("?(R)epeat must be specified when not using an LCD."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(R)epeat must be specified when not using an LCD.")); return; } #endif if (g26_repeats < 1) { - SERIAL_ECHOLNPGM("?(R)epeat value not plausible; must be at least 1."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(R)epeat value not plausible; must be at least 1.")); return; } @@ -650,7 +650,7 @@ void GcodeSuite::G26() { g26.xy_pos.set(parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position.x, parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position.y); if (!position_is_reachable(g26.xy_pos)) { - SERIAL_ECHOLNPGM("?Specified X,Y coordinate out of bounds."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Specified X,Y coordinate out of bounds.")); return; } diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index 89a43ef08a..c1a329fb8a 100644 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -64,7 +64,7 @@ void GcodeSuite::G35() { const uint8_t screw_thread = parser.byteval('S', TRAMMING_SCREW_THREAD); if (!WITHIN(screw_thread, 30, 51) || screw_thread % 10 > 1) { - SERIAL_ECHOLNPGM("?(S)crew thread must be 30, 31, 40, 41, 50, or 51."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(S)crew thread must be 30, 31, 40, 41, 50, or 51.")); return; } @@ -95,9 +95,11 @@ void GcodeSuite::G35() { for (uint8_t i = 0; i < G35_PROBE_COUNT; ++i) { const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE); if (isnan(z_probed_height)) { - SERIAL_ECHO( - F("G35 failed at point "), i + 1, F(" ("), FPSTR(pgm_read_ptr(&tramming_point_name[i])), C(')'), - FPSTR(SP_X_STR), tramming_points[i].x, FPSTR(SP_Y_STR), tramming_points[i].y + SERIAL_ECHOLN( + F("G35 failed at point "), i + 1, + F(" ("), FPSTR(pgm_read_ptr(&tramming_point_name[i])), C(')'), + FPSTR(SP_X_STR), tramming_points[i].x, + FPSTR(SP_Y_STR), tramming_points[i].y ); err_break = true; break; diff --git a/Marlin/src/gcode/bedlevel/G42.cpp b/Marlin/src/gcode/bedlevel/G42.cpp index cb5ed97406..193131ee4c 100644 --- a/Marlin/src/gcode/bedlevel/G42.cpp +++ b/Marlin/src/gcode/bedlevel/G42.cpp @@ -32,6 +32,12 @@ /** * G42: Move X & Y axes to mesh coordinates (I & J) + * + * Parameters: + * F : Feedrate in mm/min + * I : X axis point index + * J : Y axis point index + * P : Flag to put the prove at the given point */ void GcodeSuite::G42() { if (MOTION_CONDITIONS) { diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index d870a4f430..c495da3018 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -105,13 +105,12 @@ void GcodeSuite::M420() { const int16_t a = settings.calc_num_meshes(); if (!a) { - SERIAL_ECHOLNPGM("?EEPROM storage not available."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("EEPROM storage not available.")); return; } if (!WITHIN(storage_slot, 0, a - 1)) { - SERIAL_ECHOLNPGM("?Invalid storage slot."); - SERIAL_ECHOLNPGM("?Use 0 to ", a - 1); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Invalid storage slot. Use 0 to ", a - 1)); return; } @@ -120,7 +119,7 @@ void GcodeSuite::M420() { #else - SERIAL_ECHOLNPGM("?EEPROM storage not available."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("EEPROM storage not available.")); return; #endif @@ -245,6 +244,8 @@ void GcodeSuite::M420() { } void GcodeSuite::M420_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F( TERN(MESH_BED_LEVELING, "Mesh Bed Leveling", TERN(AUTO_BED_LEVELING_UBL, "Unified Bed Leveling", "Auto Bed Leveling")) )); diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 1ca3826c81..d97fc48906 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -51,8 +51,6 @@ #include "../../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD) #include "../../../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../../lcd/e3v2/proui/dwin.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) @@ -77,7 +75,7 @@ static void pre_g29_return(const bool retry, const bool did) { TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE, false)); } if (did) { - TERN_(HAS_DWIN_E3V2_BASIC, dwinLevelingDone()); + TERN_(DWIN_CREALITY_LCD, dwinLevelingDone()); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingDone()); } } @@ -344,7 +342,7 @@ G29_TYPE GcodeSuite::G29() { abl.verbose_level = parser.intval('V'); if (!WITHIN(abl.verbose_level, 0, 4)) { - SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(V)erbose level implausible (0-4).")); G29_RETURN(false, false); } @@ -365,11 +363,11 @@ G29_TYPE GcodeSuite::G29() { if (parser.seenval('P')) abl.grid_points.x = abl.grid_points.y = parser.value_int(); if (!WITHIN(abl.grid_points.x, 2, GRID_MAX_POINTS_X)) { - SERIAL_ECHOLNPGM("?Probe points (X) implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Probe points (X) implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ").")); G29_RETURN(false, false); } if (!WITHIN(abl.grid_points.y, 2, GRID_MAX_POINTS_Y)) { - SERIAL_ECHOLNPGM("?Probe points (Y) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Probe points (Y) implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ").")); G29_RETURN(false, false); } @@ -404,7 +402,7 @@ G29_TYPE GcodeSuite::G29() { DEBUG_ECHOLNPGM("G29 L", abl.probe_position_lf.x, " R", abl.probe_position_rb.x, " F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y); } - SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG(" (L,R,F,B) out of bounds.")); G29_RETURN(false, false); } @@ -425,8 +423,6 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(AUTO_BED_LEVELING_3POINT) if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("> 3-point Leveling"); points[0].z = points[1].z = points[2].z = 0; // Probe at 3 arbitrary points - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - TERN_(DWIN_LCD_PROUI, dwinLevelingStart()); #endif TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); @@ -436,11 +432,7 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(PREHEAT_BEFORE_LEVELING) if (!abl.dryrun) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, - #if ALL(DWIN_LCD_PROUI, HAS_HEATED_BED) - hmiData.bedLevT - #else - LEVELING_BED_TEMP - #endif + TERN(EXTENSIBLE_UI, ExtUI::getLevelingBedTemp(), LEVELING_BED_TEMP) ); #endif } @@ -691,7 +683,7 @@ G29_TYPE GcodeSuite::G29() { if (TERN0(IS_KINEMATIC, !probe.can_reach(abl.probePos))) continue; if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing mesh point ", pt_index, "/", abl.abl_points, "."); - TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), int(pt_index), int(abl.abl_points))); + TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT_F(MSG_PROBING_POINT), int(pt_index), int(abl.abl_points))); #if ENABLED(BD_SENSOR_PROBE_NO_STOP) if (PR_INNER_VAR == inStart) { @@ -790,7 +782,7 @@ G29_TYPE GcodeSuite::G29() { for (uint8_t i = 0; i < 3; ++i) { if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing point ", i + 1, "/3."); - TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_POINT), int(i + 1))); + TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT_F(MSG_PROBING_POINT), int(i + 1))); // Retain the last probe position abl.probePos = xy_pos_t(points[i]); diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index b3f03d03ba..6d23de4f77 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -40,8 +40,6 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../../lcd/e3v2/proui/dwin.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) @@ -144,7 +142,6 @@ void GcodeSuite::G29() { queue.inject(F("G29S2")); TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart()); - TERN_(DWIN_LCD_PROUI, dwinLevelingStart()); return; } @@ -170,7 +167,6 @@ void GcodeSuite::G29() { // Save Z for the previous mesh position bedlevel.set_zigzag_z(mbl_probe_index - 1, current_position.z); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, current_position.z)); - TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(_MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS), current_position.z)); SET_SOFT_ENDSTOP_LOOSE(false); } // If there's another point to sample, move there with optional lift. @@ -237,7 +233,6 @@ void GcodeSuite::G29() { if (parser.seenval('Z')) { bedlevel.z_values[ix][iy] = parser.value_linear_units(); TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ix, iy, bedlevel.z_values[ix][iy])); - TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(ix, iy, bedlevel.z_values[ix][iy])); } else return echo_not_entered('Z'); @@ -258,7 +253,7 @@ void GcodeSuite::G29() { if (state == MeshNext) { SERIAL_ECHOLNPGM("MBL G29 point ", _MIN(mbl_probe_index, GRID_MAX_POINTS), " of ", GRID_MAX_POINTS); - if (mbl_probe_index > 0) TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), _MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS))); + if (mbl_probe_index > 0) TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT_F(MSG_PROBING_POINT), _MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS))); } report_current_position(); diff --git a/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin/src/gcode/bedlevel/ubl/M421.cpp index 3a5aa8cb03..99ba3ce19b 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M421.cpp @@ -33,8 +33,6 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../../lcd/e3v2/proui/dwin.h" #endif /** @@ -69,7 +67,6 @@ void GcodeSuite::M421() { float &zval = bedlevel.z_values[ij.x][ij.y]; // Altering this Mesh Point zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0); // N=NAN, Z=NEWVAL, or Q=ADDVAL TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval)); // Ping ExtUI in case it's showing the mesh - TERN_(DWIN_LCD_PROUI, dwinMeshUpdate(ij.x, ij.y, zval)); } } diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 55698c942b..0ab1ca6105 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -52,8 +52,6 @@ #include "../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD) #include "../../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(LASER_FEATURE) @@ -223,7 +221,7 @@ void GcodeSuite::G28() { set_and_report_grblstate(M_HOMING); #endif - TERN_(HAS_DWIN_E3V2_BASIC, dwinHomingStart()); + TERN_(DWIN_CREALITY_LCD, dwinHomingStart()); TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart()); planner.synchronize(); // Wait for planner moves to finish! @@ -652,7 +650,7 @@ void GcodeSuite::G28() { ui.refresh(); - TERN_(HAS_DWIN_E3V2_BASIC, dwinHomingDone()); + TERN_(DWIN_CREALITY_LCD, dwinHomingDone()); TERN_(EXTENSIBLE_UI, ExtUI::onHomingDone()); report_current_position(); diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 223beb4ddf..59e0db132a 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -390,7 +390,7 @@ void GcodeSuite::G33() { const int8_t probe_points = parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS); if (!WITHIN(probe_points, 0, 10)) { - SERIAL_ECHOLNPGM("?(P)oints implausible (0-10)."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(P)oints implausible (0-10).")); return; } @@ -409,19 +409,19 @@ void GcodeSuite::G33() { const float calibration_precision = parser.floatval('C', 0.0f); if (calibration_precision < 0) { - SERIAL_ECHOLNPGM("?(C)alibration precision implausible (>=0)."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(C)alibration precision implausible (>=0).")); return; } const int8_t force_iterations = parser.intval('F', 0); if (!WITHIN(force_iterations, 0, 30)) { - SERIAL_ECHOLNPGM("?(F)orce iteration implausible (0-30)."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(F)orce iteration implausible (0-30).")); return; } const int8_t verbose_level = parser.byteval('V', 1); if (!WITHIN(verbose_level, 0, 3)) { - SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-3)."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(V)erbose level implausible (0-3).")); return; } diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index bbc403904f..7a27a61b9d 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -110,19 +110,19 @@ void GcodeSuite::G34() { const int8_t z_auto_align_iterations = parser.intval('I', Z_STEPPER_ALIGN_ITERATIONS); if (!WITHIN(z_auto_align_iterations, 1, 30)) { - SERIAL_ECHOLNPGM("?(I)teration out of bounds (1-30)."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(I)teration out of bounds (1-30).")); break; } const float z_auto_align_accuracy = parser.floatval('T', Z_STEPPER_ALIGN_ACC); - if (!WITHIN(z_auto_align_accuracy, 0.01f, 1.0f)) { - SERIAL_ECHOLNPGM("?(T)arget accuracy out of bounds (0.01-1.0)."); + if (!WITHIN(z_auto_align_accuracy, 0.001f, 1.0f)) { + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(T)arget accuracy out of bounds (0.001-1.0).")); break; } const float z_auto_align_amplification = TERN(HAS_Z_STEPPER_ALIGN_STEPPER_XY, Z_STEPPER_ALIGN_AMP, parser.floatval('A', Z_STEPPER_ALIGN_AMP)); if (!WITHIN(ABS(z_auto_align_amplification), 0.5f, 2.0f)) { - SERIAL_ECHOLNPGM("?(A)mplification out of bounds (0.5-2.0)."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(A)mplification out of bounds (0.5-2.0).")); break; } @@ -450,7 +450,7 @@ void GcodeSuite::M422() { const bool is_probe_point = parser.seen_test('S'); if (TERN0(HAS_Z_STEPPER_ALIGN_STEPPER_XY, is_probe_point && parser.seen_test('W'))) { - SERIAL_ECHOLNPGM("?(S) and (W) may not be combined."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(S) and (W) may not be combined.")); return; } @@ -460,7 +460,7 @@ void GcodeSuite::M422() { ); if (!is_probe_point && TERN1(HAS_Z_STEPPER_ALIGN_STEPPER_XY, !parser.seen_test('W'))) { - SERIAL_ECHOLNPGM("?(S)" TERN_(HAS_Z_STEPPER_ALIGN_STEPPER_XY, " or (W)") " is required."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(S)" TERN_(HAS_Z_STEPPER_ALIGN_STEPPER_XY, " or (W)") " is required.")); return; } @@ -490,11 +490,11 @@ void GcodeSuite::M422() { if (is_probe_point) { if (!probe.can_reach(pos.x, Y_CENTER)) { - SERIAL_ECHOLNPGM("?(X) out of bounds."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(X) out of bounds.")); return; } if (!probe.can_reach(pos)) { - SERIAL_ECHOLNPGM("?(Y) out of bounds."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(Y) out of bounds.")); return; } } @@ -503,6 +503,8 @@ void GcodeSuite::M422() { } void GcodeSuite::M422_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading(forReplay, F(STR_Z_AUTO_ALIGN)); for (uint8_t i = 0; i < NUM_Z_STEPPERS; ++i) { report_echo_start(forReplay); diff --git a/Marlin/src/gcode/calibrate/M425.cpp b/Marlin/src/gcode/calibrate/M425.cpp index cd206ca489..22d71aba58 100644 --- a/Marlin/src/gcode/calibrate/M425.cpp +++ b/Marlin/src/gcode/calibrate/M425.cpp @@ -106,6 +106,8 @@ void GcodeSuite::M425() { } void GcodeSuite::M425_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_BACKLASH_COMPENSATION)); SERIAL_ECHOLNPGM_P( PSTR(" M425 F"), backlash.get_correction() diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index 2d219a07c5..910395e561 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -62,16 +62,13 @@ void GcodeSuite::M48() { const int8_t verbose_level = parser.byteval('V', 1); if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_ECHOLNPGM("?(V)erbose level implausible (0-4)."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(V)erbose level implausible (0-4).")); return; } - if (verbose_level > 0) - SERIAL_ECHOLNPGM("M48 Z-Probe Repeatability Test"); - const int8_t n_samples = parser.byteval('P', 10); if (!WITHIN(n_samples, 4, 50)) { - SERIAL_ECHOLNPGM("?Sample size not plausible (4-50)."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Sample size not plausible (4-50).")); return; } @@ -85,7 +82,7 @@ void GcodeSuite::M48() { if (!probe.can_reach(test_position)) { LCD_MESSAGE_MAX(MSG_M48_OUT_OF_BOUNDS); - SERIAL_ECHOLNPGM("? (X,Y) out of bounds."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG(" (X,Y) out of bounds.")); return; } @@ -93,7 +90,7 @@ void GcodeSuite::M48() { bool seen_L = parser.seen('L'); uint8_t n_legs = seen_L ? parser.value_byte() : 0; if (n_legs > 15) { - SERIAL_ECHOLNPGM("?Legs of movement implausible (0-15)."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Legs of movement implausible (0-15).")); return; } if (n_legs == 1) n_legs = 2; @@ -102,6 +99,9 @@ void GcodeSuite::M48() { const bool schizoid_flag = parser.boolval('S'); if (schizoid_flag && !seen_L) n_legs = 7; + if (verbose_level > 0) + SERIAL_ECHOLNPGM("M48 Z-Probe Repeatability Test"); + if (verbose_level > 2) SERIAL_ECHOLNPGM("Positioning the probe..."); @@ -149,7 +149,7 @@ void GcodeSuite::M48() { for (uint8_t n = 0; n < n_samples; ++n) { #if HAS_STATUS_MESSAGE // Display M48 progress in the status bar - ui.status_printf(0, F(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples)); + ui.status_printf(0, F(S_FMT ": %d/%d"), GET_TEXT_F(MSG_M48_POINT), int(n + 1), int(n_samples)); #endif // When there are "legs" of movement move around the point before probing @@ -261,8 +261,7 @@ void GcodeSuite::M48() { #if HAS_STATUS_MESSAGE // Display M48 results in the status bar - char sigma_str[8]; - ui.status_printf(0, F(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str)); + ui.set_status_and_level(MString<30>(GET_TEXT_F(MSG_M48_DEVIATION), F(": "), w_float_t(sigma, 2, 6))); #endif } diff --git a/Marlin/src/gcode/calibrate/M665.cpp b/Marlin/src/gcode/calibrate/M665.cpp index 22ad80425a..5409ff4232 100644 --- a/Marlin/src/gcode/calibrate/M665.cpp +++ b/Marlin/src/gcode/calibrate/M665.cpp @@ -62,6 +62,8 @@ } void GcodeSuite::M665_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_DELTA_SETTINGS)); SERIAL_ECHOLNPGM_P( PSTR(" M665 L"), LINEAR_UNIT(delta_diagonal_rod) @@ -132,6 +134,8 @@ } void GcodeSuite::M665_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_SCARA_SETTINGS " (" STR_S_SEG_PER_SEC TERN_(HAS_SCARA_OFFSET, " " STR_SCARA_P_T_Z) ")")); SERIAL_ECHOLNPGM_P( PSTR(" M665 S"), segments_per_second @@ -170,6 +174,8 @@ } void GcodeSuite::M665_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_POLARGRAPH_SETTINGS)); SERIAL_ECHOLNPGM_P( PSTR(" M665 S"), LINEAR_UNIT(segments_per_second), @@ -196,10 +202,11 @@ } void GcodeSuite::M665_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); report_heading_etc(forReplay, F(STR_POLAR_SETTINGS)); SERIAL_ECHOLNPGM_P(PSTR(" M665 S"), segments_per_second); } -#endif +#endif // POLAR #endif // IS_KINEMATIC diff --git a/Marlin/src/gcode/calibrate/M666.cpp b/Marlin/src/gcode/calibrate/M666.cpp index 143b6f249a..4186290154 100644 --- a/Marlin/src/gcode/calibrate/M666.cpp +++ b/Marlin/src/gcode/calibrate/M666.cpp @@ -56,11 +56,13 @@ } } } - if (is_err) SERIAL_ECHOLNPGM("?M666 offsets must be <= 0"); + if (is_err) SERIAL_ECHOLNPGM(GCODE_ERR_MSG("M666 offsets must be <= 0")); if (!is_set) M666_report(); } void GcodeSuite::M666_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT)); SERIAL_ECHOLNPGM_P( PSTR(" M666 X"), LINEAR_UNIT(delta_endstop_adj.a) @@ -105,6 +107,8 @@ } void GcodeSuite::M666_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT)); SERIAL_ECHOPGM(" M666"); #if ENABLED(X_DUAL_ENDSTOPS) diff --git a/Marlin/src/gcode/calibrate/M852.cpp b/Marlin/src/gcode/calibrate/M852.cpp index 6d3c004548..001160ae72 100644 --- a/Marlin/src/gcode/calibrate/M852.cpp +++ b/Marlin/src/gcode/calibrate/M852.cpp @@ -92,6 +92,8 @@ void GcodeSuite::M852() { } void GcodeSuite::M852_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_SKEW_FACTOR)); SERIAL_ECHOPGM(" M852 I", p_float_t(planner.skew_factor.xy, 6)); #if ENABLED(SKEW_CORRECTION_FOR_Z) diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index 899f12099b..a0466fbeab 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -67,7 +67,7 @@ if (WITHIN(lval, 0, VOLUMETRIC_EXTRUDER_LIMIT_MAX)) planner.set_volumetric_extruder_limit(target_extruder, lval); else - SERIAL_ECHOLNPGM("?L value out of range (0-" STRINGIFY(VOLUMETRIC_EXTRUDER_LIMIT_MAX) ")."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("L value out of range (0-" STRINGIFY(VOLUMETRIC_EXTRUDER_LIMIT_MAX) ").")); } #endif @@ -75,6 +75,8 @@ } void GcodeSuite::M200_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + if (!forReplay) { report_heading(forReplay, F(STR_FILAMENT_SETTINGS), false); if (!parser.volumetric_enabled) SERIAL_ECHOPGM(" (Disabled):"); @@ -142,6 +144,8 @@ void GcodeSuite::M201() { } void GcodeSuite::M201_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_MAX_ACCELERATION)); #if NUM_AXES SERIAL_ECHOPGM_P( @@ -198,6 +202,8 @@ void GcodeSuite::M203() { } void GcodeSuite::M203_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_MAX_FEEDRATES)); #if NUM_AXES SERIAL_ECHOPGM_P( @@ -255,6 +261,8 @@ void GcodeSuite::M204() { } void GcodeSuite::M204_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_ACCELERATION_P_R_T)); SERIAL_ECHOLNPGM_P( PSTR(" M204 P"), LINEAR_UNIT(planner.settings.acceleration) @@ -329,6 +337,8 @@ void GcodeSuite::M205() { } void GcodeSuite::M205_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F( "Advanced (" M205_MIN_SEG_TIME_STR " S T" TERN_(HAS_JUNCTION_DEVIATION, " J") diff --git a/Marlin/src/gcode/config/M217.cpp b/Marlin/src/gcode/config/M217.cpp index 59737d3b04..df275c2d31 100644 --- a/Marlin/src/gcode/config/M217.cpp +++ b/Marlin/src/gcode/config/M217.cpp @@ -164,6 +164,8 @@ void GcodeSuite::M217() { } void GcodeSuite::M217_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_TOOL_CHANGING)); SERIAL_ECHOPGM(" M217"); diff --git a/Marlin/src/gcode/config/M218.cpp b/Marlin/src/gcode/config/M218.cpp index ff63dcaf34..006f9a1d2c 100644 --- a/Marlin/src/gcode/config/M218.cpp +++ b/Marlin/src/gcode/config/M218.cpp @@ -63,6 +63,8 @@ void GcodeSuite::M218() { } void GcodeSuite::M218_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_HOTEND_OFFSETS)); for (uint8_t e = 1; e < HOTENDS; ++e) { report_echo_start(forReplay); diff --git a/Marlin/src/gcode/config/M281.cpp b/Marlin/src/gcode/config/M281.cpp index 038a5d615a..24a179e54e 100644 --- a/Marlin/src/gcode/config/M281.cpp +++ b/Marlin/src/gcode/config/M281.cpp @@ -55,6 +55,8 @@ void GcodeSuite::M281() { } void GcodeSuite::M281_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_SERVO_ANGLES)); for (uint8_t i = 0; i < NUM_SERVOS; ++i) { switch (i) { diff --git a/Marlin/src/gcode/config/M301.cpp b/Marlin/src/gcode/config/M301.cpp index a3938acb11..fe0eef772f 100644 --- a/Marlin/src/gcode/config/M301.cpp +++ b/Marlin/src/gcode/config/M301.cpp @@ -78,6 +78,8 @@ void GcodeSuite::M301() { } void GcodeSuite::M301_report(const bool forReplay/*=true*/ E_OPTARG(const int8_t eindex/*=-1*/)) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading(forReplay, F(STR_HOTEND_PID)); IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr int8_t eindex = -1); HOTEND_LOOP() { diff --git a/Marlin/src/gcode/config/M302.cpp b/Marlin/src/gcode/config/M302.cpp index 3373e14325..0648f3edca 100644 --- a/Marlin/src/gcode/config/M302.cpp +++ b/Marlin/src/gcode/config/M302.cpp @@ -25,12 +25,13 @@ #if ENABLED(PREVENT_COLD_EXTRUSION) #include "../gcode.h" -#include "../../module/temperature.h" -#if ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extui/ui_api.h" #endif +#include "../../module/temperature.h" + /** * M302: Allow cold extrudes, or set the minimum extrude temperature * @@ -50,13 +51,14 @@ void GcodeSuite::M302() { const bool seen_S = parser.seen('S'); if (seen_S) { thermalManager.extrude_min_temp = parser.value_celsius(); - thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0); - TERN_(DWIN_LCD_PROUI, hmiData.extMinT = thermalManager.extrude_min_temp); + TERN_(EXTENSIBLE_UI, ExtUI::onSetMinExtrusionTemp(thermalManager.extrude_min_temp)); } - if (parser.seen('P')) - thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || parser.value_bool(); - else if (!seen_S) { + const bool seen_P = parser.seen('P'); + if (seen_P || seen_S) { + thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || (seen_P && parser.value_bool()); + } + else { // Report current state SERIAL_ECHO_START(); SERIAL_ECHOLN(F("Cold extrudes are "), thermalManager.allow_cold_extrude ? F("en") : F("dis"), F("abled (min temp "), thermalManager.extrude_min_temp, F("C)")); diff --git a/Marlin/src/gcode/config/M304.cpp b/Marlin/src/gcode/config/M304.cpp index a71a34c6de..8201730afd 100644 --- a/Marlin/src/gcode/config/M304.cpp +++ b/Marlin/src/gcode/config/M304.cpp @@ -42,6 +42,8 @@ void GcodeSuite::M304() { } void GcodeSuite::M304_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_BED_PID)); SERIAL_ECHOLNPGM(" M304" " P", thermalManager.temp_bed.pid.p() diff --git a/Marlin/src/gcode/config/M309.cpp b/Marlin/src/gcode/config/M309.cpp index 4953113041..033f5731ed 100644 --- a/Marlin/src/gcode/config/M309.cpp +++ b/Marlin/src/gcode/config/M309.cpp @@ -42,6 +42,8 @@ void GcodeSuite::M309() { } void GcodeSuite::M309_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_CHAMBER_PID)); SERIAL_ECHOLNPGM(" M309" " P", thermalManager.temp_chamber.pid.p() diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index 2f33be63a1..2a5eb30f55 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -96,6 +96,8 @@ void GcodeSuite::M92() { } void GcodeSuite::M92_report(const bool forReplay/*=true*/, const int8_t e/*=-1*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_STEPS_PER_UNIT)); #if NUM_AXES #define PRINT_EOL diff --git a/Marlin/src/gcode/control/M10-M11.cpp b/Marlin/src/gcode/control/M10_M11.cpp similarity index 95% rename from Marlin/src/gcode/control/M10-M11.cpp rename to Marlin/src/gcode/control/M10_M11.cpp index d5a69dcfcc..8fd299c546 100644 --- a/Marlin/src/gcode/control/M10-M11.cpp +++ b/Marlin/src/gcode/control/M10_M11.cpp @@ -20,6 +20,11 @@ * */ +/** + * gcode/control/M10_M11.cpp + * Air Evacuation + */ + #include "../../inc/MarlinConfig.h" #if ENABLED(AIR_EVACUATION) diff --git a/Marlin/src/gcode/control/M211.cpp b/Marlin/src/gcode/control/M211.cpp index 8e7d10ce65..471ca6c448 100644 --- a/Marlin/src/gcode/control/M211.cpp +++ b/Marlin/src/gcode/control/M211.cpp @@ -40,6 +40,8 @@ void GcodeSuite::M211() { } void GcodeSuite::M211_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_SOFT_ENDSTOPS)); SERIAL_ECHOPGM(" M211 S", AS_DIGIT(soft_endstop._enabled), " ; "); serialprintln_onoff(soft_endstop._enabled); diff --git a/Marlin/src/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index 13965cb72c..b995f208f5 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -79,7 +79,7 @@ void GcodeSuite::M42() { #ifdef OUTPUT_OPEN_DRAIN case 5: pinMode(pin, OUTPUT_OPEN_DRAIN); break; #endif - default: SERIAL_ECHOLNPGM("Invalid Pin Mode"); return; + default: SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Invalid Pin Mode")); return; } } @@ -94,7 +94,7 @@ void GcodeSuite::M42() { #endif if (avoidWrite) { - SERIAL_ECHOLNPGM("?Cannot write to INPUT"); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Cannot write to INPUT")); return; } diff --git a/Marlin/src/gcode/control/M85.cpp b/Marlin/src/gcode/control/M85.cpp index ee868349ed..7846315413 100644 --- a/Marlin/src/gcode/control/M85.cpp +++ b/Marlin/src/gcode/control/M85.cpp @@ -32,11 +32,16 @@ void GcodeSuite::M85() { 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."); + SERIAL_ECHO_MSG(GCODE_ERR_MSG("M85 timeout must be > ", MS_TO_SEC(LASER_SAFETY_TIMEOUT_MS + 999), " s for laser safety.")); return; } #endif max_inactive_time = ms; } + else { + #if DISABLED(MARLIN_SMALL_BUILD) + SERIAL_ECHOLNPGM("Inactivity timeout ", MS_TO_SEC(max_inactive_time), " s."); + #endif + } } diff --git a/Marlin/src/gcode/control/M997.cpp b/Marlin/src/gcode/control/M997.cpp index 5ac0ba23bb..c651961902 100644 --- a/Marlin/src/gcode/control/M997.cpp +++ b/Marlin/src/gcode/control/M997.cpp @@ -24,8 +24,8 @@ #if ENABLED(PLATFORM_M997_SUPPORT) -#if ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extui/ui_api.h" #endif /** @@ -33,7 +33,7 @@ */ void GcodeSuite::M997() { - TERN_(DWIN_LCD_PROUI, dwinRebootScreen()); + TERN_(EXTENSIBLE_UI, ExtUI::onFirmwareFlash()); flashFirmware(parser.intval('S')); diff --git a/Marlin/src/gcode/feature/advance/M900.cpp b/Marlin/src/gcode/feature/advance/M900.cpp index 5fa9c04dbd..e8a16d952f 100644 --- a/Marlin/src/gcode/feature/advance/M900.cpp +++ b/Marlin/src/gcode/feature/advance/M900.cpp @@ -141,6 +141,8 @@ void GcodeSuite::M900() { } void GcodeSuite::M900_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading(forReplay, F(STR_LINEAR_ADVANCE)); #if DISTINCT_E < 2 report_echo_start(forReplay); diff --git a/Marlin/src/gcode/feature/controllerfan/M710.cpp b/Marlin/src/gcode/feature/controllerfan/M710.cpp index b98d88845d..c8b5efa8cb 100644 --- a/Marlin/src/gcode/feature/controllerfan/M710.cpp +++ b/Marlin/src/gcode/feature/controllerfan/M710.cpp @@ -67,6 +67,8 @@ void GcodeSuite::M710() { } void GcodeSuite::M710_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_CONTROLLER_FAN)); SERIAL_ECHOLNPGM(" M710" " S", int(controllerFan.settings.active_speed), diff --git a/Marlin/src/gcode/feature/digipot/M907-M910.cpp b/Marlin/src/gcode/feature/digipot/M907-M910.cpp index 8869f8d494..ab1c316705 100644 --- a/Marlin/src/gcode/feature/digipot/M907-M910.cpp +++ b/Marlin/src/gcode/feature/digipot/M907-M910.cpp @@ -68,7 +68,7 @@ void GcodeSuite::M907() { #define HAS_X_Y_XY_I_J_K_U_V_W 1 #endif - #if HAS_X_Y_XY_I_J_K_U_V_W || ANY_PIN(MOTOR_CURRENT_PWM_E, MOTOR_CURRENT_PWM_Z) + #if HAS_X_Y_XY_I_J_K_U_V_W || HAS_MOTOR_CURRENT_PWM_E || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) if (!parser.seen("S" #if HAS_X_Y_XY_I_J_K_U_V_W @@ -77,7 +77,7 @@ void GcodeSuite::M907() { #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) "Z" #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) + #if HAS_MOTOR_CURRENT_PWM_E "E" #endif )) return M907_report(); @@ -94,7 +94,7 @@ void GcodeSuite::M907() { #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) if (parser.seenval('Z')) stepper.set_digipot_current(1, parser.value_int()); #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) + #if HAS_MOTOR_CURRENT_PWM_E if (parser.seenval('E')) stepper.set_digipot_current(2, parser.value_int()); #endif @@ -126,12 +126,16 @@ void GcodeSuite::M907() { #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM void GcodeSuite::M907_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_STEPPER_MOTOR_CURRENTS)); #if HAS_MOTOR_CURRENT_PWM SERIAL_ECHOLNPGM_P( // PWM-based has 3 values: PSTR(" M907 X"), stepper.motor_current_setting[0] // X, Y, (I, J, K, U, V, W) , SP_Z_STR, stepper.motor_current_setting[1] // Z - , SP_E_STR, stepper.motor_current_setting[2] // E + #if HAS_MOTOR_CURRENT_PWM_E + , SP_E_STR, stepper.motor_current_setting[2] // E + #endif ); #elif HAS_MOTOR_CURRENT_SPI SERIAL_ECHOPGM(" M907"); // SPI-based has 5 values: diff --git a/Marlin/src/gcode/feature/ft_motion/M493.cpp b/Marlin/src/gcode/feature/ft_motion/M493.cpp index 64d57118a0..2da92b8582 100644 --- a/Marlin/src/gcode/feature/ft_motion/M493.cpp +++ b/Marlin/src/gcode/feature/ft_motion/M493.cpp @@ -104,6 +104,8 @@ void say_shaping() { } void GcodeSuite::M493_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_FT_MOTION)); const ft_config_t &c = ftMotion.cfg; SERIAL_ECHOPGM(" M493 S", c.mode); diff --git a/Marlin/src/gcode/feature/fwretract/M207-M209.cpp b/Marlin/src/gcode/feature/fwretract/M207-M209.cpp index 173c2894dc..2d198b7ade 100644 --- a/Marlin/src/gcode/feature/fwretract/M207-M209.cpp +++ b/Marlin/src/gcode/feature/fwretract/M207-M209.cpp @@ -38,6 +38,8 @@ void GcodeSuite::M207() { fwretract.M207(); } void GcodeSuite::M207_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_RETRACT_S_F_Z)); fwretract.M207_report(); } @@ -53,6 +55,8 @@ void GcodeSuite::M207_report(const bool forReplay/*=true*/) { void GcodeSuite::M208() { fwretract.M208(); } void GcodeSuite::M208_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_RECOVER_S_F)); fwretract.M208_report(); } @@ -68,6 +72,8 @@ void GcodeSuite::M208_report(const bool forReplay/*=true*/) { void GcodeSuite::M209() { fwretract.M209(); } void GcodeSuite::M209_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_AUTO_RETRACT_S)); fwretract.M209_report(); } diff --git a/Marlin/src/gcode/feature/input_shaping/M593.cpp b/Marlin/src/gcode/feature/input_shaping/M593.cpp index 1b6a43f9dd..6ce942e4ee 100644 --- a/Marlin/src/gcode/feature/input_shaping/M593.cpp +++ b/Marlin/src/gcode/feature/input_shaping/M593.cpp @@ -28,6 +28,8 @@ #include "../../../module/stepper.h" void GcodeSuite::M593_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F("Input Shaping")); #if ENABLED(INPUT_SHAPING_X) SERIAL_ECHOLNPGM(" M593 X" @@ -42,6 +44,15 @@ void GcodeSuite::M593_report(const bool forReplay/*=true*/) { " D", stepper.get_shaping_damping_ratio(Y_AXIS) ); #endif + #if ENABLED(INPUT_SHAPING_Z) + #if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y) + report_echo_start(forReplay); + #endif + SERIAL_ECHOLNPGM(" M593 Z" + " F", stepper.get_shaping_frequency(Z_AXIS), + " D", stepper.get_shaping_damping_ratio(Z_AXIS) + ); + #endif } /** @@ -57,14 +68,17 @@ void GcodeSuite::M593() { const bool seen_X = TERN0(INPUT_SHAPING_X, parser.seen_test('X')), seen_Y = TERN0(INPUT_SHAPING_Y, parser.seen_test('Y')), - for_X = seen_X || TERN0(INPUT_SHAPING_X, (!seen_X && !seen_Y)), - for_Y = seen_Y || TERN0(INPUT_SHAPING_Y, (!seen_X && !seen_Y)); + seen_Z = TERN0(INPUT_SHAPING_Z, parser.seen_test('Z')), + for_X = seen_X || TERN0(INPUT_SHAPING_X, (!seen_X && !seen_Y && !seen_Z)), + for_Y = seen_Y || TERN0(INPUT_SHAPING_Y, (!seen_X && !seen_Y && !seen_Z)), + for_Z = seen_Z || TERN0(INPUT_SHAPING_Z, (!seen_X && !seen_Y && !seen_Z)); if (parser.seen('D')) { const float zeta = parser.value_float(); if (WITHIN(zeta, 0, 1)) { if (for_X) stepper.set_shaping_damping_ratio(X_AXIS, zeta); if (for_Y) stepper.set_shaping_damping_ratio(Y_AXIS, zeta); + if (for_Z) stepper.set_shaping_damping_ratio(Z_AXIS, zeta); } else SERIAL_ECHO_MSG("?Zeta (D) value out of range (0-1)"); @@ -76,9 +90,10 @@ void GcodeSuite::M593() { if (freq == 0.0f || freq > min_freq) { if (for_X) stepper.set_shaping_frequency(X_AXIS, freq); if (for_Y) stepper.set_shaping_frequency(Y_AXIS, freq); + if (for_Z) stepper.set_shaping_frequency(Z_AXIS, freq); } else - SERIAL_ECHOLNPGM("?Frequency (F) must be greater than ", min_freq, " or 0 to disable"); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Frequency (F) must be greater than ", min_freq, " or 0 to disable")); } } diff --git a/Marlin/src/gcode/feature/leds/M150.cpp b/Marlin/src/gcode/feature/leds/M150.cpp index 43062c3f75..dd5752ee4c 100644 --- a/Marlin/src/gcode/feature/leds/M150.cpp +++ b/Marlin/src/gcode/feature/leds/M150.cpp @@ -60,6 +60,7 @@ void GcodeSuite::M150() { #if ENABLED(NEOPIXEL_LED) const pixel_index_t index = parser.intval('I', -1); + const bool seenK = parser.seen_test('K'); #if ENABLED(NEOPIXEL2_SEPARATE) #ifndef NEOPIXEL_M150_DEFAULT #define NEOPIXEL_M150_DEFAULT -1 @@ -69,12 +70,13 @@ void GcodeSuite::M150() { int8_t brightness = neo.brightness(), unit = parser.intval('S', NEOPIXEL_M150_DEFAULT); switch (unit) { case -1: neo2.neoindex = index; // fall-thru - case 0: neo.neoindex = index; old_color = parser.seen('K') ? neo.pixel_color(index >= 0 ? index : 0) : 0; break; - case 1: neo2.neoindex = index; brightness = neo2.brightness(); old_color = parser.seen('K') ? neo2.pixel_color(index >= 0 ? index : 0) : 0; break; + case 0: neo.neoindex = index; old_color = seenK ? neo.pixel_color(_MAX(index, 0)) : 0; break; + case 1: neo2.neoindex = index; brightness = neo2.brightness(); old_color = seenK ? neo2.pixel_color(_MAX(index, 0)) : 0; break; } #else const uint8_t brightness = neo.brightness(); neo.neoindex = index; + old_color = seenK ? neo.pixel_color(_MAX(index, 0)) : 0; #endif #endif diff --git a/Marlin/src/gcode/feature/network/M552-M554.cpp b/Marlin/src/gcode/feature/network/M552-M554.cpp index 7633ec1fd5..9a09a973c8 100644 --- a/Marlin/src/gcode/feature/network/M552-M554.cpp +++ b/Marlin/src/gcode/feature/network/M552-M554.cpp @@ -97,6 +97,7 @@ void GcodeSuite::M552() { } void GcodeSuite::M552_report() { + TERN_(MARLIN_SMALL_BUILD, return); ip_report(552, F("ip address"), Ethernet.linkStatus() == LinkON ? Ethernet.localIP() : ethernet.ip); } @@ -111,6 +112,7 @@ void GcodeSuite::M553() { } void GcodeSuite::M553_report() { + TERN_(MARLIN_SMALL_BUILD, return); ip_report(553, F("subnet mask"), Ethernet.linkStatus() == LinkON ? Ethernet.subnetMask() : ethernet.subnet); } @@ -125,6 +127,7 @@ void GcodeSuite::M554() { } void GcodeSuite::M554_report() { + TERN_(MARLIN_SMALL_BUILD, return); ip_report(554, F("gateway"), Ethernet.linkStatus() == LinkON ? Ethernet.gatewayIP() : ethernet.gateway); } diff --git a/Marlin/src/gcode/feature/nonlinear/M592.cpp b/Marlin/src/gcode/feature/nonlinear/M592.cpp index dc8c1e1e58..b1c4ca4be7 100644 --- a/Marlin/src/gcode/feature/nonlinear/M592.cpp +++ b/Marlin/src/gcode/feature/nonlinear/M592.cpp @@ -28,8 +28,9 @@ #include "../../../module/stepper.h" void GcodeSuite::M592_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); report_heading(forReplay, F(STR_NONLINEAR_EXTRUSION)); - SERIAL_ECHOLNPGM(" M593 A", stepper.ne.A, " B", stepper.ne.B, " C", stepper.ne.C); + SERIAL_ECHOLNPGM(" M592 A", stepper.ne.A, " B", stepper.ne.B, " C", stepper.ne.C); } /** @@ -43,6 +44,8 @@ void GcodeSuite::M592_report(const bool forReplay/*=true*/) { * Only adjusts forward extrusions, since those are the ones affected by backpressure. */ void GcodeSuite::M592() { + if (!parser.seen_any()) return M592_report(); + if (parser.seenval('A')) stepper.ne.A = parser.value_float(); if (parser.seenval('B')) stepper.ne.B = parser.value_float(); if (parser.seenval('C')) stepper.ne.C = parser.value_float(); diff --git a/Marlin/src/gcode/feature/pause/M603.cpp b/Marlin/src/gcode/feature/pause/M603.cpp index 0204ab25ef..fcc042f58e 100644 --- a/Marlin/src/gcode/feature/pause/M603.cpp +++ b/Marlin/src/gcode/feature/pause/M603.cpp @@ -61,6 +61,8 @@ void GcodeSuite::M603() { } void GcodeSuite::M603_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading(forReplay, F(STR_FILAMENT_LOAD_UNLOAD)); #if EXTRUDERS == 1 diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp index c735b72ced..c70bf7667f 100644 --- a/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -37,8 +37,6 @@ #include "../../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD) #include "../../../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../../lcd/e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "../../../lcd/e3v2/jyersui/dwin.h" // Temporary fix until it can be better implemented #endif @@ -76,12 +74,12 @@ void GcodeSuite::M1000() { if (!force_resume && parser.seen_test('S')) { #if HAS_MARLINUI_MENU ui.goto_screen(menu_job_recovery); - #elif HAS_DWIN_E3V2_BASIC - recovery.dwin_flag = true; - #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) // Temporary fix until it can be better implemented - jyersDWIN.popupHandler(Popup_Resume); #elif ENABLED(EXTENSIBLE_UI) ExtUI::onPowerLossResume(); + #elif HAS_PLR_UI_FLAG + recovery.ui_flag_resume = true; + #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) // Temporary fix until it can be better implemented + jyersDWIN.popupHandler(Popup_Resume); #else SERIAL_ECHO_MSG("Resume requires LCD."); #endif diff --git a/Marlin/src/gcode/feature/powerloss/M413.cpp b/Marlin/src/gcode/feature/powerloss/M413.cpp index 8cbe468476..b12257b4e5 100644 --- a/Marlin/src/gcode/feature/powerloss/M413.cpp +++ b/Marlin/src/gcode/feature/powerloss/M413.cpp @@ -64,12 +64,15 @@ void GcodeSuite::M413() { } void GcodeSuite::M413_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_POWER_LOSS_RECOVERY)); SERIAL_ECHOPGM(" M413 S", AS_DIGIT(recovery.enabled) #if HAS_PLR_BED_THRESHOLD , " B", recovery.bed_temp_threshold #endif ); + SERIAL_ECHO(" ; "); serialprintln_onoff(recovery.enabled); } diff --git a/Marlin/src/gcode/feature/runout/M412.cpp b/Marlin/src/gcode/feature/runout/M412.cpp index 4b4ab6a68a..4cfb238309 100644 --- a/Marlin/src/gcode/feature/runout/M412.cpp +++ b/Marlin/src/gcode/feature/runout/M412.cpp @@ -67,6 +67,8 @@ void GcodeSuite::M412() { } void GcodeSuite::M412_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_FILAMENT_RUNOUT_SENSOR)); SERIAL_ECHOPGM( " M412 S", runout.enabled diff --git a/Marlin/src/gcode/feature/trinamic/M569.cpp b/Marlin/src/gcode/feature/trinamic/M569.cpp index b4e6a13c52..06a4992ceb 100644 --- a/Marlin/src/gcode/feature/trinamic/M569.cpp +++ b/Marlin/src/gcode/feature/trinamic/M569.cpp @@ -155,6 +155,8 @@ void GcodeSuite::M569() { } void GcodeSuite::M569_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading(forReplay, F(STR_DRIVER_STEPPING_MODE)); auto say_M569 = [](const bool forReplay, FSTR_P const etc=nullptr, const bool eol=false) { diff --git a/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin/src/gcode/feature/trinamic/M906.cpp index b949200ad7..c0dc456a8a 100644 --- a/Marlin/src/gcode/feature/trinamic/M906.cpp +++ b/Marlin/src/gcode/feature/trinamic/M906.cpp @@ -231,6 +231,8 @@ void GcodeSuite::M906() { } void GcodeSuite::M906_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading(forReplay, F(STR_STEPPER_DRIVER_CURRENT)); auto say_M906 = [](const bool forReplay) { diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp index fa1cc1227c..ba6d9538a4 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp @@ -378,6 +378,8 @@ } void GcodeSuite::M913_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading(forReplay, F(STR_HYBRID_THRESHOLD)); auto say_M913 = [](const bool forReplay) { @@ -565,6 +567,8 @@ } void GcodeSuite::M914_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading(forReplay, F(STR_STALLGUARD_THRESHOLD)); auto say_M914 = [](const bool forReplay) { diff --git a/Marlin/src/gcode/feature/trinamic/M919.cpp b/Marlin/src/gcode/feature/trinamic/M919.cpp index 4ee004291d..98227c7125 100644 --- a/Marlin/src/gcode/feature/trinamic/M919.cpp +++ b/Marlin/src/gcode/feature/trinamic/M919.cpp @@ -64,7 +64,7 @@ void GcodeSuite::M919() { if (WITHIN(toff, 1, 15)) DEBUG_ECHOLNPGM(".toff: ", toff); else { - SERIAL_ECHOLNPGM("?O out of range (1..15)"); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("O out of range (1..15)")); err = true; } } @@ -74,7 +74,7 @@ void GcodeSuite::M919() { if (WITHIN(hend, -3, 12)) DEBUG_ECHOLNPGM(".hend: ", hend); else { - SERIAL_ECHOLNPGM("?P out of range (-3..12)"); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("P out of range (-3..12)")); err = true; } } @@ -84,7 +84,7 @@ void GcodeSuite::M919() { if (WITHIN(hstrt, 1, 8)) DEBUG_ECHOLNPGM(".hstrt: ", hstrt); else { - SERIAL_ECHOLNPGM("?S out of range (1..8)"); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("S out of range (1..8)")); err = true; } } @@ -118,7 +118,7 @@ void GcodeSuite::M919() { // Get the chopper timing for the specified axis and index switch (i) { default: // A specified axis isn't Trinamic - SERIAL_ECHOLNPGM("?Axis ", C(AXIS_CHAR(i)), " has no TMC drivers."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Axis ", C(AXIS_CHAR(i)), " has no TMC drivers.")); break; #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 7a72097141..1e3ec7c7f1 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -143,7 +143,7 @@ * R Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. ** * If AUTOTEMP is enabled, S B F. Exit autotemp by any M109 without F * - * M110 - Set the current line number. (Used by host printing) + * M110 - Get or set the current line number. (Used by host printing) * M111 - Set debug flags: "M111 S". See flag bits defined in enum.h. * M112 - Full Shutdown. * @@ -341,6 +341,12 @@ #define HAS_FAST_MOVES 1 #endif +#if ENABLED(MARLIN_SMALL_BUILD) + #define GCODE_ERR_MSG(V...) "?" +#else + #define GCODE_ERR_MSG(V...) "?" V +#endif + enum AxisRelative : uint8_t { LOGICAL_AXIS_LIST(REL_E, REL_X, REL_Y, REL_Z, REL_I, REL_J, REL_K, REL_U, REL_V, REL_W) #if HAS_EXTRUDERS diff --git a/Marlin/src/gcode/geometry/G92.cpp b/Marlin/src/gcode/geometry/G92.cpp index 626441f4e2..cfdff51eba 100644 --- a/Marlin/src/gcode/geometry/G92.cpp +++ b/Marlin/src/gcode/geometry/G92.cpp @@ -42,7 +42,7 @@ * G92 : Modify Workspace Offsets so the reported position shows the given X [Y [Z [A [B [C [U [V [W ]]]]]]]] [E]. * G92.1 : Zero XYZ Workspace Offsets (so the reported position = the native position). * - * With POWER_LOSS_RECOVERY: + * With POWER_LOSS_RECOVERY or with AXISn_ROTATES: * G92.9 : Set NATIVE Current Position to the given X [Y [Z [A [B [C [U [V [W ]]]]]]]] [E]. */ void GcodeSuite::G92() { @@ -67,7 +67,7 @@ void GcodeSuite::G92() { break; #endif - #if ENABLED(POWER_LOSS_RECOVERY) + #if ANY(POWER_LOSS_RECOVERY, HAS_ROTATIONAL_AXES) case 9: // G92.9 - Set Current Position directly (like Marlin 1.0) LOOP_LOGICAL_AXES(i) { if (parser.seenval(AXIS_CHAR(i))) { diff --git a/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin/src/gcode/geometry/M206_M428.cpp index 7017eabbdc..dcf19625be 100644 --- a/Marlin/src/gcode/geometry/M206_M428.cpp +++ b/Marlin/src/gcode/geometry/M206_M428.cpp @@ -48,6 +48,8 @@ void GcodeSuite::M206() { } void GcodeSuite::M206_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_HOME_OFFSET)); SERIAL_ECHOLNPGM_P( #if IS_CARTESIAN diff --git a/Marlin/src/gcode/host/M110.cpp b/Marlin/src/gcode/host/M110.cpp index 2634b19897..c2655dfd20 100644 --- a/Marlin/src/gcode/host/M110.cpp +++ b/Marlin/src/gcode/host/M110.cpp @@ -24,11 +24,19 @@ #include "../queue.h" // for last_N /** - * M110: Set Current Line Number + * M110: Get or set Current Line Number + * + * Parameters: + * N Number to set as last-processed command + * + * Without parameters: + * Report the last-processed (not last-received or last-enqueued) command + * (To purge the queue and resume from this line, the host should use 'M999' instead.) */ void GcodeSuite::M110() { if (parser.seenval('N')) queue.set_current_line_number(parser.value_long()); - + else + SERIAL_ECHOLNPGM(STR_LINE_NO, queue.get_current_line_number()); } diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index 979764f75e..2a46de9c86 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -29,19 +29,17 @@ #if ENABLED(M114_DETAIL) void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=LOGICAL_AXES, const uint8_t precision=3) { - char str[12]; for (uint8_t a = 0; a < n; ++a) { SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a])); if (pos[a] >= 0) SERIAL_CHAR(' '); - SERIAL_ECHO(dtostrf(pos[a], 1, precision, str)); + SERIAL_ECHO(p_float_t(pos[a], precision)); } SERIAL_EOL(); } inline void report_linear_axis_pos(const xyze_pos_t &pos) { report_all_axis_pos(pos, XYZ); } void report_linear_axis_pos(const xyz_pos_t &pos, const uint8_t precision=3) { - char str[12]; - LOOP_NUM_AXES(a) SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[a]), dtostrf(pos[a], 1, precision, str)); + LOOP_NUM_AXES(a) SERIAL_ECHO(FPSTR(pgm_read_ptr(&SP_AXIS_LBL[a])), p_float_t(pos[a], precision)); SERIAL_EOL(); } diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index d1571d58ac..0d38d3147b 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -35,7 +35,7 @@ #include "../../feature/caselight.h" #endif -#if ENABLED(HAS_STM32_UID) && !defined(MACHINE_UUID) +#if !defined(MACHINE_UUID) && ENABLED(HAS_STM32_UID) #include "../../libs/hex_print.h" #endif @@ -62,33 +62,56 @@ * at https://reprap.org/wiki/Firmware_Capabilities_Protocol */ void GcodeSuite::M115() { + + // Hosts should match one of these + #define MACHINE_KINEMATICS "" \ + TERN_(COREXY, "COREXY") TERN_(COREYX, "COREYX") \ + TERN_(COREXZ, "COREXZ") TERN_(COREZX, "COREZX") \ + TERN_(COREYZ, "COREYZ") TERN_(COREZY, "COREZY") \ + TERN_(MARKFORGED_XY, "MARKFORGED_XY") TERN_(MARKFORGED_YX, "MARKFORGED_YX") \ + TERN_(POLARGRAPH, "POLARGRAPH") \ + TERN_(POLAR, "POLAR") \ + TERN_(DELTA, "DELTA") \ + TERN_(IS_SCARA, "SCARA") \ + TERN_(IS_CARTESIAN, "Cartesian") \ + TERN_(BELTPRINTER, " BELTPRINTER") + SERIAL_ECHOPGM("FIRMWARE_NAME:Marlin" " " DETAILED_BUILD_VERSION " (" __DATE__ " " __TIME__ ")" " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME + " KINEMATICS:" MACHINE_KINEMATICS " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) #if NUM_AXES != XYZ " AXIS_COUNT:" STRINGIFY(NUM_AXES) #endif + #if defined(MACHINE_UUID) || ENABLED(HAS_STM32_UID) + " UUID:" + #endif #ifdef MACHINE_UUID - " UUID:" MACHINE_UUID + MACHINE_UUID #endif ); - // STM32UID:111122223333 - #if ENABLED(HAS_STM32_UID) && !defined(MACHINE_UUID) - // STM32 based devices output the CPU device serial number - // Used by LumenPnP / OpenPNP to keep track of unique hardware/configurations - // https://github.com/opulo-inc/lumenpnp - // Although this code should work on all STM32 based boards - SERIAL_ECHOPGM(" UUID:"); - uint32_t *uid_address = (uint32_t*)UID_BASE; - for (uint8_t i = 0; i < 3; ++i) { - const uint32_t UID = uint32_t(READ_REG(*(uid_address))); - uid_address += 4U; - for (int B = 24; B >= 0; B -= 8) print_hex_byte(UID >> B); - } + #if !defined(MACHINE_UUID) && ENABLED(HAS_STM32_UID) + /** + * STM32-based devices have a 96-bit CPU device serial number. + * Used by LumenPnP / OpenPNP to keep track of unique hardware/configurations. + * https://github.com/opulo-inc/lumenpnp + * This code should work on all STM32-based boards. + */ + #if ENABLED(STM32_UID_SHORT_FORM) + const uint32_t * const UID = (uint32_t*)UID_BASE; + for (uint8_t i = 0; i < 3; i++) print_hex_long(UID[i]); + #else + const uint16_t * const UID = (uint16_t*)UID_BASE; // Little-endian! + SERIAL_ECHO(F("CEDE2A2F-")); + for (uint8_t i = 1; i <= 6; i++) { + print_hex_word(UID[(i % 2) ? i : i - 2]); // 1111-0000-3333-222255554444 + if (i <= 3) SERIAL_ECHO(C('-')); + } + #endif #endif SERIAL_EOL(); diff --git a/Marlin/src/gcode/host/M360.cpp b/Marlin/src/gcode/host/M360.cpp index 3986200e08..8d6bb4771a 100644 --- a/Marlin/src/gcode/host/M360.cpp +++ b/Marlin/src/gcode/host/M360.cpp @@ -182,7 +182,11 @@ void GcodeSuite::M360() { config_line(F("NumExtruder"), EXTRUDERS); #if HAS_EXTRUDERS EXTRUDER_LOOP() { - config_line_e(e, JERK_STR, TERN(HAS_LINEAR_E_JERK, planner.max_e_jerk[E_INDEX_N(e)], TERN(CLASSIC_JERK, planner.max_jerk.e, DEFAULT_EJERK))); + #if HAS_LINEAR_E_JERK + config_line_e(e, JERK_STR, planner.max_e_jerk[E_INDEX_N(e)]); + #elif ENABLED(CLASSIC_JERK) + config_line_e(e, JERK_STR, planner.max_jerk.e); + #endif config_line_e(e, F("MaxSpeed"), planner.settings.max_feedrate_mm_s[E_AXIS_N(e)]); config_line_e(e, F("Acceleration"), planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(e)]); config_line_e(e, F("Diameter"), TERN(NO_VOLUMETRICS, DEFAULT_NOMINAL_FILAMENT_DIA, planner.filament_size[e])); diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index fcab61b59d..c600bd5da6 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -35,9 +35,6 @@ #include "../../lcd/marlinui.h" #elif ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin_popup.h" - #include "../../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(HOST_PROMPT_SUPPORT) @@ -66,16 +63,20 @@ void GcodeSuite::M0_M1() { #endif } + #elif ENABLED(DWIN_LCD_PROUI) // ExtUI with icon, string, button title + + if (parser.string_arg) + ExtUI::onUserConfirmRequired(ICON_Continue_1, parser.string_arg, GET_TEXT_F(MSG_USERWAIT)); + else + ExtUI::onUserConfirmRequired(ICON_Stop_1, GET_TEXT_F(MSG_STOPPED), GET_TEXT_F(MSG_USERWAIT)); + #elif ENABLED(EXTENSIBLE_UI) + if (parser.string_arg) ExtUI::onUserConfirmRequired(parser.string_arg); // String in an SRAM buffer else ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_USERWAIT)); - #elif ENABLED(DWIN_LCD_PROUI) - if (parser.string_arg) - dwinPopupConfirm(ICON_BLTouch, parser.string_arg, GET_TEXT_F(MSG_USERWAIT)); - else - dwinPopupConfirm(ICON_BLTouch, GET_TEXT_F(MSG_STOPPED), GET_TEXT_F(MSG_USERWAIT)); + #else if (parser.string_arg) { diff --git a/Marlin/src/gcode/lcd/M145.cpp b/Marlin/src/gcode/lcd/M145.cpp index d72d5d6789..3cc6130dfd 100644 --- a/Marlin/src/gcode/lcd/M145.cpp +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -61,6 +61,8 @@ void GcodeSuite::M145() { } void GcodeSuite::M145_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading(forReplay, F(STR_MATERIAL_HEATUP)); for (uint8_t i = 0; i < PREHEAT_COUNT; ++i) { report_echo_start(forReplay); diff --git a/Marlin/src/gcode/lcd/M250.cpp b/Marlin/src/gcode/lcd/M250.cpp index 58b6dac872..40c39edd1c 100644 --- a/Marlin/src/gcode/lcd/M250.cpp +++ b/Marlin/src/gcode/lcd/M250.cpp @@ -38,6 +38,7 @@ void GcodeSuite::M250() { } void GcodeSuite::M250_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); report_heading_etc(forReplay, F(STR_LCD_CONTRAST)); SERIAL_ECHOLNPGM(" M250 C", ui.contrast); } diff --git a/Marlin/src/gcode/lcd/M255.cpp b/Marlin/src/gcode/lcd/M255.cpp index 2b982ee5d9..e8213f3fd8 100644 --- a/Marlin/src/gcode/lcd/M255.cpp +++ b/Marlin/src/gcode/lcd/M255.cpp @@ -44,6 +44,7 @@ void GcodeSuite::M255() { } void GcodeSuite::M255_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); report_heading_etc(forReplay, F(STR_DISPLAY_SLEEP)); SERIAL_ECHOLNPGM(" M255 S", TERN(HAS_DISPLAY_SLEEP, ui.sleep_timeout_minutes, ui.backlight_timeout_minutes), diff --git a/Marlin/src/gcode/lcd/M256.cpp b/Marlin/src/gcode/lcd/M256.cpp index 9842cc2583..647aec4ff5 100644 --- a/Marlin/src/gcode/lcd/M256.cpp +++ b/Marlin/src/gcode/lcd/M256.cpp @@ -37,6 +37,7 @@ void GcodeSuite::M256() { } void GcodeSuite::M256_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); report_heading_etc(forReplay, F(STR_LCD_BRIGHTNESS)); SERIAL_ECHOLNPGM(" M256 B", ui.brightness); } diff --git a/Marlin/src/gcode/lcd/M414.cpp b/Marlin/src/gcode/lcd/M414.cpp index 9aa49ea3c2..4b961ad8ca 100644 --- a/Marlin/src/gcode/lcd/M414.cpp +++ b/Marlin/src/gcode/lcd/M414.cpp @@ -44,6 +44,7 @@ void GcodeSuite::M414() { } void GcodeSuite::M414_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); report_heading_etc(forReplay, F(STR_UI_LANGUAGE)); SERIAL_ECHOLNPGM(" M414 S", ui.language); } diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index 5ac2839beb..6f74476240 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -29,10 +29,6 @@ #include "../../sd/cardreader.h" #include "../../libs/numtostr.h" -#if ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/e3v2/proui/dwin.h" -#endif - /** * M73: Set percentage complete (for display on LCD) * diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 5d162c0a41..94c5b284e0 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -288,6 +288,17 @@ public: // Bool is true with no value or non-zero static bool value_bool() { return !has_value() || !!value_byte(); } + static constexpr bool axis_is_rotational(const AxisEnum axis) { + return (false + || TERN0(AXIS4_ROTATES, axis == I_AXIS) + || TERN0(AXIS5_ROTATES, axis == J_AXIS) + || TERN0(AXIS6_ROTATES, axis == K_AXIS) + || TERN0(AXIS7_ROTATES, axis == U_AXIS) + || TERN0(AXIS8_ROTATES, axis == V_AXIS) + || TERN0(AXIS9_ROTATES, axis == W_AXIS) + ); + } + // Units modes: Inches, Fahrenheit, Kelvin #if ENABLED(INCH_MODE_SUPPORT) @@ -307,14 +318,7 @@ public: } static float axis_unit_factor(const AxisEnum axis) { - if (false - || TERN0(AXIS4_ROTATES, axis == I_AXIS) - || TERN0(AXIS5_ROTATES, axis == J_AXIS) - || TERN0(AXIS6_ROTATES, axis == K_AXIS) - || TERN0(AXIS7_ROTATES, axis == U_AXIS) - || TERN0(AXIS8_ROTATES, axis == V_AXIS) - || TERN0(AXIS9_ROTATES, axis == W_AXIS) - ) return 1.0f; + if (axis_is_rotational(axis)) return 1.0f; #if HAS_EXTRUDERS if (axis >= E_AXIS && volumetric_enabled) return volumetric_unit_factor; #endif @@ -327,12 +331,12 @@ public: #else - static float mm_to_linear_unit(const_float_t mm) { return mm; } - static float mm_to_volumetric_unit(const_float_t mm) { return mm; } + static constexpr float mm_to_linear_unit(const_float_t mm) { return mm; } + static constexpr float mm_to_volumetric_unit(const_float_t mm) { return mm; } - static float linear_value_to_mm(const_float_t v) { return v; } - static float axis_value_to_mm(const AxisEnum, const float v) { return v; } - static float per_axis_value(const AxisEnum, const float v) { return v; } + static constexpr float linear_value_to_mm(const_float_t v) { return v; } + static constexpr float axis_value_to_mm(const AxisEnum, const float v) { return v; } + static constexpr float per_axis_value(const AxisEnum, const float v) { return v; } #endif @@ -402,7 +406,7 @@ public: #else // !TEMPERATURE_UNITS_SUPPORT - static float to_temp_units(int16_t c) { return (float)c; } + static constexpr float to_temp_units(int16_t c) { return (float)c; } static celsius_t value_celsius() { return value_int(); } static celsius_t value_celsius_diff() { return value_int(); } diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index e83df544c8..3ce37bed05 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -34,6 +34,10 @@ #include "../../feature/probe_temp_comp.h" #endif +#if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) + #define VERBOSE_SINGLE_PROBE +#endif + /** * G30: Do a single Z probe at the given XY (default: current) * @@ -66,9 +70,7 @@ void GcodeSuite::G30() { remember_feedrate_scaling_off(); - #if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) - process_subcommands_now(F("G28O")); - #endif + TERN_(VERBOSE_SINGLE_PROBE, process_subcommands_now(F("G28O"))); const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE; @@ -83,9 +85,7 @@ void GcodeSuite::G30() { F( " Z:"), p_float_t(measured_z, 3) ); msg.echoln(); - #if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) - ui.set_status(msg); - #endif + TERN_(VERBOSE_SINGLE_PROBE, ui.set_status(msg)); } restore_feedrate_and_scaling(); diff --git a/Marlin/src/gcode/probe/G38.cpp b/Marlin/src/gcode/probe/G38.cpp index 1f22cc84ed..d57eb9b59e 100644 --- a/Marlin/src/gcode/probe/G38.cpp +++ b/Marlin/src/gcode/probe/G38.cpp @@ -55,7 +55,7 @@ inline bool G38_run_probe() { } #endif - planner.synchronize(); // wait until the machine is idle + planner.synchronize(); // Wait until the machine is idle // Move flag value #if ENABLED(G38_PROBE_AWAY) diff --git a/Marlin/src/gcode/probe/M423.cpp b/Marlin/src/gcode/probe/M423.cpp index 7c82a4f8af..7ab887eb64 100644 --- a/Marlin/src/gcode/probe/M423.cpp +++ b/Marlin/src/gcode/probe/M423.cpp @@ -72,12 +72,12 @@ void GcodeSuite::M423() { do_report = false; const int8_t x = parser.value_int(); if (!WITHIN(x, 0, XATC_MAX_POINTS - 1)) - SERIAL_ECHOLNPGM("?(X) out of range (0..", XATC_MAX_POINTS - 1, ")."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(X) out of range (0..", XATC_MAX_POINTS - 1, ").")); else { if (parser.seenval('Z')) xatc.z_offset[x] = parser.value_linear_units(); else - SERIAL_ECHOLNPGM("?(Z) required."); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("(Z) required.")); } } @@ -86,6 +86,8 @@ void GcodeSuite::M423() { } void GcodeSuite::M423_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading(forReplay, F("X-Twist Correction")); SERIAL_ECHOLNPGM(" M423 A", xatc.start, " I", xatc.spacing); for (uint8_t x = 0; x < XATC_MAX_POINTS; ++x) { diff --git a/Marlin/src/gcode/probe/M851.cpp b/Marlin/src/gcode/probe/M851.cpp index ec63ff190d..7c40eddd5d 100644 --- a/Marlin/src/gcode/probe/M851.cpp +++ b/Marlin/src/gcode/probe/M851.cpp @@ -47,11 +47,11 @@ void GcodeSuite::M851() { if (WITHIN(x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX)) offs.x = x; else { - SERIAL_ECHOLNPGM("?X out of range (", PROBE_OFFSET_XMIN, " to ", PROBE_OFFSET_XMAX, ")"); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("X out of range (", PROBE_OFFSET_XMIN, " to ", PROBE_OFFSET_XMAX, ")")); ok = false; } #else - if (x) SERIAL_ECHOLNPGM("?X must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true + if (x) SERIAL_ECHOLNPGM(GCODE_ERR_MSG("X must be 0 (NOZZLE_AS_PROBE).")); // ...but let 'ok' stay true #endif } @@ -61,11 +61,11 @@ void GcodeSuite::M851() { if (WITHIN(y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX)) offs.y = y; else { - SERIAL_ECHOLNPGM("?Y out of range (", PROBE_OFFSET_YMIN, " to ", PROBE_OFFSET_YMAX, ")"); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Y out of range (", PROBE_OFFSET_YMIN, " to ", PROBE_OFFSET_YMAX, ")")); ok = false; } #else - if (y) SERIAL_ECHOLNPGM("?Y must be 0 (NOZZLE_AS_PROBE)."); // ...but let 'ok' stay true + if (y) SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Y must be 0 (NOZZLE_AS_PROBE).")); // ...but let 'ok' stay true #endif } @@ -74,7 +74,7 @@ void GcodeSuite::M851() { if (WITHIN(z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) offs.z = z; else { - SERIAL_ECHOLNPGM("?Z out of range (", PROBE_OFFSET_ZMIN, " to ", PROBE_OFFSET_ZMAX, ")"); + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Z out of range (", PROBE_OFFSET_ZMIN, " to ", PROBE_OFFSET_ZMAX, ")")); ok = false; } } @@ -84,6 +84,8 @@ void GcodeSuite::M851() { } void GcodeSuite::M851_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_Z_PROBE_OFFSET)); SERIAL_ECHOPGM_P( #if HAS_PROBE_XY_OFFSET diff --git a/Marlin/src/gcode/probe/M951.cpp b/Marlin/src/gcode/probe/M951.cpp index 93feffdce9..db0278e431 100644 --- a/Marlin/src/gcode/probe/M951.cpp +++ b/Marlin/src/gcode/probe/M951.cpp @@ -54,6 +54,21 @@ void mpe_settings_init() { mpe_settings_report(); } +/** + * M951: Magnetic Parking Extruder + * + * Parameters: + * L : Set X[0] position + * R : Set X[1] position + * I : Set grab distance + * J : Set slow feedrate + * H : Set fast feedrate + * D : Set travel feedrate + * C : Set compensation factor + * + * With no parameters report the current settings. + * + */ void GcodeSuite::M951() { if (parser.seenval('L')) mpe_settings.parking_xpos[0] = parser.value_linear_units(); if (parser.seenval('R')) mpe_settings.parking_xpos[1] = parser.value_linear_units(); diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 7281a48bb7..07e08493d1 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -212,6 +212,11 @@ public: */ static void set_current_line_number(long n) { serial_state[ring_buffer.command_port().index].last_N = n; } + /** + * Get the current line number for the last received command + */ + static long get_current_line_number() { return serial_state[ring_buffer.command_port().index].last_N; } + #if ENABLED(BUFFER_MONITORING) private: diff --git a/Marlin/src/gcode/sd/M524.cpp b/Marlin/src/gcode/sd/M524.cpp index a3c03e90ba..61185b7e0b 100644 --- a/Marlin/src/gcode/sd/M524.cpp +++ b/Marlin/src/gcode/sd/M524.cpp @@ -27,8 +27,8 @@ #include "../gcode.h" #include "../../sd/cardreader.h" -#if ENABLED(DWIN_LCD_PROUI) - #include "../../lcd/marlinui.h" +#if ENABLED(EXTENSIBLE_UI) + #include "../../lcd/extui/ui_api.h" #endif /** @@ -36,9 +36,9 @@ */ void GcodeSuite::M524() { - #if ENABLED(DWIN_LCD_PROUI) + #if ENABLED(EXTENSIBLE_UI) - ui.abort_print(); + ExtUI::stopPrint(); // Calls ui.abort_print() which does the same as below #else diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index bced97351d..03e76d531d 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -35,10 +35,14 @@ /** * M75: Start print timer + * + * ProUI: If the print fails to start and any text is + * included in the command, print it in the header. */ void GcodeSuite::M75() { - startOrResumeJob(); + startOrResumeJob(); // ... ExtUI::onPrintTimerStarted() #if ENABLED(DWIN_LCD_PROUI) + // TODO: Remove if M75 is never used if (!IS_SD_PRINTING()) dwinPrintHeader(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT)); #endif } @@ -47,7 +51,7 @@ void GcodeSuite::M75() { * M76: Pause print timer */ void GcodeSuite::M76() { - TERN(DWIN_LCD_PROUI, ui.pause_print(), print_job_timer.pause()); + print_job_timer.pause(); // ... ExtUI::onPrintTimerPaused() TERN_(HOST_PAUSE_M76, hostui.pause()); } diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index f9f3abc5bd..730ec65ba4 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -31,8 +31,6 @@ #if ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" -#elif ENABLED(PROUI_PID_TUNE) - #include "../../lcd/e3v2/proui/dwin.h" #endif /** @@ -68,8 +66,7 @@ void GcodeSuite::M303() { default: SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID); - TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_HEATER_ID)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_BAD_HEATER_ID)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_BAD_HEATER_ID)); return; } @@ -79,7 +76,7 @@ void GcodeSuite::M303() { const celsius_t temp = seenS ? parser.value_celsius() : default_temp; const bool u = parser.boolval('U'); - TERN_(PROUI_PID_TUNE, dwinStartM303(seenC, c, seenS, hid, temp)); + TERN_(EXTENSIBLE_UI, ExtUI::onStartM303(c, hid, temp)); IF_DISABLED(BUSY_WHILE_HEATING, KEEPALIVE_STATE(NOT_BUSY)); diff --git a/Marlin/src/gcode/temp/M306.cpp b/Marlin/src/gcode/temp/M306.cpp index 2830a77ab4..12e175420d 100644 --- a/Marlin/src/gcode/temp/M306.cpp +++ b/Marlin/src/gcode/temp/M306.cpp @@ -49,7 +49,7 @@ */ void GcodeSuite::M306() { - const uint8_t e = TERN(HAS_MULTI_EXTRUDER, parser.intval('E', active_extruder), 0); + const uint8_t e = TERN0(HAS_MULTI_EXTRUDER, parser.intval('E', active_extruder)); if (e >= (EXTRUDERS)) { SERIAL_ECHOLNPGM("?(E)xtruder index out of range (0-", (EXTRUDERS) - 1, ")."); return; @@ -88,6 +88,8 @@ void GcodeSuite::M306() { } void GcodeSuite::M306_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading(forReplay, F("Model predictive control")); HOTEND_LOOP() { report_echo_start(forReplay); diff --git a/Marlin/src/gcode/temp/M86-M87.cpp b/Marlin/src/gcode/temp/M86_M87.cpp similarity index 97% rename from Marlin/src/gcode/temp/M86-M87.cpp rename to Marlin/src/gcode/temp/M86_M87.cpp index 7fb4461961..502052e87b 100644 --- a/Marlin/src/gcode/temp/M86-M87.cpp +++ b/Marlin/src/gcode/temp/M86_M87.cpp @@ -21,7 +21,7 @@ */ /** - * gcode/temp/M86-M87.cpp + * gcode/temp/M86_M87.cpp * * Hotend Idle Timeout */ @@ -34,6 +34,8 @@ #include "../../feature/hotend_idle.h" void GcodeSuite::M86_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + hotend_idle_settings_t &c = hotend_idle.cfg; report_heading(forReplay, F("Hotend Idle Timeout")); SERIAL_ECHOLNPGM(" M86" diff --git a/Marlin/src/gcode/units/M149.cpp b/Marlin/src/gcode/units/M149.cpp index bd9d8d486c..a3bf7858b8 100644 --- a/Marlin/src/gcode/units/M149.cpp +++ b/Marlin/src/gcode/units/M149.cpp @@ -37,6 +37,8 @@ void GcodeSuite::M149() { } void GcodeSuite::M149_report(const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + report_heading_etc(forReplay, F(STR_TEMPERATURE_UNITS)); SERIAL_ECHOLN(F(" M149 "), C(parser.temp_units_code()), F(" ; Units in "), parser.temp_units_name()); } diff --git a/Marlin/src/inc/Changes.h b/Marlin/src/inc/Changes.h index 0fd91ee9ca..1019638931 100644 --- a/Marlin/src/inc/Changes.h +++ b/Marlin/src/inc/Changes.h @@ -82,6 +82,8 @@ #error "Z_ENDSTOP_SERVO_NR is now Z_PROBE_SERVO_NR." #elif defined(DEFAULT_XYJERK) #error "DEFAULT_XYJERK is deprecated. Use DEFAULT_XJERK and DEFAULT_YJERK instead." +#elif defined(ALLOW_LOW_EJERK) + #error "ALLOW_LOW_EJERK is deprecated and should be removed." #elif defined(XY_TRAVEL_SPEED) #error "XY_TRAVEL_SPEED is now XY_PROBE_FEEDRATE." #elif defined(XY_PROBE_SPEED) @@ -283,11 +285,11 @@ #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT) #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN." #elif defined(HAVE_TMCDRIVER) - #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X." + #error "HAVE_TMCDRIVER is obsolete." #elif defined(STEALTHCHOP) #error "STEALTHCHOP is now STEALTHCHOP_(XY|Z|E)." #elif defined(HAVE_TMC26X) - #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X." + #error "HAVE_TMC26X is now obsolete." #elif defined(HAVE_TMC2130) #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130." #elif defined(HAVE_TMC2208) @@ -296,10 +298,10 @@ #error "HAVE_L6470DRIVER is obsolete. L64xx stepper drivers are no longer supported in Marlin." #elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) || defined(Z3_IS_TMC) \ || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC) || defined(E6_IS_TMC) || defined(E7_IS_TMC) - #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X." + #error "[AXIS]_IS_TMC is now obsolete." #elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) || defined(Z3_IS_TMC26X) \ || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X) || defined(E6_IS_TMC26X) || defined(E7_IS_TMC26X) - #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X." + #error "[AXIS]_IS_TMC26X is now obsolete." #elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) || defined(Z3_IS_TMC2130) \ || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130) || defined(E6_IS_TMC2130) || defined(E7_IS_TMC2130) #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130." @@ -598,7 +600,9 @@ #elif defined(LEVEL_CENTER_TOO) #error "LEVEL_CENTER_TOO is now BED_TRAMMING_INCLUDE_CENTER." #elif defined(TOUCH_IDLE_SLEEP) - #error "TOUCH_IDLE_SLEEP (seconds) is now TOUCH_IDLE_SLEEP_MINS (minutes)." + #error "TOUCH_IDLE_SLEEP (seconds) is now DISPLAY_SLEEP_MINUTES (minutes)." +#elif defined(TOUCH_IDLE_SLEEP_MINS) + #error "TOUCH_IDLE_SLEEP_MINS is now DISPLAY_SLEEP_MINUTES." #elif defined(LCD_BACKLIGHT_TIMEOUT) #error "LCD_BACKLIGHT_TIMEOUT (seconds) is now LCD_BACKLIGHT_TIMEOUT_MINS (minutes)." #elif defined(LCD_SET_PROGRESS_MANUALLY) @@ -687,6 +691,8 @@ #error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING is now CTC_A10S_A13." #elif defined(Z_PROBE_END_SCRIPT) #error "Z_PROBE_END_SCRIPT is now EVENT_GCODE_AFTER_G29." +#elif defined(WIFI_SERIAL) + #error "WIFI_SERIAL is now WIFI_SERIAL_PORT." #endif // Changes to Probe Temp Compensation (#17392) @@ -714,6 +720,8 @@ #define _L6474 0x6474 #define _L6480 0x6480 #define _POWERSTEP01 0xF00D +#define _TMC26X 0x2600 +#define _TMC26X_STANDALONE 0x2601 #if HAS_DRIVER(L6470) #error "L6470 stepper drivers are no longer supported in Marlin." #elif HAS_DRIVER(L6474) @@ -722,8 +730,12 @@ #error "L6480 stepper drivers are no longer supported in Marlin." #elif HAS_DRIVER(POWERSTEP01) #error "POWERSTEP01 stepper drivers are no longer supported in Marlin." +#elif HAS_DRIVER(TMC26X) || HAS_DRIVER(TMC26X_STANDALONE) + #error "TMC26X stepper drivers are no longer supported in Marlin." #endif #undef _L6470 #undef _L6474 #undef _L6480 #undef _POWERSTEP01 +#undef _TMC26X +#undef _TMC26X_STANDALONE diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 729f450147..efda2d493e 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -507,6 +507,10 @@ #define ROTATIONAL_AXES 0 #endif +#if ROTATIONAL_AXES + #define HAS_ROTATIONAL_AXES 1 +#endif + /** * Number of Secondary Linear Axes (e.g., UVW) * All secondary axes for which AXIS*_ROTATES is not defined. @@ -575,7 +579,7 @@ #define MKS_MINI_12864 #endif -// MKS_MINI_12864_V3 , BTT_MINI_12864 and BEEZ_MINI_12864 have identical pinouts to FYSETC_MINI_12864_2_1 +// MKS_MINI_12864_V3 , BTT_MINI_12864 and BEEZ_MINI_12864 are nearly identical to FYSETC_MINI_12864_2_1 #if ANY(MKS_MINI_12864_V3, BTT_MINI_12864, BEEZ_MINI_12864) #define FYSETC_MINI_12864_2_1 #endif @@ -889,10 +893,11 @@ #endif #endif -// FSMC/SPI TFT Panels (LVGL) +// FSMC/SPI TFT Panels (LVGL) with encoder click wheel #if ENABLED(TFT_LVGL_UI) #define HAS_TFT_LVGL_UI 1 #define SERIAL_RUNTIME_HOOK 1 + #define STD_ENCODER_PULSES_PER_STEP 4 #endif // FSMC/SPI TFT Panels @@ -972,6 +977,18 @@ #define DETECT_I2C_LCD_DEVICE 1 #endif +/** + * Ender-3 V2 DWIN with Encoder + */ +#if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI) + #define HAS_DWIN_E3V2_BASIC 1 +#endif +#if ANY(HAS_DWIN_E3V2_BASIC, DWIN_CREALITY_LCD_JYERSUI) + #define HAS_DWIN_E3V2 1 + #define STD_ENCODER_PULSES_PER_STEP 4 +#endif + +// Encoder behavior #ifndef STD_ENCODER_PULSES_PER_STEP #if ENABLED(TOUCH_SCREEN) #define STD_ENCODER_PULSES_PER_STEP 2 @@ -992,10 +1009,12 @@ #define ENCODER_FEEDRATE_DEADZONE 6 #endif -// Shift register panels -// --------------------- -// 2 wire Non-latching LCD SR from: -// https://github.com/fmalpartida/New-LiquidCrystal/wiki/schematics#user-content-ShiftRegister_connection +/** + * Shift register panels + * --------------------- + * 2 wire Non-latching LCD SR from: + * https://github.com/fmalpartida/New-LiquidCrystal/wiki/schematics#user-content-ShiftRegister_connection + */ #if ENABLED(FF_INTERFACEBOARD) #define SR_LCD_3W_NL // Non latching 3 wire shift register #define IS_ULTIPANEL 1 @@ -1030,19 +1049,11 @@ #endif // Extensible UI serial touch screens. (See src/lcd/extui) -#if ANY(HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT, TOUCH_UI_FTDI_EVE) +#if ANY(HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT, TOUCH_UI_FTDI_EVE, DWIN_LCD_PROUI) #define IS_EXTUI 1 // Just for sanity check. #define EXTENSIBLE_UI #endif -// Aliases for LCD features -#if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI) - #define HAS_DWIN_E3V2_BASIC 1 -#endif -#if ANY(HAS_DWIN_E3V2_BASIC, DWIN_CREALITY_LCD_JYERSUI) - #define HAS_DWIN_E3V2 1 -#endif - // E3V2 extras #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI #define SERIAL_CATCHALL 0 @@ -1053,6 +1064,7 @@ #if ENABLED(DWIN_LCD_PROUI) #define DO_LIST_BIN_FILES 1 #define LCD_BRIGHTNESS_DEFAULT 127 + #define STATUS_DO_CLEAR_EMPTY #endif // Serial Controllers require LCD_SERIAL_PORT @@ -1087,6 +1099,7 @@ * - draw_kill_screen * - kill_screen * - draw_status_message + * (calling advance_status_scroll, status_and_len for a scrolling status message) */ #define HAS_DISPLAY 1 #endif @@ -1168,7 +1181,7 @@ /** * Set flags for any form of bed probe */ -#if ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, HAS_Z_SERVO_PROBE, SOLENOID_PROBE, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE) +#if ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, HAS_Z_SERVO_PROBE, SOLENOID_PROBE, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE, BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2) #define HAS_STOWABLE_PROBE 1 #endif #if ANY(HAS_STOWABLE_PROBE, FIX_MOUNTED_PROBE, BD_SENSOR, NOZZLE_AS_PROBE) @@ -1590,8 +1603,6 @@ #endif #if CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ #define IS_CORE 1 -#endif -#if IS_CORE #if CORE_IS_XY #define CORE_AXIS_1 A_AXIS #define CORE_AXIS_2 B_AXIS @@ -1845,16 +1856,9 @@ // This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046' #if ENABLED(TOUCH_SCREEN) - #if TOUCH_IDLE_SLEEP_MINS - #define HAS_TOUCH_SLEEP 1 - #endif #if NONE(TFT_TOUCH_DEVICE_GT911, TFT_TOUCH_DEVICE_XPT2046) #define TFT_TOUCH_DEVICE_XPT2046 // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 #endif - #if ENABLED(TFT_TOUCH_DEVICE_GT911) // GT911 Capacitive touch screen such as BIQU_BX_TFT70 - #undef TOUCH_SCREEN_CALIBRATION - #undef TOUCH_CALIBRATION_AUTO_SAVE - #endif #if !HAS_GRAPHICAL_TFT #undef TOUCH_SCREEN #if ENABLED(TFT_CLASSIC_UI) diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 20b357c9e3..8e5814f5f2 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -26,6 +26,12 @@ * Conditionals set before pins.h and which depend on Configuration_adv.h. */ +#if ENABLED(MARLIN_SMALL_BUILD) + #undef EEPROM_CHITCHAT + #undef CAPABILITIES_REPORT + #define DISABLE_M503 +#endif + #ifndef AXIS_RELATIVE_MODES #define AXIS_RELATIVE_MODES {} #endif @@ -106,8 +112,8 @@ #undef DISABLE_IDLE_X #undef INPUT_SHAPING_X #undef SAFE_BED_LEVELING_START_X - #undef SHAPING_BUFFER_X #undef SHAPING_FREQ_X + #undef SHAPING_ZETA_X #undef STEALTHCHOP_X #endif @@ -122,8 +128,8 @@ #undef INPUT_SHAPING_Y #undef QUICK_HOME #undef SAFE_BED_LEVELING_START_Y - #undef SHAPING_BUFFER_Y #undef SHAPING_FREQ_Y + #undef SHAPING_ZETA_Y #undef STEALTHCHOP_Y #undef STEP_STATE_Y #endif @@ -136,8 +142,11 @@ #undef ENABLE_LEVELING_FADE_HEIGHT #undef HOME_Z_FIRST #undef HOMING_Z_WITH_PROBE + #undef INPUT_SHAPING_Z #undef NUM_Z_STEPPERS #undef SAFE_BED_LEVELING_START_Z + #undef SHAPING_FREQ_Z + #undef SHAPING_ZETA_Z #undef STEALTHCHOP_Z #undef STEP_STATE_Z #undef Z_IDLE_HEIGHT @@ -317,6 +326,13 @@ #define HAS_LINEAR_E_JERK 1 #endif +// Some displays can toggle Adaptive Step Smoothing. +// The state is saved to EEPROM. +// In future this may be added to a G-code such as M205 A. +#if ALL(ADAPTIVE_STEP_SMOOTHING, DWIN_LCD_PROUI) + #define ADAPTIVE_STEP_SMOOTHING_TOGGLE +#endif + /** * Temperature Sensors; define what sensor(s) we have. */ @@ -863,6 +879,24 @@ #define HAS_ENCODER_ACTION 1 #endif +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #ifndef ENCODER_5X_STEPS_PER_SEC + #define ENCODER_5X_STEPS_PER_SEC 0 + #endif + #ifndef ENCODER_10X_STEPS_PER_SEC + #define ENCODER_10X_STEPS_PER_SEC 0 + #endif + #ifndef ENCODER_100X_STEPS_PER_SEC + #define ENCODER_100X_STEPS_PER_SEC 0 + #endif + #if !((HAS_MARLINUI_MENU || HAS_DWIN_E3V2) && (ENCODER_5X_STEPS_PER_SEC || ENCODER_10X_STEPS_PER_SEC || ENCODER_100X_STEPS_PER_SEC)) + #undef ENCODER_RATE_MULTIPLIER + #undef ENCODER_5X_STEPS_PER_SEC + #undef ENCODER_10X_STEPS_PER_SEC + #undef ENCODER_100X_STEPS_PER_SEC + #endif +#endif + #if STATUS_MESSAGE_TIMEOUT_SEC > 0 #define HAS_STATUS_MESSAGE_TIMEOUT 1 #endif @@ -912,7 +946,7 @@ #if ALL(HAS_RESUME_CONTINUE, PRINTER_EVENT_LEDS, HAS_MEDIA) #define HAS_LEDS_OFF_FLAG 1 #endif -#if defined(DISPLAY_SLEEP_MINUTES) || defined(TOUCH_IDLE_SLEEP_MINS) +#ifdef DISPLAY_SLEEP_MINUTES #define HAS_DISPLAY_SLEEP 1 #endif #ifdef LCD_BACKLIGHT_TIMEOUT_MINS @@ -923,6 +957,12 @@ #define HAS_MOTOR_CURRENT_I2C 1 #endif +#if ENABLED(DUAL_X_CARRIAGE) + #ifndef INVERT_X2_DIR + #define INVERT_X2_DIR INVERT_X_DIR + #endif +#endif + // X2 but not IDEX => Dual Synchronized X Steppers #if defined(X2_DRIVER_TYPE) && DISABLED(DUAL_X_CARRIAGE) #define HAS_SYNCED_X_STEPPERS 1 @@ -1148,7 +1188,7 @@ #elif HAS_DRIVER(A4988) #define MINIMUM_STEPPER_POST_DIR_DELAY 200 #elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE - #define MINIMUM_STEPPER_POST_DIR_DELAY 70 + #define MINIMUM_STEPPER_POST_DIR_DELAY 100 #else #define MINIMUM_STEPPER_POST_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire #endif @@ -1243,11 +1283,6 @@ #define NO_EEPROM_SELECTED 1 #endif -// Flag whether hex_print.cpp is used -#if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG, MARLIN_DEV_MODE, DEBUG_CARDREADER, M20_TIMESTAMP_SUPPORT) - #define NEED_HEX_PRINT 1 -#endif - // Flags for Case Light having a color property or a single pin #if ENABLED(CASE_LIGHT_ENABLE) #if ANY(CASE_LIGHT_USE_NEOPIXEL, CASE_LIGHT_USE_RGB_LED) @@ -1279,7 +1314,8 @@ * currently HAL.h must be included ahead of pins.h. */ #if LCD_IS_SERIAL_HOST && !defined(LCD_SERIAL_PORT) - #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_MINI_E3_V3_0_1, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1, AQUILA_V101) + #if MB(MKS_MONSTER8_V1, BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_MINI_E3_V3_0_1, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1, BTT_SKR_V3_0, BTT_SKR_V3_0_EZ, AQUILA_V101) + #define LCD_SERIAL_PORT 1 #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V423, CREALITY_CR4NTXXC10, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO) #define LCD_SERIAL_PORT 2 @@ -1305,7 +1341,7 @@ #endif // Input shaping -#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y) +#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y, INPUT_SHAPING_Z) #define HAS_ZV_SHAPING 1 #endif @@ -1356,7 +1392,17 @@ #undef MANUAL_MOVE_DISTANCE_IN #endif -// Power-Loss Recovery -#if ENABLED(POWER_LOSS_RECOVERY) && defined(PLR_BED_THRESHOLD) - #define HAS_PLR_BED_THRESHOLD 1 +// Clean up if no rotational axes exist +#if !HAS_ROTATIONAL_AXES + #undef MANUAL_MOVE_DISTANCE_DEG +#endif + +// Power-Loss Recovery +#if ENABLED(POWER_LOSS_RECOVERY) + #ifdef PLR_BED_THRESHOLD + #define HAS_PLR_BED_THRESHOLD 1 + #endif + #if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI) + #define HAS_PLR_UI_FLAG 1 // recovery.ui_flag_resume + #endif #endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 076b1301d5..8446a1acf0 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -96,12 +96,6 @@ #define AXIS9_NAME 'W' #endif -#if ANY(AXIS4_ROTATES, AXIS5_ROTATES, AXIS6_ROTATES, AXIS7_ROTATES, AXIS8_ROTATES, AXIS9_ROTATES) - #define HAS_ROTATIONAL_AXES 1 -#else - #undef MANUAL_MOVE_DISTANCE_DEG -#endif - #if HAS_X_AXIS #define X_MAX_LENGTH (X_MAX_POS - (X_MIN_POS)) #endif @@ -1963,8 +1957,9 @@ * Currently this must be distinct, but we can add a mechanism to use the same pin for sensorless * or switches wired to the same pin, or for the single SPI stall state on the axis. */ -#define _USE_STOP(A,N,M,C) ((ANY(A##_HOME_TO_##M, A##N##_SAFETY_STOP) || (C+0)) && PIN_EXISTS(A##N##_##M) && !A##_SPI_SENSORLESS) -#define _HAS_STATE(A,N,M) (USE_##A##N##_##M || (ANY(A##_HOME_TO_##M, A##N##_SAFETY_STOP) && A##_SPI_SENSORLESS)) +#define _ANY_STOP(A,N,M) ANY(A##_HOME_TO_##M, A##N##_SAFETY_STOP) +#define _USE_STOP(A,N,M,C) ((_ANY_STOP(A,N,M) || (C+0)) && PIN_EXISTS(A##N##_##M) && !A##_SPI_SENSORLESS) +#define _HAS_STATE(A,N,M) (USE_##A##N##_##M || (_ANY_STOP(A,N,M) && A##_SPI_SENSORLESS)) #if _USE_STOP(X,,MIN,) #define USE_X_MIN 1 @@ -1998,7 +1993,7 @@ #define HAS_Y_STATE 1 #endif -#if _USE_STOP(Z,,MIN,ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) +#if _USE_STOP(Z,,MIN,ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) && (DISABLED(USE_PROBE_FOR_Z_HOMING) || ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) #define USE_Z_MIN 1 #endif #if _USE_STOP(Z,,MAX,) @@ -2205,7 +2200,9 @@ #define HAS_Z_PROBE_STATE 1 #endif +#undef _ANY_STOP #undef _USE_STOP +#undef _HAS_STATE /** * Set ENDSTOPPULLUPS for active endstop switches @@ -2490,9 +2487,6 @@ // PID heating #if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER) #define HAS_PID_HEATING 1 - #if ENABLED(DWIN_LCD_PROUI) && ANY(PIDTEMP, PIDTEMPBED) - #define PROUI_PID_TUNE 1 - #endif #endif // Thermal protection @@ -2820,7 +2814,7 @@ #if PIN_EXISTS(DIGIPOTSS) #define HAS_MOTOR_CURRENT_SPI 1 #endif -#if HAS_EXTRUDERS && PIN_EXISTS(MOTOR_CURRENT_PWM_E) +#if ANY_PIN(MOTOR_CURRENT_PWM_E, MOTOR_CURRENT_PWM_E0, MOTOR_CURRENT_PWM_E1) #define HAS_MOTOR_CURRENT_PWM_E 1 #endif #if HAS_MOTOR_CURRENT_PWM_E || ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_I, MOTOR_CURRENT_PWM_J, MOTOR_CURRENT_PWM_K, MOTOR_CURRENT_PWM_U, MOTOR_CURRENT_PWM_V, MOTOR_CURRENT_PWM_W) @@ -2964,16 +2958,16 @@ #endif #if HAS_BED_PROBE #ifndef PROBE_OFFSET_XMIN - #define PROBE_OFFSET_XMIN -50 + #define PROBE_OFFSET_XMIN -(X_BED_SIZE) #endif #ifndef PROBE_OFFSET_XMAX - #define PROBE_OFFSET_XMAX 50 + #define PROBE_OFFSET_XMAX X_BED_SIZE #endif #ifndef PROBE_OFFSET_YMIN - #define PROBE_OFFSET_YMIN -50 + #define PROBE_OFFSET_YMIN -(Y_BED_SIZE) #endif #ifndef PROBE_OFFSET_YMAX - #define PROBE_OFFSET_YMAX 50 + #define PROBE_OFFSET_YMAX Y_BED_SIZE #endif #if ALL(ENDSTOPPULLUPS, USE_Z_MIN_PROBE) #define ENDSTOPPULLUP_ZMIN_PROBE @@ -3050,8 +3044,8 @@ * Advanced Pause - Filament Change */ #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) || ALL(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT) - #define M600_PURGE_MORE_RESUMABLE 1 + #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI) || ALL(EMERGENCY_PARSER, HOST_PROMPT_SUPPORT) + #define M600_PURGE_MORE_RESUMABLE 1 // UI provides some way to Purge More / Resume #endif #ifndef FILAMENT_CHANGE_SLOW_LOAD_LENGTH #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 @@ -3215,18 +3209,6 @@ #undef SOUND_ON_DEFAULT #endif -/** - * Make sure DOGLCD_SCK and DOGLCD_MOSI are defined. - */ -#if HAS_MARLINUI_U8GLIB - #ifndef DOGLCD_SCK - #define DOGLCD_SCK SD_SCK_PIN - #endif - #ifndef DOGLCD_MOSI - #define DOGLCD_MOSI SD_MOSI_PIN - #endif -#endif - /** * Z_CLEARANCE_FOR_HOMING / Z_CLEARANCE_BETWEEN_PROBES */ @@ -3294,7 +3276,7 @@ #endif // Add commands that need sub-codes to this list -#if ANY(G38_PROBE_TARGET, CNC_COORDINATE_SYSTEMS, POWER_LOSS_RECOVERY) +#if ANY(G38_PROBE_TARGET, CNC_COORDINATE_SYSTEMS, POWER_LOSS_RECOVERY, HAS_ROTATIONAL_AXES) #define USE_GCODE_SUBCODES 1 #endif @@ -3417,3 +3399,15 @@ FIL_RUNOUT5_PULLDOWN, FIL_RUNOUT6_PULLDOWN, FIL_RUNOUT7_PULLDOWN, FIL_RUNOUT8_PULLDOWN) #define USING_PULLDOWNS 1 #endif + +// Machine UUID can come from STM32 CPU Serial Number +#ifdef MACHINE_UUID + #undef HAS_STM32_UID +#elif !HAS_STM32_UID && defined(DEFAULT_MACHINE_UUID) + #define MACHINE_UUID DEFAULT_MACHINE_UUID +#endif + +// Flag whether hex_print.cpp is needed +#if ANY(AUTO_BED_LEVELING_UBL, M100_FREE_MEMORY_WATCHER, DEBUG_GCODE_PARSER, TMC_DEBUG, MARLIN_DEV_MODE, DEBUG_CARDREADER, M20_TIMESTAMP_SUPPORT, HAS_STM32_UID) + #define NEED_HEX_PRINT 1 +#endif diff --git a/Marlin/src/inc/Conditionals_type.h b/Marlin/src/inc/Conditionals_type.h new file mode 100644 index 0000000000..1f9cfcae16 --- /dev/null +++ b/Marlin/src/inc/Conditionals_type.h @@ -0,0 +1,32 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Conditionals_type.h + * Internal defines that depend on Configurations and Pins but are not user-editable. + * Define conditionals in this file if they depend on core/types.h. + */ + +#ifdef GITHUB_ACTIONS + // Extras for CI testing +#endif diff --git a/Marlin/src/inc/MarlinConfig.h b/Marlin/src/inc/MarlinConfig.h index 8f6519dbaf..807082d839 100644 --- a/Marlin/src/inc/MarlinConfig.h +++ b/Marlin/src/inc/MarlinConfig.h @@ -48,9 +48,10 @@ #include "../core/types.h" // Ahead of sanity-checks + #include "Conditionals_type.h" + #include HAL_PATH(.., inc/Conditionals_type.h) + #include "Changes.h" - #include "SanityCheck.h" - #include HAL_PATH(.., inc/SanityCheck.h) // Include all core headers #include "../core/language.h" @@ -62,3 +63,8 @@ #endif #include "../core/multi_language.h" + +#ifndef __MARLIN_DEPS__ + #include "SanityCheck.h" + #include HAL_PATH(.., inc/SanityCheck.h) +#endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 796a3d78de..0383d29a69 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -235,9 +235,11 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices." #endif -// Serial DMA is only available for some STM32 MCUs +// Serial DMA is only available for some STM32 MCUs and HC32 #if ENABLED(SERIAL_DMA) - #if !HAL_STM32 || NONE(STM32F0xx, STM32F1xx, STM32F2xx, STM32F4xx, STM32F7xx) + #if defined(ARDUINO_ARCH_HC32) + // checks for HC32 are located in HAL/HC32/inc/SanityCheck.h + #elif !HAL_STM32 || NONE(STM32F0xx, STM32F1xx, STM32F2xx, STM32F4xx, STM32F7xx) #error "SERIAL_DMA is only available for some STM32 MCUs and requires HAL/STM32." #elif !defined(HAL_UART_MODULE_ENABLED) || defined(HAL_UART_MODULE_ONLY) #error "SERIAL_DMA requires STM32 platform HAL UART (without HAL_UART_MODULE_ONLY)." @@ -345,8 +347,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #if LCD_INFO_SCREEN_STYLE > 0 #if HAS_MARLINUI_U8GLIB || LCD_WIDTH < 20 || LCD_HEIGHT < 4 #error "Alternative LCD_INFO_SCREEN_STYLE requires 20x4 Character LCD." - #elif LCD_INFO_SCREEN_STYLE > 1 - #error "LCD_INFO_SCREEN_STYLE only has options 0 and 1 at this time." + #elif LCD_INFO_SCREEN_STYLE > 2 + #error "LCD_INFO_SCREEN_STYLE only has options 0 (Classic), 1 (Průša), and 2 (CNC)." #endif #endif @@ -386,8 +388,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L /** * Custom Boot and Status screens */ -#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, IS_DWIN_MARLINUI) - #error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE." +#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_HD44780, HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, IS_DWIN_MARLINUI) + #error "SHOW_CUSTOM_BOOTSCREEN requires Character LCD, Graphical LCD, or TOUCH_UI_FTDI_EVE." #elif ENABLED(SHOW_CUSTOM_BOOTSCREEN) && DISABLED(SHOW_BOOTSCREEN) #error "SHOW_CUSTOM_BOOTSCREEN requires SHOW_BOOTSCREEN." #elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_MARLINUI_U8GLIB @@ -542,7 +544,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #elif FILAMENT_RUNOUT_DISTANCE_MM < 0 #error "FILAMENT_RUNOUT_DISTANCE_MM must be greater than or equal to zero." #elif DISABLED(ADVANCED_PAUSE_FEATURE) && defined(FILAMENT_RUNOUT_SCRIPT) - static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with FILAMENT_RUNOUT_SENSOR."); + static_assert(nullptr == strstr(FILAMENT_RUNOUT_SCRIPT, "M600"), "FILAMENT_RUNOUT_SCRIPT cannot make use of M600 unless ADVANCED_PAUSE_FEATURE is enabled"); #endif #endif @@ -614,7 +616,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #elif ENABLED(MMU2_MENUS) && !HAS_MARLINUI_MENU #error "MMU2_MENUS requires an LCD supporting MarlinUI." #elif DISABLED(ADVANCED_PAUSE_FEATURE) - static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / HAS_EXTENDABLE_MMU(S)."); + static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "MMU2_FILAMENT_RUNOUT_SCRIPT cannot make use of M600 unless ADVANCED_PAUSE_FEATURE is enabled"); #endif #endif @@ -828,8 +830,6 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #if ENABLED(DIRECT_STEPPING) #error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. (Extrusion is controlled externally by the Step Daemon.)" - #elif NONE(HAS_JUNCTION_DEVIATION, ALLOW_LOW_EJERK) && defined(DEFAULT_EJERK) - static_assert(DEFAULT_EJERK >= 10, "It is strongly recommended to set DEFAULT_EJERK >= 10 when using LIN_ADVANCE. Enable ALLOW_LOW_EJERK to bypass this alert (e.g., for direct drive)."); #endif #endif @@ -1208,8 +1208,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i */ #if 1 < 0 \ + (DISABLED(BLTOUCH) && HAS_Z_SERVO_PROBE) \ - + COUNT_ENABLED(PROBE_MANUALLY, BLTOUCH, BD_SENSOR, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE) - #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, BD_SENSOR, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, MAGLEV4, MAG_MOUNTED_PROBE or Z Servo." + + COUNT_ENABLED(PROBE_MANUALLY, BLTOUCH, BD_SENSOR, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE, BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2) + #error "Please enable only one probe option: PROBE_MANUALLY, SENSORLESS_PROBING, BLTOUCH, BD_SENSOR, FIX_MOUNTED_PROBE, NOZZLE_AS_PROBE, TOUCH_MI_PROBE, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, MAGLEV4, MAG_MOUNTED_PROBE, BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2, or Z Servo." #endif #if HAS_BED_PROBE @@ -1377,6 +1377,53 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #endif #endif + /** + * BIQU MicroProbe requirements + */ + #if ANY(BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2) + #if DISABLED(PROBE_ENABLE_DISABLE) + #error "BIQU MicroProbe requires PROBE_ENABLE_DISABLE." + #elif !PIN_EXISTS(PROBE_ENABLE) + #error "BIQU MicroProbe requires a PROBE_ENABLE_PIN." + #endif + + #if ENABLED(BIQU_MICROPROBE_V1) + #if ENABLED(INVERTED_PROBE_STATE) + #if Z_MIN_PROBE_ENDSTOP_HIT_STATE != LOW + #error "BIQU_MICROPROBE_V1 requires Z_MIN_PROBE_ENDSTOP_HIT_STATE LOW." + #endif + #elif Z_MIN_PROBE_ENDSTOP_HIT_STATE != HIGH + #error "BIQU_MICROPROBE_V1 requires Z_MIN_PROBE_ENDSTOP_HIT_STATE HIGH." + #endif + #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #if ENABLED(INVERTED_PROBE_STATE) + #if Z_MIN_ENDSTOP_HIT_STATE != LOW + #error "BIQU_MICROPROBE_V1 requires Z_MIN_ENDSTOP_HIT_STATE LOW." + #endif + #elif Z_MIN_ENDSTOP_HIT_STATE != HIGH + #error "BIQU_MICROPROBE_V1 requires Z_MIN_ENDSTOP_HIT_STATE HIGH." + #endif + #endif + #elif ENABLED(BIQU_MICROPROBE_V2) + #if ENABLED(INVERTED_PROBE_STATE) + #if Z_MIN_PROBE_ENDSTOP_HIT_STATE != HIGH + #error "BIQU_MICROPROBE_V2 requires Z_MIN_PROBE_ENDSTOP_HIT_STATE HIGH." + #endif + #elif Z_MIN_PROBE_ENDSTOP_HIT_STATE != LOW + #error "BIQU_MICROPROBE_V2 requires Z_MIN_PROBE_ENDSTOP_HIT_STATE LOW." + #endif + #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + #if ENABLED(INVERTED_PROBE_STATE) + #if Z_MIN_ENDSTOP_HIT_STATE != HIGH + #error "BIQU_MICROPROBE_V2 requires Z_MIN_ENDSTOP_HIT_STATE HIGH." + #endif + #elif Z_MIN_ENDSTOP_HIT_STATE != LOW + #error "BIQU_MICROPROBE_V2 requires Z_MIN_ENDSTOP_HIT_STATE LOW." + #endif + #endif + #endif + #endif // BIQU_MICROPROBE_V1 || BIQU_MICROPROBE_V2 + /** * Require pin options and pins to be defined */ @@ -1418,8 +1465,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i PROBE_OFFSET_ASSERT("PROBE_OFFSET_YMIN", PROBE_OFFSET_YMIN, -(Y_BED_SIZE), Y_BED_SIZE); PROBE_OFFSET_ASSERT("PROBE_OFFSET_YMAX", PROBE_OFFSET_YMAX, -(Y_BED_SIZE), Y_BED_SIZE); #endif - PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMIN", PROBE_OFFSET_ZMIN, -20, 20); - PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMAX", PROBE_OFFSET_ZMAX, -20, 20); + PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMIN", PROBE_OFFSET_ZMIN, -(Z_MAX_POS), Z_MAX_POS); + PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMAX", PROBE_OFFSET_ZMAX, -(Z_MAX_POS), Z_MAX_POS); /** * Check for improper NOZZLE_AS_PROBE or NOZZLE_TO_PROBE_OFFSET @@ -1463,9 +1510,7 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #endif #endif - #if Z_PROBE_LOW_POINT > 0 - #error "Z_PROBE_LOW_POINT must be less than or equal to 0." - #endif + static_assert(Z_PROBE_LOW_POINT <= 0, "Z_PROBE_LOW_POINT must be less than or equal to 0."); #if ENABLED(PROBE_ACTIVATION_SWITCH) #ifndef PROBE_ACTIVATION_SWITCH_STATE @@ -1500,6 +1545,9 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #error "BED_TRAMMING_USE_PROBE is incompatible with SENSORLESS_PROBING." #endif #endif + static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0."); +#elif ANY(DGUS_LCD_UI_RELOADED, DGUS_LCD_UI_E3S1PRO) + #error "LCD_BED_TRAMMING is required for the selected display." #endif /** @@ -1680,6 +1728,13 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle."); #endif +/** + * Make sure Z_CLEARANCE_FOR_HOMING is below Z_MAX_POS + */ +#if HAS_Z_AXIS + static_assert(Z_CLEARANCE_FOR_HOMING <= Z_MAX_POS, "Z_CLEARANCE_FOR_HOMING must be smaller than or equal to Z_MAX_POS."); +#endif + // Check Safe Bed Leveling settings #if HAS_SAFE_BED_LEVELING #if defined(SAFE_BED_LEVELING_START_Y) && !defined(SAFE_BED_LEVELING_START_X) @@ -1787,6 +1842,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS." #elif X_HOME_TO_MAX #error "DUAL_X_CARRIAGE requires X_HOME_DIR -1." + #elif (X2_HOME_POS <= X1_MAX_POS) || (X2_MAX_POS < X1_MAX_POS) + #error "DUAL_X_CARRIAGE will crash if X1 can meet or exceed X2 travel." #endif #endif @@ -2334,8 +2391,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #error "Y_MIN_PIN, Y_STOP_PIN, or Y_SPI_SENSORLESS is required for Y axis homing." #elif Y_HOME_TO_MAX && !HAS_Y_MAX_STATE #error "Y_MAX_PIN, Y_STOP_PIN, or Y_SPI_SENSORLESS is required for Y axis homing." - #elif Z_HOME_TO_MIN && !HAS_Z_MIN_STATE - #error "Z_MIN_PIN, Z_STOP_PIN, or Z_SPI_SENSORLESS is required for Z axis homing." + #elif Z_HOME_TO_MIN && NONE(HAS_Z_MIN_STATE, USE_PROBE_FOR_Z_HOMING) + #error "Z_MIN_PIN, Z_STOP_PIN, Z_SPI_SENSORLESS, or USE_PROBE_FOR_Z_HOMING is required for Z axis homing." #elif Z_HOME_TO_MAX && !HAS_Z_MAX_STATE #error "Z_MAX_PIN, Z_STOP_PIN, or Z_SPI_SENSORLESS is required for Z axis homing." #elif I_HOME_TO_MIN && !HAS_I_MIN_STATE @@ -2646,6 +2703,28 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #undef IS_U8GLIB_SSD1306 #undef IS_EXTUI +/** + * Make sure LCD language settings are distinct + */ +#if NUM_LANGUAGES > 1 + static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_2), STRINGIFY(LCD_LANGUAGE)), "Error: LCD_LANGUAGE_2 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE."); +#endif +#if NUM_LANGUAGES > 2 + static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_3), STRINGIFY(LCD_LANGUAGE)), "Error: LCD_LANGUAGE_3 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE."); + static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_3), STRINGIFY(LCD_LANGUAGE_2)), "Error: LCD_LANGUAGE_3 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_2."); +#endif +#if NUM_LANGUAGES > 3 + static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_4), STRINGIFY(LCD_LANGUAGE)), "Error: LCD_LANGUAGE_4 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE."); + static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_4), STRINGIFY(LCD_LANGUAGE_2)), "Error: LCD_LANGUAGE_4 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_2."); + static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_4), STRINGIFY(LCD_LANGUAGE_3)), "Error: LCD_LANGUAGE_4 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_3."); +#endif +#if NUM_LANGUAGES > 4 + static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_5), STRINGIFY(LCD_LANGUAGE)), "Error: LCD_LANGUAGE_5 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE."); + static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_5), STRINGIFY(LCD_LANGUAGE_2)), "Error: LCD_LANGUAGE_5 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_2."); + static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_5), STRINGIFY(LCD_LANGUAGE_3)), "Error: LCD_LANGUAGE_5 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_3."); + static_assert(strcmp(STRINGIFY(LCD_LANGUAGE_5), STRINGIFY(LCD_LANGUAGE_4)), "Error: LCD_LANGUAGE_5 (" STRINGIFY(LCD_LANGUAGE) ") cannot be the same as LCD_LANGUAGE_4."); +#endif + #if ANY(TFT_GENERIC, MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, \ TFT_TRONXY_X5SA, ANYCUBIC_TFT35, ANYCUBIC_TFT35, LONGER_LK_TFT28, ANET_ET4_TFT28, ANET_ET5_TFT35, BIQU_BX_TFT70, BTT_TFT35_SPI_V1_0) #if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI) @@ -2735,6 +2814,8 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #if HAS_BACKLIGHT_TIMEOUT #if !HAS_ENCODER_ACTION && DISABLED(HAS_DWIN_E3V2) #error "LCD_BACKLIGHT_TIMEOUT_MINS requires an LCD with encoder or keypad." + #elif HAS_DISPLAY_SLEEP + #error "LCD_BACKLIGHT_TIMEOUT_MINS and DISPLAY_SLEEP_MINUTES are not currently supported at the same time." #elif ENABLED(NEOPIXEL_BKGD_INDEX_FIRST) #if PIN_EXISTS(LCD_BACKLIGHT) #error "LCD_BACKLIGHT_PIN and NEOPIXEL_BKGD_INDEX_FIRST are not supported at the same time." @@ -2744,6 +2825,15 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #elif !PIN_EXISTS(LCD_BACKLIGHT) && DISABLED(HAS_DWIN_E3V2) #error "LCD_BACKLIGHT_TIMEOUT_MINS requires LCD_BACKLIGHT_PIN, NEOPIXEL_BKGD_INDEX_FIRST, or an Ender-3 V2 DWIN LCD." #endif +#elif HAS_DISPLAY_SLEEP + #if NONE(TOUCH_SCREEN, HAS_MARLINUI_U8GLIB) || ANY(IS_U8GLIB_LM6059_AF, IS_U8GLIB_ST7565_64128, REPRAPWORLD_GRAPHICAL_LCD, FYSETC_MINI_12864, CR10_STOCKDISPLAY, MINIPANEL) + #error "DISPLAY_SLEEP_MINUTES is not supported by your display." + #undef HAS_DISPLAY_SLEEP + #elif !WITHIN(DISPLAY_SLEEP_MINUTES, 0, 255) + #error "DISPLAY_SLEEP_MINUTES must be between 0 and 255." + #elif DISABLED(EDITABLE_DISPLAY_TIMEOUT) && DISPLAY_SLEEP_MINUTES == 0 + #error "DISPLAY_SLEEP_MINUTES must be greater than 0 with EDITABLE_DISPLAY_TIMEOUT disabled." + #endif #endif // Startup Tune requirements @@ -2756,17 +2846,6 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #endif #endif -/** - * Display Sleep is not supported by these common displays - */ -#if HAS_DISPLAY_SLEEP - #if ANY(IS_U8GLIB_LM6059_AF, IS_U8GLIB_ST7565_64128, REPRAPWORLD_GRAPHICAL_LCD, FYSETC_MINI_12864, CR10_STOCKDISPLAY, MINIPANEL) - #error "DISPLAY_SLEEP_MINUTES is not supported by your display." - #elif !WITHIN(DISPLAY_SLEEP_MINUTES, 0, 255) - #error "DISPLAY_SLEEP_MINUTES must be between 0 and 255." - #endif -#endif - /** * Some boards forbid the use of -1 Native USB */ @@ -3298,10 +3377,59 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i #error "MARKFORGED requires both X and Y to use sensorless homing if either one does." #endif +// TMC Hybrid Threshold +#if ENABLED(HYBRID_THRESHOLD) + #if !STEALTHCHOP_ENABLED + #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD." + #elif defined(X_HYBRID_THRESHOLD) && X_HYBRID_THRESHOLD == 0 + #error "X_HYBRID_THRESHOLD must be greater than 0." + #elif defined(X2_HYBRID_THRESHOLD) && X2_HYBRID_THRESHOLD == 0 + #error "X2_HYBRID_THRESHOLD must be greater than 0." + #elif defined(Y_HYBRID_THRESHOLD) && Y_HYBRID_THRESHOLD == 0 + #error "Y_HYBRID_THRESHOLD must be greater than 0." + #elif defined(Y2_HYBRID_THRESHOLD) && Y2_HYBRID_THRESHOLD == 0 + #error "Y2_HYBRID_THRESHOLD must be greater than 0." + #elif defined(Z_HYBRID_THRESHOLD) && Z_HYBRID_THRESHOLD == 0 + #error "Z_HYBRID_THRESHOLD must be greater than 0." + #elif defined(Z2_HYBRID_THRESHOLD) && Z2_HYBRID_THRESHOLD == 0 + #error "Z2_HYBRID_THRESHOLD must be greater than 0." + #elif defined(Z3_HYBRID_THRESHOLD) && Z3_HYBRID_THRESHOLD == 0 + #error "Z3_HYBRID_THRESHOLD must be greater than 0." + #elif defined(Z4_HYBRID_THRESHOLD) && Z4_HYBRID_THRESHOLD == 0 + #error "Z4_HYBRID_THRESHOLD must be greater than 0." + #elif defined(I_HYBRID_THRESHOLD) && I_HYBRID_THRESHOLD == 0 + #error "I_HYBRID_THRESHOLD must be greater than 0." + #elif defined(J_HYBRID_THRESHOLD) && J_HYBRID_THRESHOLD == 0 + #error "J_HYBRID_THRESHOLD must be greater than 0." + #elif defined(K_HYBRID_THRESHOLD) && K_HYBRID_THRESHOLD == 0 + #error "K_HYBRID_THRESHOLD must be greater than 0." + #elif defined(U_HYBRID_THRESHOLD) && U_HYBRID_THRESHOLD == 0 + #error "U_HYBRID_THRESHOLD must be greater than 0." + #elif defined(V_HYBRID_THRESHOLD) && V_HYBRID_THRESHOLD == 0 + #error "V_HYBRID_THRESHOLD must be greater than 0." + #elif defined(W_HYBRID_THRESHOLD) && W_HYBRID_THRESHOLD == 0 + #error "W_HYBRID_THRESHOLD must be greater than 0." + #elif defined(E0_HYBRID_THRESHOLD) && E0_HYBRID_THRESHOLD == 0 + #error "E0_HYBRID_THRESHOLD must be greater than 0." + #elif defined(E1_HYBRID_THRESHOLD) && E1_HYBRID_THRESHOLD == 0 + #error "E1_HYBRID_THRESHOLD must be greater than 0." + #elif defined(E2_HYBRID_THRESHOLD) && E2_HYBRID_THRESHOLD == 0 + #error "E2_HYBRID_THRESHOLD must be greater than 0." + #elif defined(E3_HYBRID_THRESHOLD) && E3_HYBRID_THRESHOLD == 0 + #error "E3_HYBRID_THRESHOLD must be greater than 0." + #elif defined(E4_HYBRID_THRESHOLD) && E4_HYBRID_THRESHOLD == 0 + #error "E4_HYBRID_THRESHOLD must be greater than 0." + #elif defined(E5_HYBRID_THRESHOLD) && E5_HYBRID_THRESHOLD == 0 + #error "E5_HYBRID_THRESHOLD must be greater than 0." + #elif defined(E6_HYBRID_THRESHOLD) && E6_HYBRID_THRESHOLD == 0 + #error "E6_HYBRID_THRESHOLD must be greater than 0." + #elif defined(E7_HYBRID_THRESHOLD) && E7_HYBRID_THRESHOLD == 0 + #error "E7_HYBRID_THRESHOLD must be greater than 0." + #endif +#endif // HYBRID_THRESHOLD + // Other TMC feature requirements -#if ENABLED(HYBRID_THRESHOLD) && !STEALTHCHOP_ENABLED - #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD." -#elif ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD +#if ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD #error "SENSORLESS_HOMING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers." #elif ENABLED(SENSORLESS_PROBING) && !HAS_STALLGUARD #error "SENSORLESS_PROBING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers." @@ -3518,6 +3646,7 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." #error "Z_STEPPER_ALIGN_STEPPER_XY requires 3 or 4 Z steppers." #endif #endif + static_assert(WITHIN(Z_STEPPER_ALIGN_ACC, 0.001, 1.0), "Z_STEPPER_ALIGN_ACC needs to be between 0.001 and 1.0"); #endif #if ENABLED(MECHANICAL_GANTRY_CALIBRATION) @@ -3819,6 +3948,11 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." #error "TOUCH_CALIBRATION_[XY] and TOUCH_OFFSET_[XY] are required for resistive touch screens with TOUCH_SCREEN_CALIBRATION disabled." #endif +// GT911 Capacitive touch screen such as BIQU_BX_TFT70 +#if ALL(TFT_TOUCH_DEVICE_GT911, TOUCH_SCREEN_CALIBRATION) + #error "TOUCH_SCREEN_CALIBRATION is not supported by the selected LCD controller." +#endif + /** * Sanity check WiFi options */ @@ -3830,11 +3964,11 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." #if !(defined(WIFI_SSID) && defined(WIFI_PWD)) #error "ESP32 motherboard with WIFISUPPORT requires WIFI_SSID and WIFI_PWD." #endif -#elif ENABLED(WIFI_CUSTOM_COMMAND) +#elif ENABLED(WIFI_CUSTOM_COMMAND) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT) #error "WIFI_CUSTOM_COMMAND requires an ESP32 motherboard and WIFISUPPORT." -#elif ENABLED(OTASUPPORT) +#elif ENABLED(OTASUPPORT) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT) #error "OTASUPPORT requires an ESP32 motherboard and WIFISUPPORT." -#elif defined(WIFI_SSID) || defined(WIFI_PWD) +#elif (defined(WIFI_SSID) || defined(WIFI_PWD)) && NONE(ESP3D_WIFISUPPORT, WIFISUPPORT) #error "WIFI_SSID and WIFI_PWD only apply to ESP32 motherboard with WIFISUPPORT." #endif @@ -3860,7 +3994,7 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." * Sanity Check for Slim LCD Menus and Probe Offset Wizard */ #if ALL(SLIM_LCD_MENUS, PROBE_OFFSET_WIZARD) - #error "SLIM_LCD_MENUS disables \"Advanced Settings > Probe Offsets > PROBE_OFFSET_WIZARD.\"" + #error "SLIM_LCD_MENUS disables 'Advanced Settings > Probe Offsets > PROBE_OFFSET_WIZARD.'" #endif /** @@ -4074,7 +4208,12 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." */ #if HAS_ZV_SHAPING #if ENABLED(DELTA) - #error "Input Shaping is not compatible with DELTA kinematics." + #if !ALL(INPUT_SHAPING_X, INPUT_SHAPING_Y, INPUT_SHAPING_Z) + #error "INPUT_SHAPING_X, INPUT_SHAPING_Y and INPUT_SHAPING_Z must all be enabled for DELTA." + #else + static_assert(SHAPING_FREQ_X == SHAPING_FREQ_Y && SHAPING_FREQ_Y == SHAPING_FREQ_Z, "SHAPING_FREQ_X, SHAPING_FREQ_Y and SHAPING_FREQ_Z must be the same for DELTA."); + static_assert(SHAPING_ZETA_X == SHAPING_ZETA_Y && SHAPING_ZETA_Y == SHAPING_ZETA_Z, "SHAPING_ZETA_X, SHAPING_ZETA_Y and SHAPING_ZETA_Z must be the same for DELTA."); + #endif #elif ENABLED(SCARA) #error "Input Shaping is not compatible with SCARA kinematics." #elif ENABLED(TPARA) @@ -4086,9 +4225,19 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." #elif ENABLED(DIRECT_STEPPING) #error "Input Shaping is not compatible with DIRECT_STEPPING." #elif ALL(INPUT_SHAPING_X, CORE_IS_XZ) - #error "INPUT_SHAPING_X is not supported with COREXZ." + #if !ALL(INPUT_SHAPING_X, INPUT_SHAPING_Z) + #error "INPUT_SHAPING_X and INPUT_SHAPING_Z must both be enabled for COREXZ." + #else + static_assert(SHAPING_FREQ_X == SHAPING_FREQ_Z, "SHAPING_FREQ_X and SHAPING_FREQ_Z must be the same for COREXZ."); + static_assert(SHAPING_ZETA_X == SHAPING_ZETA_Z, "SHAPING_ZETA_X and SHAPING_ZETA_Z must be the same for COREXZ."); + #endif #elif ALL(INPUT_SHAPING_Y, CORE_IS_YZ) - #error "INPUT_SHAPING_Y is not supported with COREYZ." + #if !ALL(INPUT_SHAPING_Y, INPUT_SHAPING_Z) + #error "INPUT_SHAPING_Y and INPUT_SHAPING_Z must both be enabled for COREYZ." + #else + static_assert(SHAPING_FREQ_Y == SHAPING_FREQ_Z, "SHAPING_FREQ_Y and SHAPING_FREQ_Z must be the same for COREYZ."); + static_assert(SHAPING_ZETA_Y == SHAPING_ZETA_Z, "SHAPING_ZETA_Y and SHAPING_ZETA_Z must be the same for COREYZ."); + #endif #elif ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) #if !ALL(INPUT_SHAPING_X, INPUT_SHAPING_Y) #error "INPUT_SHAPING_X and INPUT_SHAPING_Y must both be enabled for COREXY, COREYX, or MARKFORGED_*." @@ -4103,6 +4252,7 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." #else TERN_(INPUT_SHAPING_X, static_assert((SHAPING_FREQ_X) > 0, "SHAPING_FREQ_X must be > 0 or SHAPING_MIN_FREQ must be set.")); TERN_(INPUT_SHAPING_Y, static_assert((SHAPING_FREQ_Y) > 0, "SHAPING_FREQ_Y must be > 0 or SHAPING_MIN_FREQ must be set.")); + TERN_(INPUT_SHAPING_Z, static_assert((SHAPING_FREQ_Z) > 0, "SHAPING_FREQ_Z must be > 0 or SHAPING_MIN_FREQ must be set.")); #endif #ifdef __AVR__ #if ENABLED(INPUT_SHAPING_X) @@ -4119,6 +4269,13 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (16) for AVR 16MHz."); #endif #endif + #if ENABLED(INPUT_SHAPING_Z) + #if F_CPU > 16000000 + static_assert((SHAPING_FREQ_Z) == 0 || (SHAPING_FREQ_Z) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Z is below the minimum (20) for AVR 20MHz."); + #else + static_assert((SHAPING_FREQ_Z) == 0 || (SHAPING_FREQ_Z) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Z is below the minimum (16) for AVR 16MHz."); + #endif + #endif #endif #endif @@ -4149,6 +4306,10 @@ static_assert(WITHIN(MULTISTEPPING_LIMIT, 1, 128) && IS_POWER_OF_2(MULTISTEPPING #endif #endif +#if ALL(ULTIPANEL_FEEDMULTIPLY, ULTIPANEL_FLOWPERCENT) + #error "Only enable ULTIPANEL_FEEDMULTIPLY or ULTIPANEL_FLOWPERCENT, but not both." +#endif + // Misc. Cleanup #undef _TEST_PWM #undef _NUM_AXES_STR diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d3d3af9cb9..fe24634b83 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2024-01-14" + #define STRING_DISTRIBUTION_DATE "2024-05-24" #endif /** diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 519bb7651a..8fc775d4c2 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -31,6 +31,24 @@ // Warnings! Located here so they will appear just once in the build output. // +// static_warning works like a static_assert but only emits a (messy) warning. +#ifdef __GNUC__ + namespace mfwarn { + struct true_type {}; + struct false_type {}; + template struct converter : public true_type {}; + template <> struct converter<0> : public false_type {}; + } + #define static_warning(cond, msg) \ + struct CAT(static_warning, __LINE__) { \ + void _(::mfwarn::false_type const&) __attribute__((deprecated(msg))) {}; \ + void _(::mfwarn::true_type const&) {}; \ + CAT(static_warning, __LINE__)() {_(::mfwarn::converter<(cond)>());} \ + } +#else + #define static_warning(...) +#endif + #if ENABLED(MARLIN_DEV_MODE) #warning "WARNING! Disable MARLIN_DEV_MODE for the final build!" #ifdef __LONG_MAX__ @@ -81,8 +99,8 @@ #warning "Warning! Don't use dummy thermistors (998/999) for final build!" #endif -#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT) - #warning "Your Configuration provides no method to acquire user feedback!" +#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT, UNIT_TEST, NO_USER_FEEDBACK_WARNING) + #warning "Your Configuration provides no method to acquire user feedback! (Define NO_USER_FEEDBACK_WARNING to suppress this warning.)" #endif #if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_BOARD @@ -664,24 +682,30 @@ #endif #if ENABLED(EMIT_CREALITY_422_WARNING) && DISABLED(NO_CREALITY_422_DRIVER_WARNING) - #warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label (typically on SD Card module) and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225, H8=HR4988). (Define NO_CREALITY_422_DRIVER_WARNING to suppress this warning.)" + // Driver labels: A=TMC2208, B=TMC2209, C=HR4988, E=A4988, H=TMC2225, H8=HR4988 + #warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label (typically on SD Card module) and set the correct *_DRIVER_TYPE! (A/H: TMC2208_STANDALONE B: TMC2209_STANDALONE C/E/H8: A4988). (Define NO_CREALITY_422_DRIVER_WARNING to suppress this warning.)" #endif #if ENABLED(PRINTCOUNTER_SYNC) #warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save." #endif -#if HOMING_Z_WITH_PROBE && IS_CARTESIAN && DISABLED(Z_SAFE_HOMING) - #error "Z_SAFE_HOMING is recommended when homing with a probe. Enable Z_SAFE_HOMING or comment out this line to continue." +#if HOMING_Z_WITH_PROBE && IS_CARTESIAN && NONE(Z_SAFE_HOMING, NO_Z_SAFE_HOMING_WARNING) + #error "Z_SAFE_HOMING is recommended when homing with a probe. (Enable Z_SAFE_HOMING or define NO_Z_SAFE_HOMING_WARNING to suppress this warning.)" +#endif + +#if ENABLED(BIQU_MICROPROBE_V2) && NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, NO_MICROPROBE_WARNING) + #warning "BIQU MicroProbe V2 detect signal requires a strong pull-up. Some processors have weak internal pull-up capabilities, so we recommended connecting MicroProbe SIGNAL / GND to Z-MIN / Z-STOP instead of the dedicated PROBE port. (Define NO_MICROPROBE_WARNING to suppress this warning.)" #endif // // Warn users of potential endstop/DIAG pin conflicts to prevent homing issues when not using sensorless homing // -#if !USE_SENSORLESS +#if !USE_SENSORLESS && HAS_DIAG_PINS #if ENABLED(USES_DIAG_JUMPERS) && DISABLED(DIAG_JUMPERS_REMOVED) #warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled. (Define DIAG_JUMPERS_REMOVED to suppress this warning.)" - #elif ENABLED(USES_DIAG_PINS) && DISABLED(DIAG_PINS_REMOVED) + #endif + #if ENABLED(USES_DIAG_PINS) && DISABLED(DIAG_PINS_REMOVED) #warning "Driver DIAG pins must be physically removed unless SENSORLESS_HOMING is enabled. (See https://bit.ly/2ZPRlt0) (Define DIAG_PINS_REMOVED to suppress this warning.)" #endif #endif @@ -694,8 +718,8 @@ #warning "Disabled CONFIGURATION_EMBEDDING because the target usually has less flash storage. Define FORCE_CONFIG_EMBED to override." #endif -#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX - #warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX." +#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX && DISABLED(NO_LCD_CONTRAST_WARNING) + #warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX. (Define NO_LCD_CONTRAST_WARNING to suppress this warning.)" #endif #if PROGRESS_MSG_EXPIRE > 0 && HAS_STATUS_MESSAGE_TIMEOUT @@ -764,8 +788,13 @@ /** * Input Shaping */ -#if HAS_ZV_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) - #warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental." +#if HAS_ZV_SHAPING + #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) + #warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental." + #endif + #if ENABLED(I2S_STEPPER_STREAM) + #warning "Input Shaping has not been tested with I2S_STEPPER_STREAM." + #endif #endif /** @@ -840,3 +869,10 @@ #if DISABLED(EDITABLE_STEPS_PER_UNIT) #warning "EDITABLE_STEPS_PER_UNIT is required to enable G92 runtime configuration of steps-per-unit." #endif + +/** + * HC32 clock speed is hard-coded in Marlin + */ +#if defined(ARDUINO_ARCH_HC32) && F_CPU == 200000000 + #warning "HC32 clock is assumed to be 200MHz. If this isn't the case for your board please submit a report so we can add support." +#endif diff --git a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp index b05a8e81d9..dd1ba06a78 100644 --- a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp +++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp @@ -449,7 +449,6 @@ static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = { {IV('⭢'), 0xC7, 0}, {IV('⭣'), 0xC6, 0}, - {IV('⯆'), 0xF5, 0}, {IV('⯇'), 0xF7, 0}, // ⯅ {IV('⯈'), 0xF6, 0}, @@ -500,7 +499,6 @@ static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = { //{IV(''), 0x9E, 0}, //{IV(''), 0x9F, 0}, - {IV('¼'), 0xF0, 0}, // 00BC {IV('⅓'), 0xF1, 0}, {IV('½'), 0xF2, 0}, // 00BD diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 155ae581f0..ea73243250 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -331,15 +331,24 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS #endif // HAS_MEDIA - #if ENABLED(SHOW_BOOTSCREEN) - // Set boot screen corner characters - if (screen_charset == CHARSET_BOOT) { - for (uint8_t i = 4; i--;) - createChar_P(i, corner[i]); - } - else - #endif - { // Info Screen uses 5 special characters + switch (screen_charset) { + + #if ENABLED(SHOW_BOOTSCREEN) + case CHARSET_BOOT: { + // Set boot screen corner characters + for (uint8_t i = 4; i--;) createChar_P(i, corner[i]); + } break; + #endif + + #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + case CHARSET_BOOT_CUSTOM: { + for (uint8_t i = COUNT(customBootChars); i--;) + createChar_P(i, customBootChars[i]); + } break; + #endif + + default: { + // Info Screen uses 5 special characters createChar_P(LCD_STR_BEDTEMP[0], bedTemp); createChar_P(LCD_STR_DEGREE[0], degree); createChar_P(LCD_STR_THERMOMETER[0], thermometer); @@ -361,7 +370,9 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS createChar_P(LCD_STR_FOLDER[0], folder); #endif } - } + } break; + + } } @@ -400,6 +411,42 @@ bool MarlinUI::detected() { return TERN1(DETECT_I2C_LCD_DEVICE, lcd.LcdDetected() == 1); } +#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + + #ifndef CUSTOM_BOOTSCREEN_X + #define CUSTOM_BOOTSCREEN_X -1 + #endif + #ifndef CUSTOM_BOOTSCREEN_Y + #define CUSTOM_BOOTSCREEN_Y ((LCD_HEIGHT - COUNT(custom_boot_lines)) / 2) + #endif + #ifndef CUSTOM_BOOTSCREEN_TIMEOUT + #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 + #endif + + void MarlinUI::draw_custom_bootscreen(const uint8_t/*=0*/) { + set_custom_characters(CHARSET_BOOT_CUSTOM); + lcd.clear(); + const int8_t sx = CUSTOM_BOOTSCREEN_X; + const uint8_t sy = CUSTOM_BOOTSCREEN_Y; + for (lcd_uint_t i = 0; i < COUNT(custom_boot_lines); ++i) { + PGM_P const pstr = (PGM_P)pgm_read_ptr(&custom_boot_lines[i]); + const uint8_t clen = utf8_strlen_P(pstr); + const lcd_uint_t x = sx >= 0 ? sx : (LCD_WIDTH - clen) / 2; + for (lcd_uint_t j = 0; j < clen; ++j) { + const lchar_t c = pgm_read_byte(&pstr[j]); + lcd_put_lchar(x + j, sy + i, c == '\x08' ? '\x00' : c); + } + } + } + + // Shows the custom bootscreen and delays + void MarlinUI::show_custom_bootscreen() { + draw_custom_bootscreen(); + safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT); + } + +#endif // SHOW_CUSTOM_BOOTSCREEN + #if HAS_SLOW_BUTTONS uint8_t MarlinUI::read_slow_buttons() { #if ENABLED(LCD_I2C_TYPE_MCP23017) @@ -466,6 +513,8 @@ void MarlinUI::clear_lcd() { lcd.clear(); } } void MarlinUI::show_bootscreen() { + TERN_(SHOW_CUSTOM_BOOTSCREEN, show_custom_bootscreen()); + set_custom_characters(CHARSET_BOOT); lcd.clear(); @@ -660,9 +709,6 @@ FORCE_INLINE void _draw_bed_status(const bool blink) { lcd_put_u8str(F("K")); #else lcd_put_u8str(cutter_power2str(cutter.unitPower)); - #if CUTTER_UNIT_IS(PERCENT) - lcd_put_u8str(F("%")); - #endif #endif lcd_put_u8str(F(" ")); @@ -793,11 +839,11 @@ void MarlinUI::draw_status_message(const bool blink) { static lcd_uint_t pc = 0, pr = 2; inline void setPercentPos(const lcd_uint_t c, const lcd_uint_t r) { pc = c; pr = r; } void MarlinUI::drawPercent() { - const uint8_t progress = ui.get_progress_percent(); + const uint8_t progress = get_progress_percent(); if (progress) { lcd_moveto(pc, pr); lcd_put_u8str(F(TERN(IS_SD_PRINTING, "SD", "P:"))); - lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui8tostr3rj(progress))); + lcd_put_u8str(TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(get_progress_permyriad()), ui8tostr3rj(progress))); lcd_put_u8str(F("%")); } } @@ -806,9 +852,9 @@ void MarlinUI::draw_status_message(const bool blink) { #if ENABLED(SHOW_REMAINING_TIME) void MarlinUI::drawRemain() { if (printJobOngoing()) { - const duration_t remaint = ui.get_remaining_time(); + const duration_t remaint = get_remaining_time(); timepos = TPOFFSET - remaint.toDigital(buffer); - TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);) + IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20)); lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'R'); lcd_put_u8str(buffer); } @@ -817,10 +863,10 @@ void MarlinUI::draw_status_message(const bool blink) { #if ENABLED(SHOW_INTERACTION_TIME) void MarlinUI::drawInter() { - const duration_t interactt = ui.interaction_time; + const duration_t interactt = interaction_time; if (printingIsActive() && interactt.value) { timepos = TPOFFSET - interactt.toDigital(buffer); - TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);) + IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20)); lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'C'); lcd_put_u8str(buffer); } @@ -832,7 +878,7 @@ void MarlinUI::draw_status_message(const bool blink) { if (printJobOngoing()) { const duration_t elapsedt = print_job_timer.duration(); timepos = TPOFFSET - elapsedt.toDigital(buffer); - TERN_(NOT(LCD_INFO_SCREEN_STYLE), lcd_put_lchar(timepos - 1, 2, 0x20);) + IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20)); lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'E'); lcd_put_u8str(buffer); } @@ -1139,7 +1185,39 @@ void MarlinUI::draw_status_screen() { TERN_(SHOW_PROGRESS_PERCENT, setPercentPos(LCD_WIDTH - 9, 2)); rotate_progress(); #endif - #endif // LCD_INFO_SCREEN_STYLE 1 + + #elif LCD_INFO_SCREEN_STYLE == 2 + + // ========== Line 1 ========== + + // + // X Coordinate + // + lcd_moveto(0, 0); + _draw_axis_value(X_AXIS, ftostr52sp(LOGICAL_X_POSITION(current_position.x)), blink); + + // + // Y Coordinate + // + lcd_moveto(LCD_WIDTH - 9, 0); + _draw_axis_value(Y_AXIS, ftostr52sp(LOGICAL_Y_POSITION(current_position.y)), blink); + + // ========== Line 2 ========== + lcd_moveto(0, 1); + _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink); + + lcd_moveto(LCD_WIDTH - 9, 1); + _draw_axis_value(I_AXIS, ftostr52sp(LOGICAL_I_POSITION(current_position.i)), blink); + + // ========== Line 3 ========== + lcd_moveto(0, 2); + lcd_put_lchar('F'); + + lcd_moveto(LCD_WIDTH - 9, 2); + lcd_put_lchar('S'); + + + #endif // LCD_INFO_SCREEN_STYLE // ========= Last Line ======== diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.h b/Marlin/src/lcd/HD44780/marlinui_HD44780.h index 6f6f5a6855..15f268f8d9 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.h +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.h @@ -27,6 +27,20 @@ #include "../../inc/MarlinConfig.h" +#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + + #include "../../../_Bootscreen.h" + + #ifdef CUSTOM_BOOTSCREEN_Y + #define CUSTOM_BOOT_LAST COUNT(custom_boot_lines) + CUSTOM_BOOTSCREEN_Y + #else + #define CUSTOM_BOOT_LAST COUNT(custom_boot_lines) + #endif + + static_assert(CUSTOM_BOOT_LAST <= LCD_HEIGHT, "custom_boot_lines (plus CUSTOM_BOOTSCREEN_Y) doesn't fit on the selected LCD."); + +#endif + #if ENABLED(LCD_I2C_TYPE_PCF8575) // NOTE: These are register-mapped pins on the PCF8575 controller, not Arduino pins. diff --git a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp index 666ad2bbc1..c0b9975014 100644 --- a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp @@ -446,7 +446,6 @@ static const TFTGLCD_charmap_t g_TFTGLCD_charmap_device[] PROGMEM = { {IV('⭢'), 0xC7, 0}, {IV('⭣'), 0xC6, 0}, - {IV('⯆'), 0xF5, 0}, {IV('⯇'), 0xF7, 0}, // ⯅ {IV('⯈'), 0xF6, 0}, diff --git a/Marlin/src/lcd/buttons.h b/Marlin/src/lcd/buttons.h index 601e8a70ae..2bd5fd7b35 100644 --- a/Marlin/src/lcd/buttons.h +++ b/Marlin/src/lcd/buttons.h @@ -24,9 +24,9 @@ #include "../inc/MarlinConfig.h" #if ((!HAS_ADC_BUTTONS && IS_NEWPANEL) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL - #define HAS_ENCODER_WHEEL 1 + #define HAS_MARLINUI_ENCODER 1 #endif -#if (HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DOWN, LEFT, RIGHT)) && DISABLED(TOUCH_UI_FTDI_EVE) +#if (HAS_MARLINUI_ENCODER || ANY_BUTTON(ENC, BACK, UP, DOWN, LEFT, RIGHT)) && DISABLED(TOUCH_UI_FTDI_EVE) #define HAS_DIGITAL_BUTTONS 1 #endif #if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL)) diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 1b53bb4bbe..1bc55630af 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -140,7 +140,7 @@ bool MarlinUI::detected() { return true; } uint8_t *dst = (uint8_t*)bmp; auto rle_nybble = [&](const uint16_t i) -> uint8_t { - const uint8_t b = bmp_rle[i / 2]; + const uint8_t b = pgm_read_byte(&bmp_rle[i / 2]); return (i & 1 ? b & 0xF : b >> 4); }; @@ -311,9 +311,6 @@ void MarlinUI::init_lcd() { #if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864, ZONESTAR_12864OLED, K3D_242_OLED_CONTROLLER) SET_OUTPUT(LCD_PINS_DC); - #ifndef LCD_RESET_PIN - #define LCD_RESET_PIN LCD_PINS_RS - #endif #endif #if PIN_EXISTS(LCD_RESET) @@ -380,7 +377,13 @@ void MarlinUI::draw_kill_screen() { void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop #if HAS_DISPLAY_SLEEP - void MarlinUI::sleep_display(const bool sleep) { sleep ? u8g.sleepOn() : u8g.sleepOff(); } + void MarlinUI::sleep_display(const bool sleep/*=true*/) { + static bool asleep = false; + if (asleep != sleep){ + sleep ? u8g.sleepOn() : u8g.sleepOff(); + asleep = sleep; + } + } #endif #if HAS_LCD_BRIGHTNESS diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.h b/Marlin/src/lcd/dogm/marlinui_DOGM.h index d23df6e2a3..9025395f56 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.h +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.h @@ -28,7 +28,7 @@ #include "../../inc/MarlinConfigPre.h" #include -#include "HAL_LCD_class_defines.h" +#include "u8g/HAL_LCD_class_defines.h" //#define ALTERNATIVE_LCD @@ -40,13 +40,16 @@ #ifdef __SAMD21__ #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL #else + // Hardware SPI on DUE #define U8G_CLASS U8GLIB_ST7920_128X64_4X #endif #define U8G_PARAM LCD_PINS_RS #elif (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN) + // Hardware SPI shared with SD Card #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL #define U8G_PARAM LCD_PINS_RS #else + // Software SPI #define U8G_CLASS U8GLIB_ST7920_128X64_4X #define U8G_PARAM LCD_PINS_D4, LCD_PINS_EN, LCD_PINS_RS #endif @@ -97,7 +100,7 @@ #define SMART_RAMPS MB(RAMPS_SMART_EFB, RAMPS_SMART_EEB, RAMPS_SMART_EFF, RAMPS_SMART_EEF, RAMPS_SMART_SF) #define U8G_CLASS U8GLIB_64128N_2X_HAL // 4 stripes (HW-SPI) - #if (SMART_RAMPS && defined(__SAM3X8E__)) || DOGLCD_SCK != SD_SCK_PIN || DOGLCD_MOSI != SD_MOSI_PIN + #if (SMART_RAMPS && defined(__SAM3X8E__)) || (defined(DOGLCD_SCK) && (DOGLCD_SCK != -1 && DOGLCD_SCK != SD_SCK_PIN)) || (defined(DOGLCD_MOSI) && (DOGLCD_MOSI != -1 && DOGLCD_MOSI != SD_MOSI_PIN)) #define FORCE_SOFT_SPI // SW-SPI #endif @@ -230,7 +233,7 @@ #if ENABLED(FORCE_SOFT_SPI) #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // SW-SPI #else - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI + #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI #endif #endif diff --git a/Marlin/src/lcd/dogm/status/hotend.h b/Marlin/src/lcd/dogm/status/hotend.h index aac29da451..ae21524ef5 100644 --- a/Marlin/src/lcd/dogm/status/hotend.h +++ b/Marlin/src/lcd/dogm/status/hotend.h @@ -90,6 +90,14 @@ #elif STATUS_HOTEND_BITMAPS > 1 + const unsigned char status_active_extruder_indicator_bmp[] PROGMEM = { + B00110000, + B00011000, + B00001100, + B00011000, + B00110000 + }; + #ifdef STATUS_HOTEND_ANIM const unsigned char status_hotend1_a_bmp[] PROGMEM = { diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index e294d9c3df..747e462b1d 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -323,6 +323,11 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co } // PAGE_CONTAINS + #if HAS_MULTI_EXTRUDER && NONE(SLIM_LCD_MENUS, STATUS_HOTEND_NUMBERLESS, SINGLENOZZLE) + if (active_extruder == heater_id) + u8g.drawBitmapP(_MAX(0, STATUS_HOTEND_X(heater_id) - 6), STATUS_HEATERS_Y + 3, 1, 5, status_active_extruder_indicator_bmp); + #endif + #endif // !STATUS_COMBINE_HEATERS if (PAGE_UNDER(7)) { @@ -371,7 +376,6 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co #define BAR_TALL (STATUS_HEATERS_HEIGHT - 2) - // Draw a heating progress bar, if specified #if ANY(STATUS_HEAT_PERCENT, STATUS_HEAT_POWER) uint8_t tall = 0; @@ -888,7 +892,12 @@ void MarlinUI::draw_status_screen() { lcd_put_lchar(3, EXTRAS_2_BASELINE, LCD_STR_FEEDRATE[0]); set_font(FONT_STATUSMENU); - lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3rj(feedrate_percentage)); + + #if ENABLED(ULTIPANEL_FLOWPERCENT) + lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3rj(planner.flow_percentage[active_extruder])); + #else + lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3rj(feedrate_percentage)); + #endif lcd_put_u8str(F("%")); // diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index 4eb031e538..a9e8bb5646 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -886,7 +886,7 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { * If STATUS_EXPIRE_SECONDS is zero, only the status is shown. */ if (forceUpdate || status_changed()) { - TERN_(STATUS_MESSAGE_SCROLLING, ui.status_scroll_offset = 0); + TERN_(STATUS_MESSAGE_SCROLLING, ui.reset_status_scroll()); #if STATUS_EXPIRE_SECONDS countdown = !ui.status_message.empty() ? STATUS_EXPIRE_SECONDS : 0; #endif diff --git a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h b/Marlin/src/lcd/dogm/u8g/HAL_LCD_class_defines.h similarity index 99% rename from Marlin/src/lcd/dogm/HAL_LCD_class_defines.h rename to Marlin/src/lcd/dogm/u8g/HAL_LCD_class_defines.h index dc40aba046..907fa43c9b 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h +++ b/Marlin/src/lcd/dogm/u8g/HAL_LCD_class_defines.h @@ -21,7 +21,7 @@ */ #pragma once -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" // use this file to create the public interface for device drivers that are NOT in the U8G library @@ -103,7 +103,6 @@ public: void init(uint8_t cs, uint8_t rs, uint8_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_tft_320x240_upscale_from_128x64, cs, rs, reset); } }; - extern u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, u8g_dev_uc1701_mini12864_HAL_2x_hw_spi; class U8GLIB_MINI12864_2X_HAL : public U8GLIB { diff --git a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin/src/lcd/dogm/u8g/HAL_LCD_com_defines.h similarity index 97% rename from Marlin/src/lcd/dogm/HAL_LCD_com_defines.h rename to Marlin/src/lcd/dogm/u8g/HAL_LCD_com_defines.h index a70e2b7b8b..e94c753807 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ b/Marlin/src/lcd/dogm/u8g/HAL_LCD_com_defines.h @@ -27,7 +27,7 @@ #include -#include HAL_PATH(../.., u8g/LCD_defines.h) +#include HAL_PATH(../../.., u8g/LCD_defines.h) #if HAS_FSMC_GRAPHICAL_TFT || HAS_SPI_GRAPHICAL_TFT || HAS_LTDC_GRAPHICAL_TFT uint8_t u8g_com_hal_tft_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); diff --git a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp similarity index 99% rename from Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp index b3e579e6a4..4cd9b8f3c0 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp @@ -65,7 +65,7 @@ * beginning. */ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_MARLINUI_U8GLIB @@ -230,12 +230,10 @@ uint8_t u8g_dev_ssd1306_128x64_2x_2_wire_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg); } - uint8_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire_buf[WIDTH*2] U8G_NOCOMMON ; u8g_pb_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_ssd1306_128x64_2x_i2c_2_wire_buf}; u8g_dev_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire = { u8g_dev_ssd1306_128x64_2x_2_wire_fn, &u8g_dev_ssd1306_128x64_2x_i2c_2_wire_pb, U8G_COM_SSD_I2C_HAL }; - ///////////////////////////////////////////////////////////////////////////////////////////// // This routine adds the instruction byte in between the command bytes. This makes the init diff --git a/Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1309_12864.cpp similarity index 99% rename from Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1309_12864.cpp index 6d40ea0d4b..4aa90d5e8e 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_ssd1309_12864.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_ssd1309_12864.cpp @@ -20,7 +20,7 @@ * */ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_MARLINUI_U8GLIB diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_st7565_64128n_HAL.cpp similarity index 99% rename from Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_st7565_64128n_HAL.cpp index 63e7b2e2b8..61a1e214bd 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_st7565_64128n_HAL.cpp @@ -53,7 +53,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if HAS_MARLINUI_U8GLIB @@ -234,7 +234,6 @@ uint8_t u8g_dev_st7565_64128n_HAL_2x_buf[WIDTH*2] U8G_NOCOMMON ; u8g_pb_t u8g_dev_st7565_64128n_HAL_2x_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_st7565_64128n_HAL_2x_buf}; u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_sw_spi = { u8g_dev_st7565_64128n_HAL_2x_fn, &u8g_dev_st7565_64128n_HAL_2x_pb, U8G_COM_HAL_SW_SPI_FN }; - U8G_PB_DEV(u8g_dev_st7565_64128n_HAL_hw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7565_64128n_HAL_fn, U8G_COM_HAL_HW_SPI_FN); u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi = { u8g_dev_st7565_64128n_HAL_2x_fn, &u8g_dev_st7565_64128n_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN }; diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_st7920_128x64_HAL.cpp similarity index 91% rename from Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_st7920_128x64_HAL.cpp index ae1531e9f8..fb9d4b7ad6 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_st7920_128x64_HAL.cpp @@ -53,7 +53,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_MARLINUI_U8GLIB && DISABLED(TFT_CLASSIC_UI) @@ -84,19 +84,19 @@ static const uint8_t u8g_dev_st7920_128x64_HAL_init_seq[] PROGMEM = { void clear_graphics_DRAM(u8g_t *u8g, u8g_dev_t *dev) { u8g_SetChipSelect(u8g, dev, 1); u8g_Delay(1); - u8g_SetAddress(u8g, dev, 0); // cmd mode - u8g_WriteByte(u8g, dev, 0x08); //display off, cursor+blink off - u8g_WriteByte(u8g, dev, 0x3E); //extended mode + GDRAM active - for (uint8_t y = 0; y < (LCD_PIXEL_HEIGHT) / 2; ++y) { //clear GDRAM - u8g_WriteByte(u8g, dev, 0x80 | y); //set y - u8g_WriteByte(u8g, dev, 0x80); //set x = 0 - u8g_SetAddress(u8g, dev, 1); /* data mode */ - for (uint8_t i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; ++i) //2x width clears both segments + u8g_SetAddress(u8g, dev, 0); // Cmd mode + u8g_WriteByte(u8g, dev, 0x08); // Display off, cursor+blink off + u8g_WriteByte(u8g, dev, 0x3E); // Extended mode + GDRAM active + for (uint8_t y = 0; y < (LCD_PIXEL_HEIGHT) / 2; ++y) { // Clear GDRAM + u8g_WriteByte(u8g, dev, 0x80 | y); // Set y + u8g_WriteByte(u8g, dev, 0x80); // Set x = 0 + u8g_SetAddress(u8g, dev, 1); // Data mode + for (uint8_t i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; ++i) // 2x width clears both segments u8g_WriteByte(u8g, dev, 0); - u8g_SetAddress(u8g, dev, 0); /* cmd mode */ + u8g_SetAddress(u8g, dev, 0); // Cmd mode } - u8g_WriteByte(u8g, dev, 0x0C); //display on, cursor+blink off + u8g_WriteByte(u8g, dev, 0x0C); // Display on, cursor+blink off u8g_SetChipSelect(u8g, dev, 0); } diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_tft_upscale_from_128x64.cpp similarity index 95% rename from Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_tft_upscale_from_128x64.cpp index c6aff38dc9..73b35b0ec2 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_tft_upscale_from_128x64.cpp @@ -53,12 +53,12 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if HAS_MARLINUI_U8GLIB && (PIN_EXISTS(FSMC_CS) || HAS_SPI_GRAPHICAL_TFT || HAS_LTDC_GRAPHICAL_TFT) #include "HAL_LCD_com_defines.h" -#include "marlinui_DOGM.h" +#include "../marlinui_DOGM.h" #include @@ -66,7 +66,7 @@ #define HAS_LCD_IO 1 #endif -#include "../tft_io/tft_io.h" +#include "../../tft_io/tft_io.h" TFT_IO tftio; #define WIDTH LCD_PIXEL_WIDTH @@ -74,21 +74,17 @@ TFT_IO tftio; #define PAGE_HEIGHT 8 #if ENABLED(TOUCH_SCREEN_CALIBRATION) - #include "../tft_io/touch_calibration.h" - #include "../marlinui.h" + #include "../../tft_io/touch_calibration.h" + #include "../../marlinui.h" #endif -#if HAS_TOUCH_BUTTONS && HAS_TOUCH_SLEEP - #define HAS_TOUCH_BUTTONS_SLEEP 1 -#endif - -#include "../touch/touch_buttons.h" -#include "../scaled_tft.h" +#include "../../touch/touch_buttons.h" +#include "../../scaled_tft.h" #define X_HI (UPSCALE(TFT_PIXEL_OFFSET_X, WIDTH) - 1) #define Y_HI (UPSCALE(TFT_PIXEL_OFFSET_Y, HEIGHT) - 1) -// RGB565 color picker: https://embeddednotepad.com/page/rgb565-color-picker +// RGB565 color picker: https://rgbcolorpicker.com/565 // Hex code to color name: https://www.color-name.com/ #define COLOR_BLACK 0x0000 // #000000 @@ -389,25 +385,29 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u case U8G_DEV_MSG_PAGE_FIRST: { page = 0; - #if HAS_TOUCH_BUTTONS_SLEEP - static bool sleepCleared; - if (touchBt.isSleeping()) { - if (!sleepCleared) { - sleepCleared = true; - u8g_upscale_clear_lcd(u8g, dev, buffer); - TERN_(HAS_TOUCH_BUTTONS, redrawTouchButtons = true); + #if HAS_TOUCH_BUTTONS + #if HAS_DISPLAY_SLEEP + static bool sleepCleared; + if (touchBt.isSleeping()) { + if (!sleepCleared) { + sleepCleared = true; + u8g_upscale_clear_lcd(u8g, dev, buffer); + redrawTouchButtons = true; + } + break; } - break; - } - else - sleepCleared = false; + else + sleepCleared = false; + #endif + drawTouchButtons(u8g, dev); #endif - TERN_(HAS_TOUCH_BUTTONS, drawTouchButtons(u8g, dev)); setWindow(u8g, dev, TFT_PIXEL_OFFSET_X, TFT_PIXEL_OFFSET_Y, X_HI, Y_HI); } break; case U8G_DEV_MSG_PAGE_NEXT: - if (TERN0(HAS_TOUCH_BUTTONS_SLEEP, touchBt.isSleeping())) break; + #if HAS_TOUCH_BUTTONS && HAS_DISPLAY_SLEEP + if (touchBt.isSleeping()) break; + #endif if (++page > (HEIGHT / PAGE_HEIGHT)) return 1; for (uint8_t y = 0; y < PAGE_HEIGHT; ++y) { diff --git a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp b/Marlin/src/lcd/dogm/u8g/u8g_dev_uc1701_mini12864_HAL.cpp similarity index 99% rename from Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp rename to Marlin/src/lcd/dogm/u8g/u8g_dev_uc1701_mini12864_HAL.cpp index 172afbd766..95ae2810f2 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g/u8g_dev_uc1701_mini12864_HAL.cpp @@ -53,7 +53,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if HAS_MARLINUI_U8GLIB diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp b/Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.cpp similarity index 98% rename from Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp rename to Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.cpp index 11cd7b14ba..cd7445e019 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ b/Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.cpp @@ -23,11 +23,11 @@ // NOTE - the HAL version of the rrd device uses a generic ST7920 device. // See u8g_dev_st7920_128x64_HAL.cpp for the HAL version. -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if ANY(__AVR__, ARDUINO_ARCH_STM32, ARDUINO_ARCH_ESP32) -#include "../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfig.h" #if IS_U8GLIB_ST7920 @@ -184,7 +184,7 @@ u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_rrd_st7920_128x64_fn, &u8 #pragma GCC reset_options #if ENABLED(LIGHTWEIGHT_UI) - #include "../../HAL/shared/HAL_ST7920.h" + #include "../../../HAL/shared/HAL_ST7920.h" void ST7920_cs() { ST7920_CS(); } void ST7920_ncs() { ST7920_NCS(); } void ST7920_set_cmd() { ST7920_SET_CMD(); } diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h b/Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.h similarity index 96% rename from Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h rename to Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.h index 9a565fc2ef..f965913341 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h +++ b/Marlin/src/lcd/dogm/u8g/ultralcd_st7920_u8glib_rrd_AVR.h @@ -24,8 +24,8 @@ // NOTE - the HAL version of the rrd device uses a generic ST7920 device. See the // file u8g_dev_st7920_128x64_HAL.cpp for the HAL version. -#include "../../inc/MarlinConfig.h" -#include "../../HAL/shared/Delay.h" +#include "../../../inc/MarlinConfig.h" +#include "../../../HAL/shared/Delay.h" #define ST7920_CLK_PIN LCD_PINS_D4 #define ST7920_DAT_PIN LCD_PINS_EN diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.cpp b/Marlin/src/lcd/e3v2/common/dwin_api.cpp index 4442b5847d..1688b24230 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.cpp +++ b/Marlin/src/lcd/e3v2/common/dwin_api.cpp @@ -153,21 +153,23 @@ void dwinFrameClear(const uint16_t color) { dwinSend(i); } -// Draw a point -// color: point color -// width: point width 0x01-0x0F -// height: point height 0x01-0x0F -// x,y: upper left point -void dwinDrawPoint(uint16_t color, uint8_t width, uint8_t height, uint16_t x, uint16_t y) { - size_t i = 0; - dwinByte(i, 0x02); - dwinWord(i, color); - dwinByte(i, width); - dwinByte(i, height); - dwinWord(i, x); - dwinWord(i, y); - dwinSend(i); -} +#if DISABLED(TJC_DISPLAY) + // Draw a point + // color: point color + // width: point width 0x01-0x0F + // height: point height 0x01-0x0F + // x,y: upper left point + void dwinDrawPoint(uint16_t color, uint8_t width, uint8_t height, uint16_t x, uint16_t y) { + size_t i = 0; + dwinByte(i, 0x02); + dwinWord(i, color); + dwinByte(i, width); + dwinByte(i, height); + dwinWord(i, x); + dwinWord(i, y); + dwinSend(i); + } +#endif // Draw a line // color: Line segment color @@ -234,7 +236,7 @@ void dwinFrameAreaMove(uint8_t mode, uint8_t dir, uint16_t dis, // *string: The string // rlimit: To limit the drawn string length void dwinDrawString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string, uint16_t rlimit/*=0xFFFF*/) { - #if NONE(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, IS_DWIN_MARLINUI) + #if ENABLED(DWIN_CREALITY_LCD) dwinDrawRectangle(1, bColor, x, y, x + (fontWidth(size) * strlen_P(string)), y + fontHeight(size)); #endif constexpr uint8_t widthAdjust = 0; diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.h b/Marlin/src/lcd/e3v2/common/dwin_api.h index f2392af55c..4878515032 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.h +++ b/Marlin/src/lcd/e3v2/common/dwin_api.h @@ -23,6 +23,12 @@ #include "../../../inc/MarlinConfig.h" +// +// e3v2/common/dwin_api.h +// +// Included by: e3v2/*/dwin_lcd.h +// + #if ENABLED(DWIN_MARLINUI_LANDSCAPE) #define DWIN_WIDTH 480 #define DWIN_HEIGHT 272 @@ -107,13 +113,6 @@ void dwinUpdateLCD(); // color: Clear screen color void dwinFrameClear(const uint16_t color); -// Draw a point -// color: point color -// width: point width 0x01-0x0F -// height: point height 0x01-0x0F -// x,y: upper left point -void dwinDrawPoint(uint16_t color, uint8_t width, uint8_t height, uint16_t x, uint16_t y); - // Draw a line // color: Line segment color // xStart/yStart: Start point @@ -152,6 +151,19 @@ inline void dwinDrawBox(uint8_t mode, uint16_t color, uint16_t xStart, uint16_t dwinDrawRectangle(mode, color, xStart, yStart, xStart + xSize - 1, yStart + ySize - 1); } +// Draw a point +// color: point color +// width: point width 0x01-0x0F +// height: point height 0x01-0x0F +// x,y: upper left point +#if ENABLED(TJC_DISPLAY) + inline void dwinDrawPoint(uint16_t color, uint8_t width, uint8_t height, uint16_t x, uint16_t y) { + dwinDrawBox(1, color, x, y, 1, 1); + } +#else + void dwinDrawPoint(uint16_t color, uint8_t width, uint8_t height, uint16_t x, uint16_t y); +#endif + // Move a screen area // mode: 0, circle shift; 1, translation // dir: 0=left, 1=right, 2=up, 3=down @@ -162,7 +174,6 @@ inline void dwinDrawBox(uint8_t mode, uint16_t color, uint16_t xStart, uint16_t void dwinFrameAreaMove(uint8_t mode, uint8_t dir, uint16_t dis, uint16_t color, uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd); - /*---------------------------------------- Text related functions ----------------------------------------*/ // Draw a string diff --git a/Marlin/src/lcd/e3v2/common/dwin_color.h b/Marlin/src/lcd/e3v2/common/dwin_color.h index 1e47d2e904..0185c39698 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_color.h +++ b/Marlin/src/lcd/e3v2/common/dwin_color.h @@ -22,15 +22,15 @@ #pragma once // Extended and default UI Colors -#define RGB(R,G,B) (R << 11) | (G << 5) | (B) // R,B: 0..31; G: 0..63 +#define RGB(R,G,B) (R << 11) | (G << 5) | (B) // R: 0..31, G: 0..63, B: 0..31 #define GetRColor(color) ((color >> 11) & 0x1F) #define GetGColor(color) ((color >> 5) & 0x3F) #define GetBColor(color) ((color >> 0) & 0x1F) // RGB565 colors: https://rgbcolorpicker.com/565 #define COLOR_WHITE 0xFFFF -#define COLOR_YELLOW RGB(0x1F,0x3F,0x00) -#define COLOR_RED RGB(0x1F,0x00,0x00) +#define COLOR_YELLOW RGB(0x1F, 0x3F, 0x00) +#define COLOR_RED RGB(0x1F, 0x00, 0x00) #define COLOR_ERROR_RED 0xB000 // Error! #define COLOR_BG_RED 0xF00F // Red background color #define COLOR_BG_WINDOW 0x31E8 // Popup background color diff --git a/Marlin/src/lcd/e3v2/common/dwin_font.h b/Marlin/src/lcd/e3v2/common/dwin_font.h index b92bfcf99c..a0becfc325 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_font.h +++ b/Marlin/src/lcd/e3v2/common/dwin_font.h @@ -21,6 +21,8 @@ */ #pragma once +#include + typedef uint8_t fontid_t; /** diff --git a/Marlin/src/lcd/e3v2/common/dwin_set.h b/Marlin/src/lcd/e3v2/common/dwin_set.h index ada7dec71f..f32d0e6d9e 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_set.h +++ b/Marlin/src/lcd/e3v2/common/dwin_set.h @@ -130,7 +130,7 @@ #define ICON_Folder ICON_More #define ICON_AdvSet ICON_Language -#define ICON_HomeOffset ICON_AdvSet +#define ICON_HomeOffset ICON_PrintSize #define ICON_HomeOffsetX ICON_StepX #define ICON_HomeOffsetY ICON_StepY #define ICON_HomeOffsetZ ICON_StepZ @@ -138,8 +138,8 @@ #define ICON_ProbeOffsetX ICON_StepX #define ICON_ProbeOffsetY ICON_StepY #define ICON_ProbeOffsetZ ICON_StepZ -#define ICON_PIDNozzle ICON_SetEndTemp -#define ICON_PIDBed ICON_SetBedTemp +#define ICON_PIDNozzle ICON_HotendTemp +#define ICON_PIDBed ICON_BedTemp #define ICON_FWRetract ICON_StepE #define ICON_FWRetLength ICON_StepE #define ICON_FWRetSpeed ICON_Setspeed diff --git a/Marlin/src/lcd/e3v2/common/encoder.cpp b/Marlin/src/lcd/e3v2/common/encoder.cpp index cb14596849..889d1c61f3 100644 --- a/Marlin/src/lcd/e3v2/common/encoder.cpp +++ b/Marlin/src/lcd/e3v2/common/encoder.cpp @@ -42,10 +42,6 @@ #include -#ifndef ENCODER_PULSES_PER_STEP - #define ENCODER_PULSES_PER_STEP 4 -#endif - EncoderRate encoderRate; // TODO: Replace with ui.quick_feedback @@ -53,32 +49,12 @@ void Encoder_tick() { TERN_(HAS_BEEPER, if (ui.sound_on) buzzer.click(10)); } -// Encoder initialization -void encoderConfiguration() { - #if BUTTON_EXISTS(EN1) - SET_INPUT_PULLUP(BTN_EN1); - #endif - #if BUTTON_EXISTS(EN2) - SET_INPUT_PULLUP(BTN_EN2); - #endif - #if BUTTON_EXISTS(ENC) - SET_INPUT_PULLUP(BTN_ENC); - #endif - #if HAS_BEEPER - SET_OUTPUT(BEEPER_PIN); // TODO: Use buzzer.h which already inits this - #endif -} - // Analyze encoder value and return state EncoderState encoderReceiveAnalyze() { const millis_t now = millis(); - static uint8_t lastEncoderBits; - uint8_t newbutton = 0; - static signed char temp_diff = 0; + static int8_t temp_diff = 0; // Cleared on each full step, as configured EncoderState temp_diffState = ENCODER_DIFF_NO; - if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; - if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; if (BUTTON_PRESSED(ENC)) { static millis_t next_click_update_ms; if (ELAPSED(now, next_click_update_ms)) { @@ -98,70 +74,47 @@ EncoderState encoderReceiveAnalyze() { } else return ENCODER_DIFF_NO; } - if (newbutton != lastEncoderBits) { - switch (newbutton) { - case 0: - if (lastEncoderBits == 1) temp_diff++; - else if (lastEncoderBits == 2) temp_diff--; - break; - case 2: - if (lastEncoderBits == 0) temp_diff++; - else if (lastEncoderBits == 3) temp_diff--; - break; - case 3: - if (lastEncoderBits == 2) temp_diff++; - else if (lastEncoderBits == 1) temp_diff--; - break; - case 1: - if (lastEncoderBits == 3) temp_diff++; - else if (lastEncoderBits == 0) temp_diff--; - break; - } - lastEncoderBits = newbutton; - } - if (ABS(temp_diff) >= ENCODER_PULSES_PER_STEP) { - if (temp_diff > 0) temp_diffState = TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CCW, ENCODER_DIFF_CW); - else temp_diffState = TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CW, ENCODER_DIFF_CCW); + temp_diff += ui.get_encoder_delta(); + + const int8_t abs_diff = ABS(temp_diff); + if (abs_diff >= ENCODER_PULSES_PER_STEP) { + temp_diffState = temp_diff > 0 + ? TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CCW, ENCODER_DIFF_CW) + : TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CW, ENCODER_DIFF_CCW); + + int32_t encoder_multiplier = 1; #if ENABLED(ENCODER_RATE_MULTIPLIER) - millis_t ms = millis(); - int32_t encoderMultiplier = 1; + const millis_t ms = millis(); - // if must encoder rati multiplier + // Encoder rate multiplier if (encoderRate.enabled) { - const float abs_diff = ABS(temp_diff), - encoderMovementSteps = abs_diff / (ENCODER_PULSES_PER_STEP); - if (encoderRate.lastEncoderTime) { - // Note that the rate is always calculated between two passes through the - // loop and that the abs of the temp_diff value is tracked. - const float encoderStepRate = encoderMovementSteps / float(ms - encoderRate.lastEncoderTime) * 1000; - if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; - else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; - #if ENCODER_5X_STEPS_PER_SEC - else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5; - #endif - } + // Note that the rate is always calculated between two passes through the + // loop and that the abs of the temp_diff value is tracked. + const float encoderStepRate = ((float(abs_diff) / float(ENCODER_PULSES_PER_STEP)) * 1000.0f) / float(ms - encoderRate.lastEncoderTime); encoderRate.lastEncoderTime = ms; + if (ENCODER_100X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) + encoder_multiplier = 100; + else if (ENCODER_10X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) + encoder_multiplier = 10; + else if (ENCODER_5X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) + encoder_multiplier = 5; } - #else - - constexpr int32_t encoderMultiplier = 1; - #endif - // encoderRate.encoderMoveValue += (temp_diff * encoderMultiplier) / (ENCODER_PULSES_PER_STEP); - encoderRate.encoderMoveValue = (temp_diff * encoderMultiplier) / (ENCODER_PULSES_PER_STEP); - if (encoderRate.encoderMoveValue < 0) encoderRate.encoderMoveValue = -encoderRate.encoderMoveValue; + encoderRate.encoderMoveValue = abs_diff * encoder_multiplier / (ENCODER_PULSES_PER_STEP); temp_diff = 0; } + if (temp_diffState != ENCODER_DIFF_NO) { TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout()); if (!ui.backlight) ui.refresh_brightness(); } + return temp_diffState; } diff --git a/Marlin/src/lcd/e3v2/common/encoder.h b/Marlin/src/lcd/e3v2/common/encoder.h index ce431c9811..428193ca65 100644 --- a/Marlin/src/lcd/e3v2/common/encoder.h +++ b/Marlin/src/lcd/e3v2/common/encoder.h @@ -47,9 +47,6 @@ typedef enum { #define ENCODER_WAIT_MS TERN(DWIN_LCD_PROUI, 10, 20) -// Encoder initialization -void encoderConfiguration(); - // Analyze encoder value and return state EncoderState encoderReceiveAnalyze(); diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index ea6265b419..7f057137d8 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -1816,7 +1816,11 @@ void hmiSDCardInit() { card.cdroot(); } // Initialize or re-initialize the LCD void MarlinUI::init_lcd() { dwinStartup(); } -void MarlinUI::refresh() { /* Nothing to see here */ } +void MarlinUI::update() { + eachMomentUpdate(); // Status update + hmiSDCardUpdate(); // SD card update + dwinHandleScreen(); // Rotary encoder update +} #if HAS_LCD_BRIGHTNESS void MarlinUI::_set_brightness() { dwinLCDBrightness(backlight ? brightness : 0); } @@ -4074,20 +4078,11 @@ void hmiInit() { } void dwinInitScreen() { - encoderConfiguration(); hmiInit(); hmiSetLanguageCache(); hmiStartFrame(true); } -void dwinUpdate() { - eachMomentUpdate(); // Status update - hmiSDCardUpdate(); // SD card update - dwinHandleScreen(); // Rotary encoder update -} - -void MarlinUI::update() { dwinUpdate(); } - void eachMomentUpdate() { static millis_t next_var_update_ms = 0, next_rts_update_ms = 0; @@ -4173,8 +4168,8 @@ void eachMomentUpdate() { gotoMainMenu(); } #if ENABLED(POWER_LOSS_RECOVERY) - else if (DWIN_lcd_sd_status && recovery.dwin_flag) { // resume print before power off - recovery.dwin_flag = false; + else if (DWIN_lcd_sd_status && recovery.ui_flag_resume) { // Resume interrupted print + recovery.ui_flag_resume = false; auto update_selection = [&](const bool sel) { hmiFlag.select_flag = sel; @@ -4201,7 +4196,7 @@ void eachMomentUpdate() { if (encoder_diffState == ENCODER_DIFF_ENTER) { recovery_flag = false; if (hmiFlag.select_flag) break; - TERN_(POWER_LOSS_RECOVERY, queue.inject(F("M1000C"))); + queue.inject(F("M1000C")); hmiStartFrame(true); return; } diff --git a/Marlin/src/lcd/e3v2/creality/dwin.h b/Marlin/src/lcd/e3v2/creality/dwin.h index 461c57f11c..fce52d8cf4 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.h +++ b/Marlin/src/lcd/e3v2/creality/dwin.h @@ -244,7 +244,6 @@ void hmiStep(); // Transmission ratio void hmiInit(); void dwinInitScreen(); -void dwinUpdate(); void eachMomentUpdate(); void dwinHandleScreen(); void dwinStatusChanged(const char * const cstr=nullptr); diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 856229b0d8..c9191dd31d 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -5143,7 +5143,6 @@ void MarlinUI::init_lcd() { if (dwinHandshake()) SERIAL_ECHOLNPGM("ok."); else SERIAL_ECHOLNPGM("error."); dwinFrameSetDir(1); // Orientation 90° dwinUpdateLCD(); // Show bootscreen (first image) - encoderConfiguration(); for (uint16_t t = 0; t <= 100; t += 2) { dwinIconShow(ICON, ICON_Bar, 15, 260); dwinDrawRectangle(1, COLOR_BG_BLACK, 15 + t * 242 / 100, 260, 257, 280); @@ -5158,6 +5157,7 @@ void MarlinUI::init_lcd() { #if ENABLED(ADVANCED_PAUSE_FEATURE) void MarlinUI::pause_show_message(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) { + if (mode != PAUSE_MODE_SAME) pause_mode = mode; switch (message) { case PAUSE_MESSAGE_INSERT: jyersDWIN.confirmHandler(Popup_FilInsert); break; case PAUSE_MESSAGE_PURGE: diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.h b/Marlin/src/lcd/e3v2/jyersui/dwin.h index 97c5a85ada..48e413efbb 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.h +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.h @@ -154,9 +154,8 @@ enum colorID : uint8_t { }; #define Custom_Colors 10 -#define COLOR_AQUA RGB(0x00,0x3F,0x1F) #define COLOR_LIGHT_WHITE 0xBDD7 -#define COLOR_GREEN RGB(0x00,0x3F,0x00) +#define COLOR_GREEN RGB(0x00, 0x3F, 0x00) #define COLOR_LIGHT_GREEN 0x3460 #define COLOR_CYAN 0x07FF #define COLOR_LIGHT_CYAN 0x04F3 diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.h b/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.h index dc6c79bd2d..ef81a7df77 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.h +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_lcd.h @@ -76,7 +76,3 @@ #include "../common/dwin_color.h" #define Color_Bg_Heading 0x3344 // Static Heading - -// Character matrix width x height -//#define LCD_WIDTH ((DWIN_WIDTH) / 8) -//#define LCD_HEIGHT ((DWIN_HEIGHT) / 12) diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h index 5d38131014..03f55233e2 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h @@ -525,7 +525,6 @@ const dwin_charmap_t g_dwin_charmap_device[] PROGMEM = { {IV('⭢'), 0xC7, 0}, {IV('⭣'), 0xC6, 0}, - {IV('⯆'), 0xF5, 0}, {IV('⯇'), 0xF7, 0}, // ⯅ {IV('⯈'), 0xF6, 0}, @@ -576,7 +575,6 @@ const dwin_charmap_t g_dwin_charmap_device[] PROGMEM = { //{IV(''), 0x9E, 0}, //{IV(''), 0x9F, 0}, - {IV('¼'), 0xF0, 0}, // 00BC {IV('⅓'), 0xF1, 0}, {IV('½'), 0xF2, 0}, // 00BD diff --git a/Marlin/src/lcd/e3v2/marlinui/marlinui_dwin.h b/Marlin/src/lcd/e3v2/marlinui/marlinui_dwin.h index a91cd19f6e..b8913914dd 100644 --- a/Marlin/src/lcd/e3v2/marlinui/marlinui_dwin.h +++ b/Marlin/src/lcd/e3v2/marlinui/marlinui_dwin.h @@ -72,6 +72,12 @@ extern dwin_font_t dwin_font; #define EXTRA_ROW_HEIGHT 8 #define MENU_LINE_HEIGHT (MENU_FONT_HEIGHT + EXTRA_ROW_HEIGHT) +// Character matrix width x height based on menu font +#define LCD_PIXEL_WIDTH DWIN_WIDTH +#define LCD_PIXEL_HEIGHT DWIN_HEIGHT +#define LCD_WIDTH ((LCD_PIXEL_WIDTH) / (MENU_FONT_WIDTH)) +#define LCD_HEIGHT ((LCD_PIXEL_HEIGHT) / (MENU_LINE_HEIGHT)) + #if DWIN_FONT_EDIT == font6x12 #define EDIT_FONT_WIDTH 6 #define EDIT_FONT_ASCENT 10 diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index f9318c75b9..4a60f77c9d 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -186,7 +186,7 @@ void MarlinUI::draw_status_message(const bool blink) { auto status_changed = []{ static MString<>::hash_t old_hash = 0x0000; - const MString<>::hash_t hash = ui.status_message.hash(); + const MString<>::hash_t hash = status_message.hash(); const bool hash_changed = hash != old_hash; old_hash = hash; return hash_changed || !did_first_redraw; @@ -219,7 +219,7 @@ void MarlinUI::draw_status_message(const bool blink) { const char *stat = status_and_len(rlen); lcd_put_u8str_max(stat, max_status_chars); - // If the string doesn't completely fill the line... + // If the remaining string doesn't completely fill the line... if (rlen < max_status_chars) { lcd_put_u8str(F(".")); // Always at 1+ spaces left, draw a dot uint8_t chars = max_status_chars - rlen; // Amount of space left in characters diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp index 2e3f360ee7..cab09715b7 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp @@ -22,9 +22,6 @@ /** * Bed Level Tools for Pro UI - * Extended by: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.2.0 - * Date: 2023/05/03 * * Based on the original work of: Henri-J-Norden * https://github.com/Jyers/Marlin/pull/126 @@ -156,7 +153,7 @@ void BedLevelTools::manualMove(const uint8_t mesh_x, const uint8_t mesh_y, bool } } -// Move / Probe methods. As examples, not yet used. +// Move / Probe methods. void BedLevelTools::moveToXYZ() { goto_mesh_value = true; manualMove(mesh_x, mesh_y, false); diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h index 6e568e32b5..a0da0ceeb3 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h @@ -22,9 +22,6 @@ /** * Bed Level Tools for Pro UI - * Extended by: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.2.0 - * Date: 2023/05/03 * * Based on the original work of: Henri-J-Norden * https://github.com/Jyers/Marlin/pull/126 diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 721859f1be..56c7fec517 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -22,7 +22,8 @@ /** * DWIN Enhanced implementation for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 3.25.3 * Date: 2023/05/18 */ @@ -37,6 +38,7 @@ #include "../../utf8.h" #include "../../marlinui.h" +#include "../../extui/ui_api.h" #include "../../../MarlinCore.h" #include "../../../core/serial.h" #include "../../../core/macros.h" @@ -158,6 +160,8 @@ #define MAX_ETEMP thermalManager.hotend_max_target(0) #define MIN_BEDTEMP 0 #define MAX_BEDTEMP BED_MAX_TARGET +#define MIN_CHAMBERTEMP 0 +#define MAX_CHAMBERTEMP CHAMBER_MAX_TARGET #define DWIN_VAR_UPDATE_INTERVAL 500 #define DWIN_UPDATE_INTERVAL 1000 @@ -243,11 +247,16 @@ Menu *stepsMenu = nullptr; #if ANY(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU) Menu *hotendMPCMenu = nullptr; #endif -#if ENABLED(PIDTEMP) && ANY(PID_EDIT_MENU, PID_AUTOTUNE_MENU) - Menu *hotendPIDMenu = nullptr; -#endif -#if ENABLED(PIDTEMPBED) && ANY(PID_EDIT_MENU, PID_AUTOTUNE_MENU) - Menu *bedPIDMenu = nullptr; +#if ANY(PID_EDIT_MENU, PID_AUTOTUNE_MENU) + #if ENABLED(PIDTEMP) + Menu *hotendPIDMenu = nullptr; + #endif + #if ENABLED(PIDTEMPBED) + Menu *bedPIDMenu = nullptr; + #endif + #if ENABLED(PIDTEMPCHAMBER) + Menu *chamberPIDMenu = nullptr; + #endif #endif #if CASELIGHT_USES_BRIGHTNESS Menu *caseLightMenu = nullptr; @@ -418,49 +427,50 @@ void popupPauseOrStop() { drawSelectHighlight(true); dwinUpdateLCD(); } - else - dwinPopupConfirmCancel(ICON_BLTouch, select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT_F(MSG_PAUSE_PRINT) : GET_TEXT_F(MSG_STOP_PRINT)); + else { + switch (select_print.now) { + case PRINT_PAUSE_RESUME: dwinPopupConfirmCancel(ICON_Pause_1, GET_TEXT_F(MSG_PAUSE_PRINT)); break; + case PRINT_STOP: dwinPopupConfirmCancel(ICON_Stop_1, GET_TEXT_F(MSG_STOP_PRINT)); break; + default: break; + } + } } -#if HAS_HOTEND - - void popupETempTooLow() { - if (hmiIsChinese()) { - hmiSaveProcessID(ID_WaitResponse); - DWINUI::clearMainArea(); - drawPopupBkgd(); - DWINUI::drawIcon(ICON_TempTooLow, 102, 105); - dwinFrameAreaCopy(1, 103, 371, 136, 386, 69, 240); - dwinFrameAreaCopy(1, 170, 371, 270, 386, 102, 240); - DWINUI::drawIconWB(ICON_Confirm_C, 86, 280); - dwinUpdateLCD(); - } - else - dwinPopupConfirm(ICON_TempTooLow, GET_TEXT_F(MSG_HOTEND_TOO_COLD), GET_TEXT_F(MSG_PLEASE_PREHEAT)); - } - -#endif - -#if HAS_HOTEND || HAS_HEATED_BED - void dwinPopupTemperature(const bool toohigh) { +#if HAS_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER + void dwinPopupTemperature(const int_fast8_t heater_id, const uint8_t state) { hmiSaveProcessID(ID_WaitResponse); if (hmiIsChinese()) { DWINUI::clearMainArea(); drawPopupBkgd(); - if (toohigh) { + if (state == 1) { DWINUI::drawIcon(ICON_TempTooHigh, 102, 165); dwinFrameAreaCopy(1, 103, 371, 237, 386, 52, 285); dwinFrameAreaCopy(1, 151, 389, 185, 402, 187, 285); dwinFrameAreaCopy(1, 189, 389, 271, 402, 95, 310); } - else { + else if (state == 0) { DWINUI::drawIcon(ICON_TempTooLow, 102, 165); dwinFrameAreaCopy(1, 103, 371, 270, 386, 52, 285); dwinFrameAreaCopy(1, 189, 389, 271, 402, 95, 310); } + else { + // Chinese "Temp Error" + } + } + else { + FSTR_P heaterstr = nullptr; + if (TERN0(HAS_HEATED_BED, heater_id == H_BED)) heaterstr = F("Bed"); + else if (TERN0(HAS_HEATED_CHAMBER, heater_id == H_CHAMBER)) heaterstr = F("Chamber"); + else if (TERN0(HAS_HOTEND, heater_id >= 0)) heaterstr = F("Nozzle"); + FSTR_P errorstr; + uint8_t icon; + switch (state) { + case 0: errorstr = GET_TEXT_F(MSG_TEMP_TOO_LOW); icon = ICON_TempTooLow; break; + case 1: errorstr = GET_TEXT_F(MSG_TEMP_TOO_HIGH); icon = ICON_TempTooHigh; break; + default: errorstr = GET_TEXT_F(MSG_ERR_HEATING_FAILED); icon = ICON_Temperature; break; // May be thermal runaway, temp malfunction, etc. + } + dwinShowPopup(icon, heaterstr, errorstr, BTN_Continue); } - else - dwinShowPopup(toohigh ? ICON_TempTooHigh : ICON_TempTooLow, F("Nozzle or Bed temperature"), toohigh ? F("is too high") : F("is too low"), BTN_Continue); } #endif @@ -513,14 +523,14 @@ void dwinDrawStatusMessage() { // Get a pointer to the next valid UTF8 character // and the string remaining length uint8_t rlen; - const char *stat = MarlinUI::status_and_len(rlen); + const char *stat = ui.status_and_len(rlen); dwinDrawRectangle(1, hmiData.colorStatusBg, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20); DWINUI::moveTo(0, STATUS_Y + 2); DWINUI::drawString(hmiData.colorStatusTxt, stat, LCD_WIDTH); // If the string doesn't completely fill the line... if (rlen < LCD_WIDTH) { - DWINUI::drawChar(hmiData.colorStatusTxt, '.'); // Always at 1+ spaces left, draw a dot + DWINUI::drawChar(hmiData.colorStatusTxt, '.'); // Always at 1+ spaces left, draw a dot uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters if (--chars) { // Draw a second dot if there's space DWINUI::drawChar(hmiData.colorStatusTxt, '.'); @@ -528,7 +538,7 @@ void dwinDrawStatusMessage() { DWINUI::drawString(hmiData.colorStatusTxt, ui.status_message, chars); // Print a second copy of the message } } - MarlinUI::advance_status_scroll(); + ui.advance_status_scroll(); } #else @@ -581,16 +591,17 @@ void ICON_ResumeOrPause() { if (checkkey == ID_PrintProcess) (print_job_timer.isPaused() || hmiFlag.pause_flag) ? ICON_Resume() : ICON_Pause(); } -// Update filename on print -void dwinPrintHeader(const char *text = nullptr) { +// Print a string (up to 30 characters) in the header, +// e.g., The filename or string sent with M75. +void dwinPrintHeader(const char * const cstr/*=nullptr*/) { static char headertxt[31] = ""; // Print header text - if (text) { - const int8_t size = _MIN(30U, strlen_P(text)); - for (uint8_t i = 0; i < size; ++i) headertxt[i] = text[i]; + if (cstr) { + const int8_t size = _MIN(30U, strlen(cstr)); + for (uint8_t i = 0; i < size; ++i) headertxt[i] = cstr[i]; headertxt[size] = '\0'; } if (checkkey == ID_PrintProcess || checkkey == ID_PrintDone) { - dwinDrawRectangle(1, hmiData.colorBackground, 0, 60, DWIN_WIDTH, 60+16); + dwinDrawRectangle(1, hmiData.colorBackground, 0, 60, DWIN_WIDTH, 60 + 16); DWINUI::drawCenteredString(60, headertxt); } } @@ -601,7 +612,7 @@ void drawPrintProcess() { else title.showCaption(GET_TEXT_F(MSG_PRINTING)); DWINUI::clearMainArea(); - dwinPrintHeader(nullptr); + dwinPrintHeader(); drawPrintLabels(); DWINUI::drawIcon(ICON_PrintTime, 15, 173); DWINUI::drawIcon(ICON_RemainTime, 150, 171); @@ -629,7 +640,7 @@ void drawPrintDone() { TERN_(SET_REMAINING_TIME, ui.reset_remaining_time()); title.showCaption(GET_TEXT_F(MSG_PRINT_DONE)); DWINUI::clearMainArea(); - dwinPrintHeader(nullptr); + dwinPrintHeader(); #if HAS_GCODE_PREVIEW const bool haspreview = preview.valid(); if (haspreview) { @@ -748,7 +759,7 @@ void _drawFeedrate() { DWINUI::drawString(DWIN_FONT_STAT, hmiData.colorIndicator, hmiData.colorBackground, 116 + 4 * STAT_CHR_W + 2, 384, F(" %")); } else { - _value = CEIL(feedrate_mm_s * feedrate_percentage / 100); + _value = CEIL(MMS_SCALED(feedrate_mm_s)); dwinDrawBox(1, hmiData.colorBackground, 116 + 5 * STAT_CHR_W + 2, 384, 20, 20); } DWINUI::drawInt(DWIN_FONT_STAT, hmiData.colorIndicator, hmiData.colorBackground, 3, 116 + 2 * STAT_CHR_W, 384, _value); @@ -880,24 +891,24 @@ inline uint16_t nr_sd_menu_items() { } void makeNameWithoutExt(char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT) { - size_t pos = strlen(src); // Index of ending nul + size_t pos = strlen(src); // Index of ending nul // For files, remove the extension // which may be .gcode, .gco, or .g if (!card.flag.filenameIsDir) while (pos && src[pos] != '.') pos--; // Find last '.' (stop at 0) - if (!pos) pos = strlen(src); // pos = 0 ('.' not found) restore pos + if (!pos) pos = strlen(src); // pos = 0 ('.' not found) restore pos - size_t len = pos; // nul or '.' - if (len > maxlen) { // Keep the name short - pos = len = maxlen; // Move nul down - dst[--pos] = '.'; // Insert dots + size_t len = pos; // nul or '.' + if (len > maxlen) { // Keep the name short + pos = len = maxlen; // Move nul down + dst[--pos] = '.'; // Insert dots dst[--pos] = '.'; dst[--pos] = '.'; } - dst[len] = '\0'; // End it + dst[len] = '\0'; // End it // Copy down to 0 while (pos--) dst[pos] = src[pos]; @@ -972,7 +983,7 @@ void onClickSDItem() { } else if ((selected >= 1 + hasUpDir) && (shift_len > MENU_CHAR_LIMIT)) { uint8_t shift_new = _MIN(shift_amt + 1, shift_len - MENU_CHAR_LIMIT); // Try to shift by... - drawSDItemShifted(shift_new); // Draw the item + drawSDItemShifted(shift_new); // Draw the item if (shift_new == shift_amt) // Scroll reached the end shift_new = -1; // Reset shift_amt = shift_new; // Set new scroll @@ -1031,7 +1042,7 @@ void hmiSDCardUpdate() { currentMenu = nullptr; drawPrintFileMenu(); } - if (!DWIN_lcd_sd_status && sdPrinting()) ui.abort_print(); // Media removed while printing + if (!DWIN_lcd_sd_status && sdPrinting()) ExtUI::stopPrint(); // Media removed while printing } } @@ -1060,7 +1071,7 @@ void dwinDrawDashboard() { #endif #if HAS_HEATED_BED - DWINUI::drawIcon(ICON_BedTemp, 10, 416); + DWINUI::drawIcon(ICON_SetBedTemp, 10, 416); DWINUI::drawInt(DWIN_FONT_STAT, hmiData.colorIndicator, hmiData.colorBackground, 3, 28, 417, thermalManager.wholeDegBed()); DWINUI::drawString(DWIN_FONT_STAT, hmiData.colorIndicator, hmiData.colorBackground, 25 + 3 * STAT_CHR_W + 5, 417, F("/")); DWINUI::drawInt(DWIN_FONT_STAT, hmiData.colorIndicator, hmiData.colorBackground, 3, 25 + 4 * STAT_CHR_W + 6, 417, thermalManager.degTargetBed()); @@ -1155,8 +1166,8 @@ void hmiMainMenu() { // Pause or Stop popup void onClickPauseOrStop() { switch (select_print.now) { - case PRINT_PAUSE_RESUME: if (hmiFlag.select_flag) ui.pause_print(); break; // Confirm pause - case PRINT_STOP: if (hmiFlag.select_flag) ui.abort_print(); break; // Stop confirmed then abort print + case PRINT_PAUSE_RESUME: if (hmiFlag.select_flag) ExtUI::pausePrint(); break; // Confirm pause + case PRINT_STOP: if (hmiFlag.select_flag) ExtUI::stopPrint(); break; // Stop confirmed then abort print default: break; } return gotoPrintProcess(); @@ -1190,7 +1201,7 @@ void hmiPrinting() { case PRINT_SETUP: drawTuneMenu(); break; case PRINT_PAUSE_RESUME: if (printingIsPaused()) { // If printer is already in pause - ui.resume_print(); + ExtUI::resumePrint(); break; } else @@ -1213,6 +1224,20 @@ void drawMainArea() { #if HAS_ESDIAG case ID_ESDiagProcess: drawEndStopDiag(); break; #endif + #if ENABLED(PROUI_ITEM_PLOT) + case ID_PlotProcess: + switch (hmiValue.tempControl) { + #if ENABLED(PIDTEMP) + case PIDTEMP_START: drawHPlot(); break; + #endif + #if ENABLED(PIDTEMPBED) + case PIDTEMPBED_START: drawBPlot(); break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case PIDTEMPCHAMBER_START: drawCPlot(); break; + #endif + } break; + #endif case ID_Popup: popupDraw(); break; #if HAS_LOCKSCREEN case ID_Locked: lockScreen.draw(); break; @@ -1235,16 +1260,8 @@ void hmiWaitForUser() { } if (!wait_for_user) { switch (checkkey) { - case ID_PrintDone: - select_page.reset(); - gotoMainMenu(); - break; - #if HAS_BED_PROBE - case ID_Leveling: - #endif - default: - hmiReturnScreen(); - break; + case ID_PrintDone: select_page.reset(); gotoMainMenu(); break; + default: hmiReturnScreen(); break; } } } @@ -1288,13 +1305,15 @@ void eachMomentUpdate() { if (checkkey == ID_PIDProcess) { TERN_(PIDTEMP, if (hmiValue.tempControl == PIDTEMP_START) plot.update(thermalManager.wholeDegHotend(0))); TERN_(PIDTEMPBED, if (hmiValue.tempControl == PIDTEMPBED_START) plot.update(thermalManager.wholeDegBed())); + TERN_(PIDTEMPCHAMBER, if (hmiValue.tempControl == PIDTEMPCHAMBER_START) plot.update(thermalManager.wholeDegChamber())); } TERN_(MPCTEMP, if (checkkey == ID_MPCProcess) plot.update(thermalManager.wholeDegHotend(0))); #if ENABLED(PROUI_ITEM_PLOT) if (checkkey == ID_PlotProcess) { TERN_(PIDTEMP, if (hmiValue.tempControl == PIDTEMP_START) { plot.update(thermalManager.wholeDegHotend(0)); }) TERN_(PIDTEMPBED, if (hmiValue.tempControl == PIDTEMPBED_START) { plot.update(thermalManager.wholeDegBed()); }) - TERN_(MPCTEMP, if (hmiValue.tempControl == MPCTEMP_START) { plot.update(thermalManager.wholeDegHotend(0)); }) + TERN_(PIDTEMPCHAMBER, if (hmiValue.tempControl == PIDTEMPCHAMBER_START) { plot.update(thermalManager.wholeDegChamber()); }) + TERN_(MPCTEMP, if (hmiValue.tempControl == MPC_STARTED) { plot.update(thermalManager.wholeDegHotend(0)); }) if (hmiFlag.abort_flag || hmiFlag.pause_flag || print_job_timer.isPaused()) { hmiReturnScreen(); } @@ -1330,7 +1349,7 @@ void eachMomentUpdate() { dwinPrintFinished(); } - if ((printingIsPaused() != hmiFlag.pause_flag) && !hmiFlag.home_flag) { + if ((hmiFlag.pause_flag != printingIsPaused()) && !hmiFlag.home_flag) { hmiFlag.pause_flag = printingIsPaused(); if (hmiFlag.pause_flag) dwinPrintPause(); @@ -1365,8 +1384,8 @@ void eachMomentUpdate() { drawPrintProgressElapsed(); } } - #if ENABLED(POWER_LOSS_RECOVERY) - else if (DWIN_lcd_sd_status && recovery.dwin_flag) { // Resume print before power off + #if HAS_PLR_UI_FLAG + else if (DWIN_lcd_sd_status && recovery.ui_flag_resume) { // Resume interrupted print return gotoPowerLossRecovery(); } #endif @@ -1376,6 +1395,7 @@ void eachMomentUpdate() { } #if ENABLED(POWER_LOSS_RECOVERY) + void popupPowerLossRecovery() { DWINUI::clearMainArea(); drawPopupBkgd(); @@ -1415,7 +1435,7 @@ void eachMomentUpdate() { } void gotoPowerLossRecovery() { - recovery.dwin_flag = false; + recovery.ui_flag_resume = false; LCD_MESSAGE(MSG_CONTINUE_PRINT_JOB); gotoPopup(popupPowerLossRecovery, onClickPowerLossRecovery); } @@ -1434,9 +1454,8 @@ void dwinHandleScreen() { case ID_PrintProcess: hmiPrinting(); break; case ID_Popup: hmiPopup(); break; #if HAS_LOCKSCREEN - case ID_Locked: hmiLockScreen(); break; + case ID_Locked: hmiLockScreen(); break; #endif - TERN_(HAS_ESDIAG, case ID_ESDiagProcess:) TERN_(PROUI_ITEM_PLOT, case ID_PlotProcess:) case ID_PrintDone: @@ -1444,7 +1463,8 @@ void dwinHandleScreen() { TERN_(HAS_BED_PROBE, case ID_Leveling:) case ID_Homing: - case ID_PIDProcess: + TERN_(HAS_PID_HEATING, case ID_PIDProcess:) + TERN_(MPCTEMP, case ID_MPCProcess:) case ID_NothingToDo: default: break; } @@ -1458,7 +1478,9 @@ bool idIsPopUp() { // If ID is popup... case ID_WaitResponse: case ID_Popup: case ID_Homing: - case ID_PIDProcess: + TERN_(HAS_PID_HEATING, case ID_PIDProcess:) + TERN_(MPCTEMP, case ID_MPCProcess:) + TERN_(PROUI_ITEM_PLOT, case ID_PlotProcess:) return true; default: break; } @@ -1491,7 +1513,11 @@ void dwinHomingStart() { hmiFlag.home_flag = true; hmiSaveProcessID(ID_Homing); title.showCaption(GET_TEXT_F(MSG_HOMING)); - dwinShowPopup(ICON_BLTouch, GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); + #if ANY(TJC_DISPLAY, DACAI_DISPLAY) + dwinShowPopup(ICON_BLTouch, GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); + #else + dwinShowPopup(ICON_Printer_0, GET_TEXT_F(MSG_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); + #endif } void dwinHomingDone() { @@ -1508,22 +1534,7 @@ void dwinLevelingStart() { title.showCaption(GET_TEXT_F(MSG_BED_LEVELING)); dwinShowPopup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT)); #if ALL(AUTO_BED_LEVELING_UBL, PREHEAT_BEFORE_LEVELING) - #if HAS_BED_PROBE - if (!DEBUGGING(DRYRUN)) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, hmiData.bedLevT); - #else - #if HAS_HOTEND - if (!DEBUGGING(DRYRUN) && thermalManager.degTargetHotend(0) < LEVELING_NOZZLE_TEMP) { - thermalManager.setTargetHotend(LEVELING_NOZZLE_TEMP, 0); - thermalManager.wait_for_hotend(0); - } - #endif - #if HAS_HEATED_BED - if (!DEBUGGING(DRYRUN) && thermalManager.degTargetBed() < hmiData.bedLevT) { - thermalManager.setTargetBed(hmiData.bedLevT); - thermalManager.wait_for_bed_heating(); - } - #endif - #endif + if (!DEBUGGING(DRYRUN)) probe.preheat_for_probing(LEVELING_NOZZLE_TEMP, hmiData.bedLevT); #endif #elif ENABLED(MESH_BED_LEVELING) drawManualMeshMenu(); @@ -1557,10 +1568,10 @@ void dwinLevelingDone() { switch (hmiValue.tempControl) { default: return; #if ENABLED(MPC_AUTOTUNE) - case MPCTEMP_START: + case MPC_STARTED: DWINUI::drawCenteredString(hmiData.colorPopupTxt, 70, GET_TEXT_F(MSG_MPC_AUTOTUNE)); DWINUI::drawString(hmiData.colorPopupTxt, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("MPC target: Celsius")); - DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, F("for NOZZLE is running.")); + DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, GET_TEXT_F(MSG_PID_FOR_NOZZLE)); _maxtemp = thermalManager.hotend_maxtemp[0]; _target = 200; break; @@ -1569,18 +1580,27 @@ void dwinLevelingDone() { case PIDTEMP_START: DWINUI::drawCenteredString(hmiData.colorPopupTxt, 70, GET_TEXT_F(MSG_PID_AUTOTUNE)); DWINUI::drawString(hmiData.colorPopupTxt, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); - DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, F("for NOZZLE is running.")); + DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, GET_TEXT_F(MSG_PID_FOR_NOZZLE)); _maxtemp = thermalManager.hotend_maxtemp[0]; - _target = hmiData.hotendPidT; + _target = hmiData.hotendPIDT; break; #endif #if ENABLED(PIDTEMPBED) case PIDTEMPBED_START: DWINUI::drawCenteredString(hmiData.colorPopupTxt, 70, GET_TEXT_F(MSG_PID_AUTOTUNE)); DWINUI::drawString(hmiData.colorPopupTxt, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); - DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, F("for BED is running.")); + DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, GET_TEXT_F(MSG_PID_FOR_BED)); _maxtemp = BED_MAXTEMP; - _target = hmiData.bedPidT; + _target = hmiData.bedPIDT; + break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case PIDTEMPCHAMBER_START: + DWINUI::drawCenteredString(hmiData.colorPopupTxt, 70, GET_TEXT_F(MSG_PID_AUTOTUNE)); + DWINUI::drawString(hmiData.colorPopupTxt, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius")); + DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, GET_TEXT_F(MSG_PID_FOR_CHAMBER)); + _maxtemp = CHAMBER_MAXTEMP; + _target = hmiData.chamberPIDT; break; #endif } @@ -1594,30 +1614,38 @@ void dwinLevelingDone() { void dwinDrawPlot(tempcontrol_t result) { hmiValue.tempControl = result; - constexpr frame_rect_t gfrm = {30, 135, DWIN_WIDTH - 60, 160}; + constexpr frame_rect_t gfrm = { 30, 135, DWIN_WIDTH - 60, 160 }; DWINUI::clearMainArea(); drawPopupBkgd(); hmiSaveProcessID(ID_PlotProcess); switch (result) { #if ENABLED(MPCTEMP) - case MPCTEMP_START: + case MPC_STARTED: #elif ENABLED(PIDTEMP) case PIDTEMP_START: #endif title.showCaption(GET_TEXT_F(MSG_HOTEND_TEMP_GRAPH)); - DWINUI::drawCenteredString(3, hmiData.colorPopupTxt, 75, F("Nozzle Temperature")); + DWINUI::drawCenteredString(3, hmiData.colorPopupTxt, 75, GET_TEXT_F(MSG_TEMP_NOZZLE)); _maxtemp = thermalManager.hotend_max_target(0); _target = thermalManager.degTargetHotend(0); break; #if ENABLED(PIDTEMPBED) case PIDTEMPBED_START: title.showCaption(GET_TEXT_F(MSG_BED_TEMP_GRAPH)); - DWINUI::drawCenteredString(3, hmiData.colorPopupTxt, 75, F("Bed Temperature")); + DWINUI::drawCenteredString(3, hmiData.colorPopupTxt, 75, GET_TEXT_F(MSG_TEMP_BED)); _maxtemp = BED_MAX_TARGET; _target = thermalManager.degTargetBed(); break; #endif + #if ENABLED(PIDTEMPCHAMBER) + case PIDTEMPCHAMBER_START: + title.showCaption(GET_TEXT_F(MSG_CHAMBER_TEMP_GRAPH)); + DWINUI::drawCenteredString(3, hmiData.colorPopupTxt, 75, GET_TEXT_F(MSG_TEMP_CHAMBER)); + _maxtemp = CHAMBER_MAX_TARGET; + _target = thermalManager.degTargetChamber(); + break; + #endif default: break; } @@ -1625,35 +1653,42 @@ void dwinLevelingDone() { plot.draw(gfrm, _maxtemp, _target); DWINUI::drawInt(false, 2, hmiData.colorStatusTxt, hmiData.colorPopupBg, 3, gfrm.x + 80, gfrm.y - DWINUI::fontHeight() - 4, _target); DWINUI::drawButton(BTN_Continue, 86, 305); - dwinUpdateLCD(); } void drawHPlot() { - TERN_(PIDTEMP, dwinDrawPlot(PIDTEMP_START);) - TERN_(MPCTEMP, dwinDrawPlot(MPCTEMP_START);) + TERN_(PIDTEMP, dwinDrawPlot(PIDTEMP_START)); + TERN_(MPCTEMP, dwinDrawPlot(MPC_STARTED)); } void drawBPlot() { - TERN_(PIDTEMPBED, dwinDrawPlot(PIDTEMPBED_START);) + TERN_(PIDTEMPBED, dwinDrawPlot(PIDTEMPBED_START)); + } + void drawCPlot() { + TERN_(PIDTEMPCHAMBER, dwinDrawPlot(PIDTEMPCHAMBER_START)); } #endif // PROUI_ITEM_PLOT #endif // PROUI_TUNING_GRAPH -#if PROUI_PID_TUNE +#if HAS_PID_HEATING - void dwinStartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp) { - if (seenC) hmiData.pidCycles = c; - if (seenS) { - switch (hid) { - OPTCODE(PIDTEMP, case 0 ... HOTENDS - 1: hmiData.hotendPidT = temp; break) - OPTCODE(PIDTEMPBED, case H_BED: hmiData.bedPidT = temp; break) - default: break; - } + void dwinStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + hmiData.pidCycles = count; + switch (hid) { + #if ENABLED(PIDTEMP) + case 0 ... HOTENDS - 1: hmiData.hotendPIDT = temp; break; + #endif + #if ENABLED(PIDTEMPBED) + case H_BED: hmiData.bedPIDT = temp; break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case H_CHAMBER: hmiData.chamberPIDT = temp; break; + #endif + default: break; } } - void dwinPidTuning(tempcontrol_t result) { + void dwinPIDTuning(tempcontrol_t result) { hmiValue.tempControl = result; switch (result) { #if ENABLED(PIDTEMP) @@ -1662,22 +1697,20 @@ void dwinLevelingDone() { #if PROUI_TUNING_GRAPH dwinDrawPIDMPCPopup(); #else - dwinDrawPopup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for Nozzle is running.")); + dwinDrawPopup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_PID_FOR_NOZZLE)); #endif break; - case PID_TEMP_TOO_HIGH: - checkkey = last_checkkey; - dwinPopupConfirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH)); - break; #endif #if ENABLED(PIDTEMPBED) case PIDTEMPBED_START: hmiSaveProcessID(ID_PIDProcess); - #if PROUI_TUNING_GRAPH - dwinDrawPIDMPCPopup(); - #else - dwinDrawPopup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), F("for BED is running.")); - #endif + dwinDrawPopup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_PID_FOR_BED)); + break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case PIDTEMPCHAMBER_START: + hmiSaveProcessID(ID_PIDProcess); + dwinDrawPopup(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_PID_FOR_CHAMBER)); break; #endif case PID_BAD_HEATER_ID: @@ -1688,24 +1721,29 @@ void dwinLevelingDone() { checkkey = last_checkkey; dwinPopupConfirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_PID_TIMEOUT)); break; + case PID_TEMP_TOO_HIGH: + checkkey = last_checkkey; + dwinPopupConfirm(ICON_TempTooHigh, GET_TEXT_F(MSG_PID_AUTOTUNE_FAILED), GET_TEXT_F(MSG_TEMP_TOO_HIGH)); + break; case AUTOTUNE_DONE: checkkey = last_checkkey; dwinPopupConfirm(ICON_TempTooLow, GET_TEXT_F(MSG_PID_AUTOTUNE), GET_TEXT_F(MSG_BUTTON_DONE)); break; default: checkkey = last_checkkey; + dwinPopupConfirm(ICON_Info_0, GET_TEXT_F(MSG_ERROR), GET_TEXT_F(MSG_STOPPING)); break; } } -#endif // PROUI_PID_TUNE +#endif // HAS_PID_HEATING #if ENABLED(MPC_AUTOTUNE) void dwinMPCTuning(tempcontrol_t result) { hmiValue.tempControl = result; switch (result) { - case MPCTEMP_START: + case MPC_STARTED: hmiSaveProcessID(ID_MPCProcess); #if PROUI_TUNING_GRAPH dwinDrawPIDMPCPopup(); @@ -1778,7 +1816,7 @@ void dwinPrintAborted() { #if ENABLED(NOZZLE_PARK_FEATURE) F("G27") #else - TS(F("G0Z"), float(_MIN(current_position.z + (Z_POST_CLEARANCE), Z_MAX_POS)), F("\nG0F2000Y"), Y_MAX_POS); + TS(F("G0Z"), float(_MIN(current_position.z + (Z_POST_CLEARANCE), Z_MAX_POS)), F("\nG0F2000Y"), Y_MAX_POS) #endif ); } @@ -1813,12 +1851,14 @@ void dwinSetColorDefaults() { hmiData.colorCoordinate = defColorCoordinate; } +static_assert(ExtUI::eeprom_data_size >= sizeof(hmi_data_t), "Insufficient space in EEPROM for UI parameters"); + void dwinSetDataDefaults() { dwinSetColorDefaults(); DWINUI::setColors(hmiData.colorText, hmiData.colorBackground, hmiData.colorStatusBg); - TERN_(PIDTEMP, hmiData.hotendPidT = DEF_HOTENDPIDT); - TERN_(PIDTEMPBED, hmiData.bedPidT = DEF_BEDPIDT); - TERN_(PROUI_PID_TUNE, hmiData.pidCycles = DEF_PIDCYCLES); + TERN_(PIDTEMP, hmiData.hotendPIDT = DEF_HOTENDPIDT); + TERN_(PIDTEMPBED, hmiData.bedPIDT = DEF_BEDPIDT); + TERN_(HAS_PID_HEATING, hmiData.pidCycles = DEF_PIDCYCLES); #if ENABLED(PREVENT_COLD_EXTRUSION) hmiData.extMinT = EXTRUDE_MINTEMP; applyExtMinT(); @@ -1840,12 +1880,11 @@ void dwinSetDataDefaults() { TERN_(LED_COLOR_PRESETS, leds.set_default()); applyLEDColor(); #endif - TERN_(ADAPTIVE_STEP_SMOOTHING, hmiData.adaptiveStepSmoothing = true); TERN_(HAS_GCODE_PREVIEW, hmiData.enablePreview = true); } void dwinCopySettingsTo(char * const buff) { - memcpy(buff, &hmiData, eeprom_data_size); + memcpy(buff, &hmiData, sizeof(hmi_data_t)); } void dwinCopySettingsFrom(const char * const buff) { @@ -1872,7 +1911,6 @@ void MarlinUI::init_lcd() { const bool hs = dwinHandshake(); UNUSED(hs); dwinFrameSetDir(1); dwinJPGCacheTo1(Language_English); - encoderConfiguration(); } void dwinInitScreen() { @@ -1890,19 +1928,21 @@ void dwinInitScreen() { } void MarlinUI::update() { - hmiSDCardUpdate(); // SD card update - eachMomentUpdate(); // Status update - dwinHandleScreen(); // Rotary encoder update + hmiSDCardUpdate(); // SD card update + eachMomentUpdate(); // Status update + dwinHandleScreen(); // Rotary encoder update } -void MarlinUI::refresh() { /* Nothing to see here */ } - #if HAS_LCD_BRIGHTNESS void MarlinUI::_set_brightness() { dwinLCDBrightness(backlight ? brightness : 0); } #endif void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const) { - dwinDrawPopup(ICON_BLTouch, GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); + #if ANY(TJC_DISPLAY, DACAI_DISPLAY) + dwinDrawPopup(ICON_BLTouch, GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); + #else + dwinDrawPopup(ICON_Printer_0, GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); + #endif DWINUI::drawCenteredString(hmiData.colorPopupTxt, 270, GET_TEXT_F(MSG_TURN_OFF)); dwinUpdateLCD(); } @@ -1927,33 +1967,14 @@ void dwinRedrawScreen() { } #if ENABLED(ADVANCED_PAUSE_FEATURE) + void dwinPopupPause(FSTR_P const fmsg, uint8_t button/*=0*/) { hmiSaveProcessID(button ? ID_WaitResponse : ID_NothingToDo); - dwinShowPopup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), fmsg, button); - } - - void MarlinUI::pause_show_message(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) { - //if (mode == PAUSE_MODE_SAME) return; - pause_mode = mode; - switch (message) { - case PAUSE_MESSAGE_PARKING: dwinPopupPause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; // M125 - case PAUSE_MESSAGE_CHANGING: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; // pause_print (M125, M600) - case PAUSE_MESSAGE_WAITING: dwinPopupPause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), BTN_Continue); break; - case PAUSE_MESSAGE_INSERT: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT), BTN_Continue); break; - case PAUSE_MESSAGE_LOAD: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; - case PAUSE_MESSAGE_UNLOAD: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; // Unload of pause and Unload of M702 - case PAUSE_MESSAGE_PURGE: dwinPopupPause(GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE))); break; - case PAUSE_MESSAGE_OPTION: gotoFilamentPurge(); break; - case PAUSE_MESSAGE_RESUME: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; - case PAUSE_MESSAGE_HEAT: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), BTN_Continue); break; - case PAUSE_MESSAGE_HEATING: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; - case PAUSE_MESSAGE_STATUS: hmiReturnScreen(); break; // Exit from Pause, Load and Unload - default: break; - } + dwinShowPopup(ICON_Pause_1, GET_TEXT_F(MSG_ADVANCED_PAUSE), fmsg, button); } void drawPopupFilamentPurge() { - dwinDrawPopup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE_CONTINUE)); + dwinDrawPopup(ICON_AutoLeveling, GET_TEXT_F(MSG_ADVANCED_PAUSE), GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE_CONTINUE)); DWINUI::drawButton(BTN_Purge, 26, 280); DWINUI::drawButton(BTN_Continue, 146, 280); drawSelectHighlight(true); @@ -1978,7 +1999,7 @@ void dwinRedrawScreen() { #if HAS_MESH void dwinMeshViewer() { if (!leveling_is_valid()) - dwinPopupContinue(ICON_BLTouch, GET_TEXT_F(MSG_MESH_VIEWER), GET_TEXT_F(MSG_NO_VALID_MESH)); + dwinPopupContinue(ICON_Leveling_1, GET_TEXT_F(MSG_MESH_VIEWER), GET_TEXT_F(MSG_NO_VALID_MESH)); else { hmiSaveProcessID(ID_WaitResponse); meshViewer.draw(); @@ -2392,7 +2413,8 @@ void setFlow() { setPIntOnClick(FLOW_EDIT_MIN, FLOW_EDIT_MAX, []{ planner.refres #if ENABLED(BED_TRAMMING_INCLUDE_CENTER) case 4: LCD_MESSAGE(MSG_TRAM_C); - x = X_CENTER; y = Y_CENTER; + x = X_CENTER; + y = Y_CENTER; break; #endif } @@ -2483,7 +2505,7 @@ void setFlow() { setPIntOnClick(FLOW_EDIT_MIN, FLOW_EDIT_MAX, []{ planner.refres ui.reset_status(); #ifndef BED_TRAMMING_PROBE_TOLERANCE - #define BED_TRAMMING_PROBE_TOLERANCE 0.05 + #define BED_TRAMMING_PROBE_TOLERANCE 0.05f #endif if (ABS(meshViewer.max - meshViewer.min) < BED_TRAMMING_PROBE_TOLERANCE) { @@ -2492,7 +2514,7 @@ void setFlow() { setPIntOnClick(FLOW_EDIT_MIN, FLOW_EDIT_MAX, []{ planner.refres } else { uint8_t p = 0; - float max = 0; + float max = 0.0f; FSTR_P plabel; bool s = true; for (uint8_t x = 0; x < 2; ++x) for (uint8_t y = 0; y < 2; ++y) { @@ -2766,9 +2788,9 @@ void onDrawGetColorItem(MenuItem* menuitem, int8_t line) { const uint8_t i = menuitem->icon; uint16_t color; switch (i) { - case 0: color = RGB(31, 0, 0); break; // Red - case 1: color = RGB(0, 63, 0); break; // Green - case 2: color = RGB(0, 0, 31); break; // Blue + case 0: color = RGB(31, 0, 0); break; // Red + case 1: color = RGB(0, 63, 0); break; // Green + case 2: color = RGB(0, 0, 31); break; // Blue default: color = 0; break; } dwinDrawRectangle(0, hmiData.colorHighlight, ICOX + 1, MBASE(line) - 1 + 1, ICOX + 18, MBASE(line) - 1 + 18); @@ -3095,17 +3117,17 @@ void drawPrepareMenu() { if (SET_MENU(trammingMenu, MSG_BED_TRAMMING, 8)) { BACK_ITEM(drawPrepareMenu); #if HAS_BED_PROBE && HAS_MESH - MENU_ITEM(ICON_ProbeSet, MSG_TRAMMING_WIZARD, onDrawMenuItem, trammingwizard); - EDIT_ITEM(ICON_ProbeSet, MSG_BED_TRAMMING_MANUAL, onDrawChkbMenu, setManualTramming, &hmiData.fullManualTramming); + MENU_ITEM(ICON_Tram, MSG_TRAMMING_WIZARD, onDrawMenuItem, trammingwizard); + EDIT_ITEM(ICON_Version, MSG_BED_TRAMMING_MANUAL, onDrawChkbMenu, setManualTramming, &hmiData.fullManualTramming); #elif !HAS_BED_PROBE && HAS_ZOFFSET_ITEM MENU_ITEM_F(ICON_MoveZ0, "Home Z and disable", onDrawMenuItem, homeZAndDisable); #endif - MENU_ITEM(ICON_Axis, MSG_TRAM_FL, onDrawMenuItem, []{ (void)tram(0); }); - MENU_ITEM(ICON_Axis, MSG_TRAM_FR, onDrawMenuItem, []{ (void)tram(1); }); - MENU_ITEM(ICON_Axis, MSG_TRAM_BR, onDrawMenuItem, []{ (void)tram(2); }); - MENU_ITEM(ICON_Axis, MSG_TRAM_BL, onDrawMenuItem, []{ (void)tram(3); }); + MENU_ITEM(ICON_AxisBL, MSG_TRAM_FL, onDrawMenuItem, []{ (void)tram(0); }); + MENU_ITEM(ICON_AxisBR, MSG_TRAM_FR, onDrawMenuItem, []{ (void)tram(1); }); + MENU_ITEM(ICON_AxisTR, MSG_TRAM_BR, onDrawMenuItem, []{ (void)tram(2); }); + MENU_ITEM(ICON_AxisTL, MSG_TRAM_BL, onDrawMenuItem, []{ (void)tram(3); }); #if ENABLED(BED_TRAMMING_INCLUDE_CENTER) - MENU_ITEM(ICON_Axis, MSG_TRAM_C, onDrawMenuItem, []{ (void)tram(4); }); + MENU_ITEM(ICON_AxisC, MSG_TRAM_C, onDrawMenuItem, []{ (void)tram(4); }); #endif } updateMenu(trammingMenu); @@ -3124,7 +3146,7 @@ void drawControlMenu() { enableLiveCaseLightBrightness = true; // Allow live update of brightness in control menu MENU_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawSubMenu, drawCaseLightMenu); #else - MENU_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, setCaseLight, &caselight.on); + EDIT_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, setCaseLight, &caselight.on); #endif #endif #if ENABLED(LED_CONTROL_MENU) @@ -3151,13 +3173,13 @@ void drawAdvancedSettingsMenu() { MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); #endif #if HAS_MESH - MENU_ITEM(ICON_ProbeSet, MSG_MESH_LEVELING, onDrawSubMenu, drawMeshSetMenu); + MENU_ITEM(ICON_Mesh, MSG_MESH_LEVELING, onDrawSubMenu, drawMeshSetMenu); #endif #if HAS_BED_PROBE - MENU_ITEM(ICON_ProbeSet, MSG_ZPROBE_SETTINGS, onDrawSubMenu, drawProbeSetMenu); + MENU_ITEM(ICON_Probe, MSG_ZPROBE_SETTINGS, onDrawSubMenu, drawProbeSetMenu); #endif #if HAS_HOME_OFFSET - MENU_ITEM(ICON_ProbeSet, MSG_SET_HOME_OFFSETS, onDrawSubMenu, drawHomeOffsetMenu); + MENU_ITEM(ICON_HomeOffset, MSG_SET_HOME_OFFSETS, onDrawSubMenu, drawHomeOffsetMenu); #endif MENU_ITEM(ICON_FilSet, MSG_FILAMENT_SET, onDrawSubMenu, drawFilSetMenu); #if ENABLED(PIDTEMP) && ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) @@ -3183,7 +3205,7 @@ void drawAdvancedSettingsMenu() { MENU_ITEM(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, dwinLockScreen); #endif #if ENABLED(EDITABLE_DISPLAY_TIMEOUT) - EDIT_ITEM(ICON_Brightness, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, setTimer, &ui.backlight_timeout_minutes); + EDIT_ITEM(ICON_RemainTime, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, setTimer, &ui.backlight_timeout_minutes); #endif #if ENABLED(SOUND_MENU_ITEM) EDIT_ITEM(ICON_Sound, MSG_SOUND_ENABLE, onDrawChkbMenu, setEnableSound, &ui.sound_on); @@ -3203,7 +3225,7 @@ void drawAdvancedSettingsMenu() { #endif #if HAS_LCD_BRIGHTNESS EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, setBrightness, &ui.brightness); - MENU_ITEM(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, turnOffBacklight); + MENU_ITEM(ICON_Box, MSG_BRIGHTNESS_OFF, onDrawMenuItem, turnOffBacklight); #endif #if HAS_CUSTOM_COLORS MENU_ITEM(ICON_Scolor, MSG_COLORS_SELECT, onDrawSubMenu, drawSelectColorsMenu); @@ -3275,7 +3297,7 @@ void drawMoveMenu() { #if ENABLED(BLTOUCH) MENU_ITEM(ICON_ProbeStow, MSG_MANUAL_STOW, onDrawMenuItem, probeStow); MENU_ITEM(ICON_ProbeDeploy, MSG_MANUAL_DEPLOY, onDrawMenuItem, probeDeploy); - MENU_ITEM(ICON_BltouchReset, MSG_BLTOUCH_RESET, onDrawMenuItem, bltouch._reset); + MENU_ITEM(ICON_BLTouchReset, MSG_BLTOUCH_RESET, onDrawMenuItem, bltouch._reset); #if HAS_BLTOUCH_HS_MODE EDIT_ITEM(ICON_HSMode, MSG_ENABLE_HS_MODE, onDrawChkbMenu, setHSMode, &bltouch.high_speed_mode); #endif @@ -3294,7 +3316,7 @@ void drawFilSetMenu() { if (SET_MENU(filSetMenu, MSG_FILAMENT_SET, 9)) { BACK_ITEM(drawAdvancedSettingsMenu); #if HAS_FILAMENT_SENSOR - EDIT_ITEM(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, setRunoutEnable, &runout.enabled); + EDIT_ITEM(ICON_Runout, MSG_RUNOUT_SENSOR, onDrawChkbMenu, setRunoutEnable, &runout.enabled); #endif #if HAS_FILAMENT_RUNOUT_DISTANCE EDIT_ITEM(ICON_Runout, MSG_RUNOUT_DISTANCE_MM, onDrawPFloatMenu, setRunoutDistance, &runout.runout_distance()); @@ -3385,7 +3407,7 @@ void drawTuneMenu() { MENU_ITEM(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, changeFilament); #endif #if HAS_FILAMENT_SENSOR - EDIT_ITEM(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, setRunoutEnable, &runout.enabled); + EDIT_ITEM(ICON_Runout, MSG_RUNOUT_SENSOR, onDrawChkbMenu, setRunoutEnable, &runout.enabled); #endif #if ENABLED(PROUI_ITEM_PLR) EDIT_ITEM(ICON_Pwrlossr, MSG_OUTAGE_RECOVERY, onDrawChkbMenu, setPwrLossr, &recovery.enabled); @@ -3404,10 +3426,10 @@ void drawTuneMenu() { #endif #if HAS_LCD_BRIGHTNESS EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, setBrightness, &ui.brightness); - MENU_ITEM(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, turnOffBacklight); + MENU_ITEM(ICON_Box, MSG_BRIGHTNESS_OFF, onDrawMenuItem, turnOffBacklight); #endif #if ENABLED(EDITABLE_DISPLAY_TIMEOUT) - EDIT_ITEM(ICON_Brightness, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, setTimer, &ui.backlight_timeout_minutes); + EDIT_ITEM(ICON_RemainTime, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, setTimer, &ui.backlight_timeout_minutes); #endif #if ALL(PROUI_TUNING_GRAPH, PROUI_ITEM_PLOT) MENU_ITEM(ICON_PIDNozzle, MSG_HOTEND_TEMP_GRAPH, onDrawMenuItem, drawHPlot); @@ -3432,9 +3454,9 @@ void drawTuneMenu() { updateMenu(tuneMenu); } -#if ENABLED(ADAPTIVE_STEP_SMOOTHING) +#if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) void setAdaptiveStepSmoothing() { - toggleCheckboxLine(hmiData.adaptiveStepSmoothing); + toggleCheckboxLine(stepper.adaptive_step_smoothing_enabled); } #endif @@ -3456,9 +3478,16 @@ void drawTuneMenu() { void setShapingYZeta() { hmiValue.axis = Y_AXIS; setFloatOnClick(0, 1, 2, stepper.get_shaping_damping_ratio(Y_AXIS), applyShapingZeta); } #endif + #if ENABLED(INPUT_SHAPING_Z) + void onDrawShapingZFreq(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, stepper.get_shaping_frequency(Z_AXIS)); } + void onDrawShapingZZeta(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, stepper.get_shaping_damping_ratio(Z_AXIS)); } + void setShapingZFreq() { hmiValue.axis = Z_AXIS; setFloatOnClick(0, 200, 2, stepper.get_shaping_frequency(Z_AXIS), applyShapingFreq); } + void setShapingZZeta() { hmiValue.axis = Z_AXIS; setFloatOnClick(0, 1, 2, stepper.get_shaping_damping_ratio(Z_AXIS), applyShapingZeta); } + #endif + void drawInputShaping_menu() { checkkey = ID_Menu; - if (SET_MENU(inputShapingMenu, MSG_INPUT_SHAPING, 5)) { + if (SET_MENU(inputShapingMenu, MSG_INPUT_SHAPING, 1 PLUS_TERN0(INPUT_SHAPING_X, 2) PLUS_TERN0(INPUT_SHAPING_Y, 2) PLUS_TERN0(INPUT_SHAPING_Z, 2))) { BACK_ITEM(drawMotionMenu); #if ENABLED(INPUT_SHAPING_X) MENU_ITEM(ICON_ShapingX, MSG_SHAPING_A_FREQ, onDrawShapingXFreq, setShapingXFreq); @@ -3468,6 +3497,10 @@ void drawTuneMenu() { MENU_ITEM(ICON_ShapingY, MSG_SHAPING_B_FREQ, onDrawShapingYFreq, setShapingYFreq); MENU_ITEM(ICON_ShapingY, MSG_SHAPING_B_ZETA, onDrawShapingYZeta, setShapingYZeta); #endif + #if ENABLED(INPUT_SHAPING_Z) + MENU_ITEM(ICON_ShapingZ, MSG_SHAPING_C_FREQ, onDrawShapingZFreq, setShapingZFreq); + MENU_ITEM(ICON_ShapingZ, MSG_SHAPING_C_ZETA, onDrawShapingZZeta, setShapingZZeta); + #endif } updateMenu(inputShapingMenu); } @@ -3525,8 +3558,8 @@ void drawMotionMenu() { #if ENABLED(SHAPING_MENU) MENU_ITEM(ICON_InputShaping, MSG_INPUT_SHAPING, onDrawSubMenu, drawInputShaping_menu); #endif - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - EDIT_ITEM(ICON_UBLActive, MSG_STEP_SMOOTHING, onDrawChkbMenu, setAdaptiveStepSmoothing, &hmiData.adaptiveStepSmoothing); + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + EDIT_ITEM(ICON_UBLActive, MSG_STEP_SMOOTHING, onDrawChkbMenu, setAdaptiveStepSmoothing, &stepper.adaptive_step_smoothing_enabled); #endif #if ENABLED(EDITABLE_STEPS_PER_UNIT) MENU_ITEM(ICON_Step, MSG_STEPS_PER_MM, onDrawSteps, drawStepsMenu); @@ -3596,10 +3629,10 @@ void drawFilamentManMenu() { if (notCurrent) { BACK_ITEM(drawTemperatureMenu); #if HAS_HOTEND - EDIT_ITEM(ICON_SetEndTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawSetPreheatHotend, setPreheatEndTemp, &ui.material_preset[hmiValue.select].hotend_temp); + EDIT_ITEM(ICON_HotendTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawSetPreheatHotend, setPreheatEndTemp, &ui.material_preset[hmiValue.select].hotend_temp); #endif #if HAS_HEATED_BED - EDIT_ITEM(ICON_SetBedTemp, MSG_UBL_SET_TEMP_BED, onDrawSetPreheatBed, setPreheatBedTemp, &ui.material_preset[hmiValue.select].bed_temp); + EDIT_ITEM(ICON_BedTemp, MSG_UBL_SET_TEMP_BED, onDrawSetPreheatBed, setPreheatBedTemp, &ui.material_preset[hmiValue.select].bed_temp); #endif #if HAS_FAN EDIT_ITEM(ICON_FanSpeed, MSG_FAN_SPEED, onDrawSetPreheatFan, setPreheatFanSpeed, &ui.material_preset[hmiValue.select].fan_speed); @@ -3625,10 +3658,10 @@ void drawTemperatureMenu() { if (SET_MENU_R(temperatureMenu, selrect({236, 2, 28, 12}), MSG_TEMPERATURE, 4 + PREHEAT_COUNT)) { BACK_ITEM(drawControlMenu); #if HAS_HOTEND - hotendTargetItem = EDIT_ITEM(ICON_SetEndTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawHotendTemp, setHotendTemp, &thermalManager.temp_hotend[0].target); + hotendTargetItem = EDIT_ITEM(ICON_HotendTemp, MSG_UBL_SET_TEMP_HOTEND, onDrawHotendTemp, setHotendTemp, &thermalManager.temp_hotend[0].target); #endif #if HAS_HEATED_BED - bedTargetItem = EDIT_ITEM(ICON_SetBedTemp, MSG_UBL_SET_TEMP_BED, onDrawBedTemp, setBedTemp, &thermalManager.temp_bed.target); + bedTargetItem = EDIT_ITEM(ICON_BedTemp, MSG_UBL_SET_TEMP_BED, onDrawBedTemp, setBedTemp, &thermalManager.temp_bed.target); #endif #if HAS_FAN fanSpeedItem = EDIT_ITEM(ICON_FanSpeed, MSG_FAN_SPEED, onDrawFanSpeed, setFanSpeed, &thermalManager.fan_speed[0]); @@ -3800,9 +3833,9 @@ void drawMaxAccelMenu() { if (SET_MENU(getColorMenu, MSG_COLORS_GET, 5)) { BACK_ITEM(dwinApplyColor); MENU_ITEM(ICON_Cancel, MSG_BUTTON_CANCEL, onDrawMenuItem, drawSelectColorsMenu); - MENU_ITEM(0, MSG_COLORS_RED, onDrawGetColorItem, setRGBColor); + MENU_ITEM(0, MSG_COLORS_RED, onDrawGetColorItem, setRGBColor); MENU_ITEM(1, MSG_COLORS_GREEN, onDrawGetColorItem, setRGBColor); - MENU_ITEM(2, MSG_COLORS_BLUE, onDrawGetColorItem, setRGBColor); + MENU_ITEM(2, MSG_COLORS_BLUE, onDrawGetColorItem, setRGBColor); } updateMenu(getColorMenu); dwinDrawRectangle(1, *menuData.intPtr, 20, 315, DWIN_WIDTH - 20, 335); @@ -3851,101 +3884,137 @@ void drawMaxAccelMenu() { #endif // MPC_EDIT_MENU || MPC_AUTOTUNE_MENU -#if PROUI_PID_TUNE - void setPID(celsius_t t, heater_id_t h) { - gcode.process_subcommands_now( - MString<60>(F("G28OXY\nG0Z5F300\nG0X"), X_CENTER, F("Y"), Y_CENTER, F("F5000\nM84\nM400")) - ); - thermalManager.PID_autotune(t, h, hmiData.pidCycles, true); - } - void setPidCycles() { setPIntOnClick(3, 50); } -#endif - -#if ALL(HAS_PID_HEATING, PID_EDIT_MENU) - - void setKp() { setPFloatOnClick(0, 1000, 2); } - void applyPIDi() { - *menuData.floatPtr = scalePID_i(menuData.value / POW(10, 2)); - TERN_(PIDTEMP, thermalManager.updatePID()); - } - void applyPIDd() { - *menuData.floatPtr = scalePID_d(menuData.value / POW(10, 2)); - TERN_(PIDTEMP, thermalManager.updatePID()); - } - void setKi() { - menuData.floatPtr = (float*)static_cast(currentMenu->selectedItem())->value; - const float value = unscalePID_i(*menuData.floatPtr); - setFloatOnClick(0, 1000, 2, value, applyPIDi); - } - void setKd() { - menuData.floatPtr = (float*)static_cast(currentMenu->selectedItem())->value; - const float value = unscalePID_d(*menuData.floatPtr); - setFloatOnClick(0, 1000, 2, value, applyPIDd); - } - void onDrawPIDi(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast(menuitem)->value)); } - void onDrawPIDd(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast(menuitem)->value)); } - -#endif // HAS_PID_HEATING && PID_EDIT_MENU - -#if ENABLED(PIDTEMP) && ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) +#if HAS_PID_HEATING #if ENABLED(PID_AUTOTUNE_MENU) - void hotendPID() { setPID(hmiData.hotendPidT, H_E0); } - void setHotendPidT() { setPIntOnClick(MIN_ETEMP, MAX_ETEMP); } + void setPID(celsius_t t, heater_id_t h) { + gcode.process_subcommands_now( + MString<60>(F("G28OXY\nG0Z5F300\nG0X"), X_CENTER, F("Y"), Y_CENTER, F("F5000\nM84\nM400")) + ); + thermalManager.PID_autotune(t, h, hmiData.pidCycles, true); + } + void setPIDCycles() { setPIntOnClick(3, 50); } #endif - void drawHotendPIDMenu() { - checkkey = ID_Menu; - if (SET_MENU_F(hotendPIDMenu, STR_HOTEND_PID " Settings", 8)) { - BACK_ITEM(drawAdvancedSettingsMenu); - #if ENABLED(PID_AUTOTUNE_MENU) - MENU_ITEM_F(ICON_PIDNozzle, STR_HOTEND_PID, onDrawMenuItem, hotendPID); - EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, setHotendPidT, &hmiData.hotendPidT); - EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPidCycles, &hmiData.pidCycles); - #endif - #if ENABLED(PID_EDIT_MENU) - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, setKp, &thermalManager.temp_hotend[0].pid.Kp); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, setKi, &thermalManager.temp_hotend[0].pid.Ki); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, setKd, &thermalManager.temp_hotend[0].pid.Kd); - #endif - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); - #endif + #if ENABLED(PID_EDIT_MENU) + void setKp() { setPFloatOnClick(0, 1000, 2); } + void applyPIDi() { + *menuData.floatPtr = scalePID_i(menuData.value / POW(10, 2)); + TERN_(PIDTEMP, thermalManager.updatePID()); } - updateMenu(hotendPIDMenu); - } - -#endif // PIDTEMP && (PID_AUTOTUNE_MENU || PID_EDIT_MENU) - -#if ENABLED(PIDTEMPBED) && ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) - - #if ENABLED(PID_AUTOTUNE_MENU) - void bedPID() { setPID(hmiData.bedPidT, H_BED); } - void setBedPidT() { setPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } - #endif - - void drawBedPIDMenu() { - checkkey = ID_Menu; - if (SET_MENU_F(bedPIDMenu, STR_BED_PID " Settings", 8)) { - BACK_ITEM(drawAdvancedSettingsMenu); - #if ENABLED(PID_AUTOTUNE_MENU) - MENU_ITEM_F(ICON_PIDBed, STR_BED_PID, onDrawMenuItem,bedPID); - EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, setBedPidT, &hmiData.bedPidT); - EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPidCycles, &hmiData.pidCycles); - #endif - #if ENABLED(PID_EDIT_MENU) - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, setKp, &thermalManager.temp_bed.pid.Kp); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, setKi, &thermalManager.temp_bed.pid.Ki); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, setKd, &thermalManager.temp_bed.pid.Kd); - #endif - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); - #endif + void applyPIDd() { + *menuData.floatPtr = scalePID_d(menuData.value / POW(10, 2)); + TERN_(PIDTEMP, thermalManager.updatePID()); } - updateMenu(bedPIDMenu); - } + void setKi() { + menuData.floatPtr = (float*)static_cast(currentMenu->selectedItem())->value; + const float value = unscalePID_i(*menuData.floatPtr); + setFloatOnClick(0, 1000, 2, value, applyPIDi); + } + void setKd() { + menuData.floatPtr = (float*)static_cast(currentMenu->selectedItem())->value; + const float value = unscalePID_d(*menuData.floatPtr); + setFloatOnClick(0, 1000, 2, value, applyPIDd); + } + void onDrawPIDi(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast(menuitem)->value)); } + void onDrawPIDd(MenuItem* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast(menuitem)->value)); } + #endif // PID_EDIT_MENU -#endif // PIDTEMPBED && (PID_AUTOTUNE_MENU || PID_EDIT_MENU) +#endif // HAS_PID_HEATING + +#if ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) + + #if ENABLED(PIDTEMP) + + #if ENABLED(PID_AUTOTUNE_MENU) + void hotendPID() { setPID(hmiData.hotendPIDT, H_E0); } + void setHotendPIDT() { setPIntOnClick(MIN_ETEMP, MAX_ETEMP); } + #endif + + void drawHotendPIDMenu() { + checkkey = ID_Menu; + if (SET_MENU_F(hotendPIDMenu, STR_HOTEND_PID " Settings", 8)) { + BACK_ITEM(drawAdvancedSettingsMenu); + #if ENABLED(PID_AUTOTUNE_MENU) + MENU_ITEM_F(ICON_PIDNozzle, STR_HOTEND_PID, onDrawMenuItem, hotendPID); + EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, setHotendPIDT, &hmiData.hotendPIDT); + EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPIDCycles, &hmiData.pidCycles); + #endif + #if ENABLED(PID_EDIT_MENU) + EDIT_ITEM_F(ICON_PIDValue, "Set Kp: ", onDrawPFloat2Menu, setKp, &thermalManager.temp_hotend[0].pid.Kp); + EDIT_ITEM_F(ICON_PIDValue, "Set Ki: ", onDrawPIDi, setKi, &thermalManager.temp_hotend[0].pid.Ki); + EDIT_ITEM_F(ICON_PIDValue, "Set Kd: ", onDrawPIDd, setKd, &thermalManager.temp_hotend[0].pid.Kd); + #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); + #endif + } + updateMenu(hotendPIDMenu); + } + + #endif // PIDTEMP + + #if ENABLED(PIDTEMPBED) + + #if ENABLED(PID_AUTOTUNE_MENU) + void bedPID() { setPID(hmiData.bedPIDT, H_BED); } + void setBedPIDT() { setPIntOnClick(MIN_BEDTEMP, MAX_BEDTEMP); } + #endif + + void drawBedPIDMenu() { + checkkey = ID_Menu; + if (SET_MENU_F(bedPIDMenu, STR_BED_PID " Settings", 8)) { + BACK_ITEM(drawAdvancedSettingsMenu); + #if ENABLED(PID_AUTOTUNE_MENU) + MENU_ITEM_F(ICON_PIDBed, STR_BED_PID, onDrawMenuItem,bedPID); + EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, setBedPIDT, &hmiData.bedPIDT); + EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPIDCycles, &hmiData.pidCycles); + #endif + #if ENABLED(PID_EDIT_MENU) + EDIT_ITEM_F(ICON_PIDValue, "Set Kp: ", onDrawPFloat2Menu, setKp, &thermalManager.temp_bed.pid.Kp); + EDIT_ITEM_F(ICON_PIDValue, "Set Ki: ", onDrawPIDi, setKi, &thermalManager.temp_bed.pid.Ki); + EDIT_ITEM_F(ICON_PIDValue, "Set Kd: ", onDrawPIDd, setKd, &thermalManager.temp_bed.pid.Kd); + #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); + #endif + } + updateMenu(bedPIDMenu); + } + + #endif // PIDTEMPBED + + #if ENABLED(PIDTEMPCHAMBER) + + #if ENABLED(PID_AUTOTUNE_MENU) + void chamberPID() { setPID(hmiData.chamberPIDT, H_CHAMBER); } + void setChamberPIDT() { setPIntOnClick(MIN_CHAMBERTEMP, MAX_CHAMBERTEMP); } + #endif + + void drawChamberPIDMenu() { + checkkey = ID_Menu; + if (SET_MENU_F(chamberPIDMenu, STR_CHAMBER_PID " Settings", 8)) { + BACK_ITEM(drawAdvancedSettingsMenu); + #if ENABLED(PID_AUTOTUNE_MENU) + MENU_ITEM_F(ICON_PIDChamber, STR_CHAMBER_PID, onDrawMenuItem,chamberPID); + EDIT_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawPIntMenu, setChamberPIDT, &hmiData.chamberPIDT); + EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPIDCycles, &hmiData.pidCycles); + #endif + #if ENABLED(PID_EDIT_MENU) + EDIT_ITEM_F(ICON_PIDValue, "Set Kp: ", onDrawPFloat2Menu, setKp, &thermalManager.temp_chamber.pid.Kp); + EDIT_ITEM_F(ICON_PIDValue, "Set Ki: ", onDrawPIDi, setKi, &thermalManager.temp_chamber.pid.Ki); + EDIT_ITEM_F(ICON_PIDValue, "Set Kd: ", onDrawPIDd, setKd, &thermalManager.temp_chamber.pid.Kd); + #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); + #endif + } + updateMenu(chamberPIDMenu); + } + + #endif // PIDTEMPCHAMBER + +#endif // PID_AUTOTUNE_MENU || PID_EDIT_MENU //============================================================================= @@ -3956,8 +4025,8 @@ void drawMaxAccelMenu() { if (SET_MENU(zOffsetWizMenu, MSG_PROBE_WIZARD, 4)) { BACK_ITEM(drawPrepareMenu); MENU_ITEM(ICON_Homing, MSG_AUTO_HOME, onDrawMenuItem, autoHome); - MENU_ITEM(ICON_MoveZ0, MSG_MOVE_NOZZLE_TO_BED, onDrawMenuItem, setMoveZto0); - EDIT_ITEM(ICON_Zoffset, MSG_XATC_UPDATE_Z_OFFSET, onDrawPFloat2Menu, setZOffset, &BABY_Z_VAR); + MENU_ITEM(ICON_AxisD, MSG_MOVE_NOZZLE_TO_BED, onDrawMenuItem, setMoveZto0); + EDIT_ITEM(ICON_Zoffset, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, setZOffset, &BABY_Z_VAR); } updateMenu(zOffsetWizMenu); if (!axis_is_trusted(Z_AXIS)) LCD_MESSAGE_F("WARNING: Z position unknown, move Z to home"); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index fe48822e48..b424c8db68 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -23,7 +23,8 @@ /** * DWIN Enhanced implementation for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 3.25.3 * Date: 2023/05/18 */ @@ -53,17 +54,16 @@ enum processID : uint8_t { ID_MainMenu, ID_Menu, ID_SetInt, - ID_SetPInt, - ID_SetIntNoDraw, ID_SetFloat, + ID_SetPInt, ID_SetPFloat, + ID_SetIntNoDraw, ID_PrintProcess, ID_Popup, ID_Leveling, ID_Locked, - ID_Reboot, - ID_PrintDone, ID_ESDiagProcess, + ID_PrintDone, ID_WaitResponse, ID_Homing, ID_PIDProcess, @@ -72,24 +72,34 @@ enum processID : uint8_t { ID_NothingToDo }; -#if ANY(PROUI_PID_TUNE, MPC_AUTOTUNE) +#if ANY(HAS_PID_HEATING, MPC_AUTOTUNE) - enum tempcontrol_t : uint8_t { - #if PROUI_PID_TUNE - PIDTEMP_START, - PIDTEMPBED_START, + enum TempControl { + AUTOTUNE_DONE, + #if HAS_PID_HEATING + #if ENABLED(PIDTEMP) + PIDTEMP_START, + #endif + #if ENABLED(PIDTEMPBED) + PIDTEMPBED_START, + #endif + #if ENABLED(PIDTEMPCHAMBER) + PIDTEMPCHAMBER_START, + #endif PID_BAD_HEATER_ID, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, #endif #if ENABLED(MPC_AUTOTUNE) - MPCTEMP_START, + MPC_STARTED, MPC_TEMP_ERROR, MPC_INTERRUPTED, #endif - AUTOTUNE_DONE + TEMPCONTROL_COUNT }; + typedef bits_t(TEMPCONTROL_COUNT) tempcontrol_t; + #endif #define DWIN_CHINESE 123 @@ -117,20 +127,23 @@ typedef struct { uint16_t colorCoordinate; // Temperatures - #if PROUI_PID_TUNE + #if HAS_PID_HEATING int16_t pidCycles = DEF_PIDCYCLES; #if ENABLED(PIDTEMP) - int16_t hotendPidT = DEF_HOTENDPIDT; + celsius_t hotendPIDT = DEF_HOTENDPIDT; #endif #if ENABLED(PIDTEMPBED) - int16_t bedPidT = DEF_BEDPIDT; + celsius_t bedPIDT = DEF_BEDPIDT; + #endif + #if ENABLED(PIDTEMPCHAMBER) + celsius_t chamberPIDT = DEF_CHAMBERPIDT; #endif #endif #if ENABLED(PREVENT_COLD_EXTRUSION) - int16_t extMinT = EXTRUDE_MINTEMP; + celsius_t extMinT = EXTRUDE_MINTEMP; #endif #if ENABLED(PREHEAT_BEFORE_LEVELING) - int16_t bedLevT = LEVELING_BED_TEMP; + celsius_t bedLevT = LEVELING_BED_TEMP; #endif #if ENABLED(BAUD_RATE_GCODE) bool baud115K = false; @@ -144,20 +157,19 @@ typedef struct { bool mediaAutoMount = ENABLED(HAS_SD_EXTENDER); #if ALL(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) uint8_t zAfterHoming = DEF_Z_AFTER_HOMING; + #define Z_POST_CLEARANCE hmiData.zAfterHoming #endif #if ALL(LED_CONTROL_MENU, HAS_COLOR_LEDS) LEDColor ledColor = defColorLeds; #endif - #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - bool adaptiveStepSmoothing = true; - #endif #if HAS_GCODE_PREVIEW bool enablePreview = true; #endif } hmi_data_t; extern hmi_data_t hmiData; -static constexpr size_t eeprom_data_size = sizeof(hmi_data_t); + +#define EXTUI_EEPROM_DATA_SIZE sizeof(hmi_data_t) typedef struct { int8_t r, g, b; @@ -174,13 +186,15 @@ typedef struct { typedef struct { rgb_t color; // Color - #if ANY(PROUI_PID_TUNE, MPCTEMP) + #if ANY(HAS_PID_HEATING, MPCTEMP) tempcontrol_t tempControl = AUTOTUNE_DONE; #endif uint8_t select = 0; // Auxiliary selector variable AxisEnum axis = X_AXIS; // Axis Select } hmi_value_t; +extern hmi_value_t hmiValue; + typedef struct { uint8_t language; bool printing_flag:1; // sd or host printing @@ -190,13 +204,12 @@ typedef struct { bool home_flag:1; // homing in course } hmi_flag_t; -extern hmi_value_t hmiValue; extern hmi_flag_t hmiFlag; extern uint8_t checkkey; // Popups -#if HAS_HOTEND || HAS_HEATED_BED - void dwinPopupTemperature(const bool toohigh); +#if HAS_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER + void dwinPopupTemperature(const int_fast8_t heater_id, const uint8_t state); #endif #if ENABLED(POWER_LOSS_RECOVERY) void popupPowerLossRecovery(); @@ -287,7 +300,7 @@ void dwinPrintAborted(); #if HAS_FILAMENT_SENSOR void dwinFilamentRunout(const uint8_t extruder); #endif -void dwinPrintHeader(const char *text); +void dwinPrintHeader(const char * const cstr=nullptr); void dwinSetColorDefaults(); void dwinCopySettingsTo(char * const buff); void dwinCopySettingsFrom(const char * const buff); @@ -312,6 +325,11 @@ void dwinRebootScreen(); #if HAS_ESDIAG void drawEndStopDiag(); #endif +#if ALL(PROUI_TUNING_GRAPH, PROUI_ITEM_PLOT) + void dwinDrawPlot(tempcontrol_t result); + void drawHPlot(); + void drawBPlot(); +#endif // Menu drawing functions void drawPrintFileMenu(); @@ -375,28 +393,29 @@ void drawMaxAccelMenu(); #endif // PID -#if PROUI_PID_TUNE +#if HAS_PID_HEATING #include "../../../module/temperature.h" - void dwinStartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp); - void dwinPidTuning(tempcontrol_t result); - #if PROUI_TUNING_GRAPH - void dwinDrawPIDMPCPopup(); - #endif -#endif -#if ENABLED(PIDTEMP) - #if ENABLED(PID_AUTOTUNE_MENU) - void hotendPID(); - #endif + void dwinStartM303(const int count, const heater_id_t hid, const celsius_t temp); + void dwinPIDTuning(tempcontrol_t result); #if ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) - void drawHotendPIDMenu(); - #endif -#endif -#if ENABLED(PIDTEMPBED) - #if ENABLED(PID_AUTOTUNE_MENU) - void bedPID(); - #endif - #if ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) - void drawBedPIDMenu(); + #if ENABLED(PIDTEMP) + #if ENABLED(PID_AUTOTUNE_MENU) + void hotendPID(); + #endif + void drawHotendPIDMenu(); + #endif + #if ENABLED(PIDTEMPBED) + #if ENABLED(PID_AUTOTUNE_MENU) + void bedPID(); + #endif + void drawBedPIDMenu(); + #endif + #if ENABLED(PIDTEMPCHAMBER) + #if ENABLED(PID_AUTOTUNE_MENU) + void chamberPID(); + #endif + void drawChamberPIDMenu(); + #endif #endif #endif @@ -409,3 +428,7 @@ void drawMaxAccelMenu(); void dwinMPCTuning(tempcontrol_t result); #endif #endif + +#if PROUI_TUNING_GRAPH + void dwinDrawPIDMPCPopup(); +#endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index c03ac66af1..b72bdf1d23 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -23,13 +23,18 @@ /** * DWIN general defines and data structs for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 3.12.2 * Date: 2022/08/08 */ #include "../../../inc/MarlinConfigPre.h" +//#define TJC_DISPLAY // Enable for TJC display +//#define DACAI_DISPLAY // Enable for DACAI display +//#define TITLE_CENTERED // Center Menu Title Text + #if HAS_MESH #define PROUI_MESH_EDIT // Add a menu to edit mesh points #if ENABLED(PROUI_MESH_EDIT) @@ -54,15 +59,15 @@ #define HAS_ZOFFSET_ITEM 1 #endif -#define defColorBackground RGB( 1, 12, 8) +#define defColorBackground RGB(1, 12, 8) #define defColorCursor RGB(20, 49, 31) -#define defColorTitleBg RGB( 0, 23, 16) +#define defColorTitleBg RGB(0, 23, 16) #define defColorTitleTxt COLOR_WHITE #define defColorText COLOR_WHITE #define defColorSelected COLOR_SELECT -#define defColorSplitLine RGB( 0, 23, 16) +#define defColorSplitLine RGB(0, 23, 16) #define defColorHighlight COLOR_WHITE -#define defColorStatusBg RGB( 0, 23, 16) +#define defColorStatusBg RGB(0, 23, 16) #define defColorStatusTxt COLOR_YELLOW #define defColorPopupBg COLOR_BG_WINDOW #define defColorPopupTxt COLOR_POPUP_TEXT @@ -72,20 +77,35 @@ #define defColorBarfill COLOR_BARFILL #define defColorIndicator COLOR_WHITE #define defColorCoordinate COLOR_WHITE -#define defColorButton RGB( 0, 23, 16) +#define defColorButton RGB(0, 23, 16) #if ALL(LED_CONTROL_MENU, HAS_COLOR_LEDS) #define defColorLeds LEDColorWhite() #endif #if CASELIGHT_USES_BRIGHTNESS #define defCaseLightBrightness 255 #endif + #ifdef Z_AFTER_HOMING #define DEF_Z_AFTER_HOMING Z_AFTER_HOMING #else #define DEF_Z_AFTER_HOMING 0 #endif -#define DEF_HOTENDPIDT TERN(PREHEAT_1_TEMP_BED, PREHEAT_1_TEMP_HOTEND, 195) -#define DEF_BEDPIDT TERN(PREHEAT_1_TEMP_BED, PREHEAT_1_TEMP_HOTEND, 60) + +#ifdef PREHEAT_1_TEMP_HOTEND + #define DEF_HOTENDPIDT PREHEAT_1_TEMP_HOTEND +#else + #define DEF_HOTENDPIDT 195 +#endif +#ifdef PREHEAT_1_TEMP_BED + #define DEF_BEDPIDT PREHEAT_1_TEMP_BED +#else + #define DEF_BEDPIDT 60 +#endif +#ifdef PREHEAT_1_TEMP_CHAMBER + #define DEF_CHAMBERPIDT PREHEAT_1_TEMP_CHAMBER +#else + #define DEF_CHAMBERPIDT 0 +#endif #define DEF_PIDCYCLES 5 /** @@ -103,7 +123,7 @@ #if ENABLED(LIN_ADVANCE) #define PROUI_ITEM_ADVK // Tune > Linear Advance #endif -#if ANY(PROUI_PID_TUNE, MPC_AUTOTUNE) && DISABLED(DISABLE_TUNING_GRAPH) +#if ANY(HAS_PID_HEATING, MPC_AUTOTUNE) && DISABLED(DISABLE_TUNING_GRAPH) #define PROUI_TUNING_GRAPH 1 #endif #if PROUI_TUNING_GRAPH diff --git a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp index 7c71b8fc59..30a06e36ad 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.cpp @@ -22,7 +22,8 @@ /** * DWIN Enhanced implementation for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 3.12.1 * Date: 2023/01/22 */ @@ -52,14 +53,6 @@ void dwinDrawQR(uint8_t QR_Pixel, uint16_t x, uint16_t y, char *string) { dwinSend(i); } -// Draw an Icon with transparent background -// libID: Icon library ID -// picID: Icon ID -// x/y: Upper-left point -void dwinIconShow(uint8_t libID, uint8_t picID, uint16_t x, uint16_t y) { - dwinIconShow(false, false, true, libID, picID, x, y); -} - // Copy area from current virtual display area to current screen // xStart/yStart: Upper-left of virtual area // xEnd/yEnd: Lower-right of virtual area @@ -134,21 +127,25 @@ void dwinWriteToMem(uint8_t mem, uint16_t addr, uint16_t length, uint8_t *data) } } -// Draw an Icon from SRAM without background transparency for DACAI Screens support -void DACAI_ICON_Show(uint16_t x, uint16_t y, uint16_t addr) { - NOMORE(x, DWIN_WIDTH - 1); - NOMORE(y, DWIN_HEIGHT - 1); - size_t i = 0; - dwinByte(i, 0x70); - dwinWord(i, x); - dwinWord(i, y); - dwinWord(i, addr); - dwinSend(i); -} +#if ENABLED(DACAI_DISPLAY) + + // Draw an Icon from SRAM without background transparency for DACAI Screens support + void dacaiIconShow(uint16_t x, uint16_t y, uint16_t addr) { + NOMORE(x, DWIN_WIDTH - 1); + NOMORE(y, DWIN_HEIGHT - 1); + size_t i = 0; + dwinByte(i, 0x70); + dwinWord(i, x); + dwinWord(i, y); + dwinWord(i, addr); + dwinSend(i); + } + +#endif void dwinIconShow(uint16_t x, uint16_t y, uint16_t addr) { #if ENABLED(DACAI_DISPLAY) - DACAI_ICON_Show(x, y, addr); + dacaiIconShow(x, y, addr); #else dwinIconShow(0, 0, 1, x, y, addr); #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_lcd.h b/Marlin/src/lcd/e3v2/proui/dwin_lcd.h index 51f4590129..8a155b2a4d 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_lcd.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_lcd.h @@ -23,7 +23,8 @@ /** * DWIN Enhanced implementation for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 3.12.1 * Date: 2023/01/22 */ diff --git a/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp index 5756b770af..d499151e3f 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.cpp @@ -22,7 +22,8 @@ /** * DWIN Enhanced implementation for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 3.11.1 * Date: 2022/02/28 */ diff --git a/Marlin/src/lcd/e3v2/proui/dwin_popup.h b/Marlin/src/lcd/e3v2/proui/dwin_popup.h index d970cbfef4..9443e88a36 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_popup.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_popup.h @@ -23,7 +23,8 @@ /** * DWIN Enhanced implementation for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 3.11.1 * Date: 2022/02/28 */ @@ -76,4 +77,3 @@ void dwinPopupConfirm(const uint8_t icon, T amsg1, U amsg2) { dwinDrawPopup(icon, amsg1, amsg2, BTN_Confirm); // Button Confirm dwinUpdateLCD(); } - diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index 23cd1736fd..2d6dc67197 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -22,7 +22,8 @@ /** * DWIN Enhanced implementation for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 3.21.1 * Date: 2023/03/21 */ @@ -79,7 +80,7 @@ uint8_t DWINUI::fontWidth(fontid_t fid) { uint8_t DWINUI::fontHeight(fontid_t fid) { switch (fid) { #if DISABLED(TJC_DISPLAY) - case font6x12 : return 12; + case font6x12 : return 12; case font20x40: return 40; case font24x48: return 48; case font28x56: return 56; @@ -199,7 +200,7 @@ void DWINUI::drawInt(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t colo // value: float value void DWINUI::drawFloat(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { char nstr[10]; - dwinDrawString(bShow, fid, color, bColor, x, y, dtostrf(value, iNum + (signedMode ? 2:1) + fNum, fNum, nstr)); + dwinDrawString(bShow, fid, color, bColor, x, y, dtostrf(value, iNum + (signedMode ? 2 : 1) + fNum, fNum, nstr)); } // ------------------------- Icons -------------------------------// @@ -209,7 +210,7 @@ void DWINUI::drawFloat(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t co // libID: Icon library ID // picID: Icon ID // x/y: Upper-left point -void DWINUI::ICON_Show(bool BG, uint8_t icon, uint16_t x, uint16_t y) { +void DWINUI::iconShow(bool BG, uint8_t icon, uint16_t x, uint16_t y) { const uint8_t libID = ICON TERN_(HAS_CUSTOMICONS, + (icon / 100)); const uint8_t picID = icon TERN_(HAS_CUSTOMICONS, % 100); dwinIconShow(BG, false, !BG, libID, picID, x, y); @@ -219,17 +220,17 @@ void DWINUI::ICON_Show(bool BG, uint8_t icon, uint16_t x, uint16_t y) { void DWINUI::drawButton(uint16_t color, uint16_t bcolor, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, const char * const caption) { dwinDrawRectangle(1, bcolor, x1, y1, x2, y2); - drawCenteredString(0, fontID, color, bcolor, x1, x2, (y2 + y1 - fontHeight())/2, caption); + drawCenteredString(0, fontID, color, bcolor, x1, x2, (y2 + y1 - fontHeight()) / 2, caption); } void DWINUI::drawButton(uint8_t id, uint16_t x, uint16_t y) { switch (id) { - case BTN_Cancel : drawButton(GET_TEXT_F(MSG_BUTTON_CANCEL), x, y); break; - case BTN_Confirm : drawButton(GET_TEXT_F(MSG_BUTTON_CONFIRM), x, y); break; case BTN_Continue: drawButton(GET_TEXT_F(MSG_BUTTON_CONTINUE), x, y); break; - case BTN_Print : drawButton(GET_TEXT_F(MSG_BUTTON_PRINT), x, y); break; - case BTN_Save : drawButton(GET_TEXT_F(MSG_BUTTON_SAVE), x, y); break; - case BTN_Purge : drawButton(GET_TEXT_F(MSG_BUTTON_PURGE), x, y); break; + case BTN_Cancel : drawButton(GET_TEXT_F(MSG_BUTTON_CANCEL), x, y); break; + case BTN_Confirm : drawButton(GET_TEXT_F(MSG_BUTTON_CONFIRM), x, y); break; + case BTN_Print : drawButton(GET_TEXT_F(MSG_BUTTON_PRINT), x, y); break; + case BTN_Save : drawButton(GET_TEXT_F(MSG_BUTTON_SAVE), x, y); break; + case BTN_Purge : drawButton(GET_TEXT_F(MSG_BUTTON_PURGE), x, y); break; default: break; } } diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index 97da3f05ab..f606c24400 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -23,7 +23,8 @@ /** * DWIN Enhanced implementation for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 3.21.1 * Date: 2023/03/21 */ @@ -36,14 +37,28 @@ #include "dwin_lcd.h" // Extra Icons +#define ICON_Printer_0 93 +#define ICON_Box 200 +#define ICON_Checkbox 201 +#define ICON_Fade 202 +#define ICON_Mesh 203 +#define ICON_Tilt 204 +#define ICON_Brightness 205 +#define ICON_Probe 206 +#define ICON_AxisD 249 +#define ICON_AxisBR 250 +#define ICON_AxisTR 251 +#define ICON_AxisBL 252 +#define ICON_AxisTL 253 +#define ICON_AxisC 254 + #define ICON_BedSizeX ICON_PrintSize #define ICON_BedSizeY ICON_PrintSize #define ICON_BedTramming ICON_SetHome #define ICON_Binary ICON_Contact -#define ICON_BltouchReset ICON_StockConfiguration -#define ICON_Brightness ICON_Motion +#define ICON_BLTouchReset ICON_ResetEEPROM #define ICON_Cancel ICON_StockConfiguration -#define ICON_CustomPreheat ICON_SetEndTemp +#define ICON_CustomPreheat ICON_BedTemp #define ICON_Error ICON_TempTooHigh #define ICON_esDiag ICON_Info #define ICON_ExtrudeMinT ICON_HotendTemp @@ -55,28 +70,27 @@ #define ICON_HomeX ICON_MoveX #define ICON_HomeY ICON_MoveY #define ICON_HomeZ ICON_MoveZ -#define ICON_HSMode ICON_StockConfiguration +#define ICON_HSMode ICON_MaxAccZ #define ICON_InputShaping ICON_MaxAccelerated #define ICON_JDmm ICON_MaxJerk -#define ICON_Tram ICON_SetEndTemp -#define ICON_Level ICON_HotendTemp -#define ICON_Lock ICON_Cool -#define ICON_ManualMesh ICON_HotendTemp +#define ICON_Level ICON_Mesh +#define ICON_Lock ICON_Checkbox +#define ICON_ManualMesh ICON_Mesh #define ICON_MaxPosX ICON_MoveX #define ICON_MaxPosY ICON_MoveY #define ICON_MaxPosZ ICON_MoveZ -#define ICON_MeshEdit ICON_Homing +#define ICON_MeshEdit ICON_Fade #define ICON_MeshEditX ICON_MoveX #define ICON_MeshEditY ICON_MoveY -#define ICON_MeshEditZ ICON_MoveZ -#define ICON_MeshNext ICON_Axis -#define ICON_MeshPoints ICON_SetEndTemp -#define ICON_MeshReset ICON_StockConfiguration +#define ICON_MeshEditZ ICON_Zoffset +#define ICON_MeshNext ICON_AxisD +#define ICON_MeshPoints ICON_HotendTemp +#define ICON_MeshReset ICON_ResetEEPROM #define ICON_MeshSave ICON_WriteEEPROM -#define ICON_MeshViewer ICON_HotendTemp -#define ICON_MoveZ0 ICON_HotendTemp -#define ICON_Park ICON_Motion -#define ICON_ParkPos ICON_AdvSet +#define ICON_MeshViewer ICON_Mesh +#define ICON_MoveZ0 ICON_CloseMotor +#define ICON_Park ICON_SetHome +#define ICON_ParkPos ICON_AxisC #define ICON_ParkPosX ICON_StepX #define ICON_ParkPosY ICON_StepY #define ICON_ParkPosZ ICON_StepZ @@ -95,18 +109,18 @@ #define ICON_Preheat8 ICON_CustomPreheat #define ICON_Preheat9 ICON_CustomPreheat #define ICON_Preheat10 ICON_CustomPreheat -#define ICON_ProbeDeploy ICON_SetEndTemp +#define ICON_ProbeDeploy ICON_Probe #define ICON_ProbeMargin ICON_PrintSize #define ICON_ProbeSet ICON_SetEndTemp -#define ICON_ProbeStow ICON_SetEndTemp -#define ICON_ProbeTest ICON_SetEndTemp +#define ICON_ProbeStow ICON_Tilt +#define ICON_ProbeTest ICON_Zoffset #define ICON_ProbeZSpeed ICON_MaxSpeedZ #define ICON_Pwrlossr ICON_Motion #define ICON_Reboot ICON_ResetEEPROM #define ICON_Runout ICON_MaxAccE #define ICON_Scolor ICON_MaxSpeed #define ICON_SetBaudRate ICON_Setspeed -#define ICON_SetCustomPreheat ICON_SetEndTemp +#define ICON_SetCustomPreheat ICON_BedTemp #define ICON_SetPreheat1 ICON_SetPLAPreheat #define ICON_SetPreheat2 ICON_SetABSPreheat #define ICON_SetPreheat3 ICON_SetCustomPreheat @@ -125,22 +139,24 @@ #define ICON_TMCYSet ICON_MoveY #define ICON_TMCZSet ICON_MoveZ #define ICON_TMCESet ICON_Extruder -#define ICON_UBLActive ICON_HotendTemp +#define ICON_Tram ICON_Step +#define ICON_UBLActive ICON_Fade #define ICON_UBLSlot ICON_ResetEEPROM #define ICON_UBLMeshSave ICON_WriteEEPROM #define ICON_UBLMeshLoad ICON_ReadEEPROM -#define ICON_UBLTiltGrid ICON_PrintSize #define ICON_UBLSmartFill ICON_StockConfiguration -#define ICON_ZAfterHome ICON_SetEndTemp +#define ICON_UBLTiltGrid ICON_Tilt +#define ICON_ZAfterHome ICON_Tilt +// LED Lights #define ICON_CaseLight ICON_Motion #define ICON_LedControl ICON_Motion // MPC -#define ICON_MPCNozzle ICON_SetEndTemp +#define ICON_MPCNozzle ICON_HotendTemp #define ICON_MPCValue ICON_Contact #define ICON_MPCHeater ICON_Temperature -#define ICON_MPCHeatCap ICON_SetBedTemp +#define ICON_MPCHeatCap ICON_BedTemp #define ICON_MPCFan ICON_FanSpeed // Buttons @@ -153,9 +169,8 @@ // Extended and default UI Colors #define COLOR_BLACK 0 -#define COLOR_GREEN RGB(0,63,0) -#define COLOR_AQUA RGB(0,63,31) -#define COLOR_BLUE RGB(0,0,31) +#define COLOR_GREEN RGB(0, 63, 0) +#define COLOR_BLUE RGB(0, 0, 31) #define COLOR_LIGHT_WHITE 0xBDD7 #define COLOR_LIGHT_GREEN 0x3460 #define COLOR_CYAN 0x07FF @@ -172,9 +187,9 @@ #define COLOR_GREY 0x18E3 // UI element defines and constants -#define DWIN_FONT_MENU font8x16 -#define DWIN_FONT_STAT font10x20 -#define DWIN_FONT_HEAD font10x20 +#define DWIN_FONT_MENU font8x16 +#define DWIN_FONT_STAT font10x20 +#define DWIN_FONT_HEAD font10x20 #define DWIN_FONT_ALERT font10x20 #define STATUS_Y 354 #define LCD_WIDTH (DWIN_WIDTH / 8) // only if the default fontID is font8x16 @@ -301,20 +316,20 @@ namespace DWINUI { // libID: Icon library ID // picID: Icon ID // x/y: Upper-left point - void ICON_Show(bool BG, uint8_t icon, uint16_t x, uint16_t y); + void iconShow(bool BG, uint8_t icon, uint16_t x, uint16_t y); // Draw an Icon with transparent background from the library ICON // icon: Icon ID // x/y: Upper-left point inline void drawIcon(uint8_t icon, uint16_t x, uint16_t y) { - ICON_Show(false, icon, x, y); + iconShow(false, icon, x, y); } // Draw an Icon from the library ICON with its background // icon: Icon ID // x/y: Upper-left point inline void drawIconWB(uint8_t icon, uint16_t x, uint16_t y) { - ICON_Show(true, icon, x, y); + iconShow(true, icon, x, y); } // Draw a numeric integer value @@ -487,6 +502,9 @@ namespace DWINUI { // y: Upper coordinate of the string // *string: The string void drawCenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, uint16_t y, const char * const string); + inline void drawCenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t x, uint16_t y, const char * const string) { + drawCenteredString(bShow, fid, color, bColor, 2 * x, 0, y, string); + } inline void drawCenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t y, const char * const string) { drawCenteredString(bShow, fid, color, bColor, 0, DWIN_WIDTH, y, string); } diff --git a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp index 21c83dc8fa..83b084ab0d 100644 --- a/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.cpp @@ -22,7 +22,8 @@ /** * DWIN Endstops diagnostic page for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 1.4.3 * Date: 2023/05/10 */ diff --git a/Marlin/src/lcd/e3v2/proui/endstop_diag.h b/Marlin/src/lcd/e3v2/proui/endstop_diag.h index d4a98d5f1a..621edf066c 100644 --- a/Marlin/src/lcd/e3v2/proui/endstop_diag.h +++ b/Marlin/src/lcd/e3v2/proui/endstop_diag.h @@ -23,7 +23,8 @@ /** * DWIN End Stops diagnostic page for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 1.4.3 * Date: 2023/05/10 */ diff --git a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp index cc18bdd214..fbba326152 100644 --- a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp @@ -22,7 +22,8 @@ /** * Lock screen implementation for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 2.3.2 * Date: 2022/11/20 */ diff --git a/Marlin/src/lcd/e3v2/proui/lockscreen.h b/Marlin/src/lcd/e3v2/proui/lockscreen.h index 9feb91c25b..6a9ee6e83d 100644 --- a/Marlin/src/lcd/e3v2/proui/lockscreen.h +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.h @@ -23,7 +23,8 @@ /** * Lock screen implementation for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 2.3.2 * Date: 2022/11/20 */ diff --git a/Marlin/src/lcd/e3v2/proui/menus.cpp b/Marlin/src/lcd/e3v2/proui/menus.cpp index 9f48ff03b7..88fbf60001 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.cpp +++ b/Marlin/src/lcd/e3v2/proui/menus.cpp @@ -263,7 +263,7 @@ void setPFloatOnClick(const float lo, const float hi, uint8_t dp, void (*apply)( // Generic menu control using the encoder void hmiMenu() { - EncoderState encoder_diffState = get_encoder_state(); + const EncoderState encoder_diffState = get_encoder_state(); if (currentMenu) { if (encoder_diffState == ENCODER_DIFF_NO) return; if (encoder_diffState == ENCODER_DIFF_ENTER) @@ -280,10 +280,8 @@ void hmiMenu() { // 1 : live change // 2 : apply change int8_t hmiGet(bool draw) { - const int32_t lo = menuData.minValue; - const int32_t hi = menuData.maxValue; - const int32_t cval = menuData.value; - EncoderState encoder_diffState = TERN(SMOOTH_ENCODER_MENUITEMS, get_encoder_state(), encoderReceiveAnalyze()); + const int32_t lo = menuData.minValue, hi = menuData.maxValue, cval = menuData.value; + const EncoderState encoder_diffState = TERN(SMOOTH_ENCODER_MENUITEMS, get_encoder_state(), encoderReceiveAnalyze()); if (encoder_diffState != ENCODER_DIFF_NO) { if (applyEncoder(encoder_diffState, menuData.value)) { encoderRate.enabled = false; @@ -300,7 +298,7 @@ int8_t hmiGet(bool draw) { // Set and draw a value using the encoder void hmiSetDraw() { - int8_t val = hmiGet(true); + const int8_t val = hmiGet(true); switch (val) { case 0: return; case 1: if (menuData.liveUpdate) menuData.liveUpdate(); break; @@ -310,7 +308,7 @@ void hmiSetDraw() { // Set an value without drawing void hmiSetNoDraw() { - int8_t val = hmiGet(false); + const int8_t val = hmiGet(false); switch (val) { case 0: return; case 1: if (menuData.liveUpdate) menuData.liveUpdate(); break; @@ -320,7 +318,7 @@ void hmiSetNoDraw() { // Set an integer pointer variable using the encoder void hmiSetPInt() { - int8_t val = hmiGet(true); + const int8_t val = hmiGet(true); switch (val) { case 0: return; case 1: if (menuData.liveUpdate) menuData.liveUpdate(); break; diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 1c5f08bb4d..38d0af4f82 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -22,7 +22,8 @@ /** * Mesh Viewer for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * version: 4.2.1 * Date: 2023/05/05 */ diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.h b/Marlin/src/lcd/e3v2/proui/meshviewer.h index f73f1da86e..93be9ee7c2 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.h +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.h @@ -23,7 +23,8 @@ /** * Mesh Viewer for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * version: 4.2.1 * Date: 2023/05/05 */ diff --git a/Marlin/src/lcd/e3v2/proui/printstats.cpp b/Marlin/src/lcd/e3v2/proui/printstats.cpp index 732e80542d..90973dc9c5 100644 --- a/Marlin/src/lcd/e3v2/proui/printstats.cpp +++ b/Marlin/src/lcd/e3v2/proui/printstats.cpp @@ -22,7 +22,8 @@ /** * Print Stats page for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 1.4.0 * Date: 2022/12/03 */ @@ -55,9 +56,9 @@ void PrintStats::draw() { DWINUI::drawString(MRG, 80, TS(GET_TEXT_F(MSG_INFO_PRINT_COUNT), F(": "), ps.totalPrints)); DWINUI::drawString(MRG, 100, TS(GET_TEXT_F(MSG_INFO_COMPLETED_PRINTS), F(": "), ps.finishedPrints)); duration_t(print_job_timer.getStats().printTime).toDigital(str, true); - DWINUI::drawString(MRG, 120, MString<50>(GET_TEXT_F(MSG_INFO_PRINT_TIME), F(": "), str)); + DWINUI::drawString(MRG, 120, TS(GET_TEXT_F(MSG_INFO_PRINT_TIME), F(": "), str)); duration_t(print_job_timer.getStats().longestPrint).toDigital(str, true); - DWINUI::drawString(MRG, 140, MString<50>(GET_TEXT(MSG_INFO_PRINT_LONGEST), F(": "), str)); + DWINUI::drawString(MRG, 140, TS(GET_TEXT_F(MSG_INFO_PRINT_LONGEST), F(": "), str)); DWINUI::drawString(MRG, 160, TS(GET_TEXT_F(MSG_INFO_PRINT_FILAMENT), F(": "), p_float_t(ps.filamentUsed / 1000, 2), F(" m"))); } diff --git a/Marlin/src/lcd/e3v2/proui/printstats.h b/Marlin/src/lcd/e3v2/proui/printstats.h index 133e9eb96e..b3ef5fa883 100644 --- a/Marlin/src/lcd/e3v2/proui/printstats.h +++ b/Marlin/src/lcd/e3v2/proui/printstats.h @@ -23,7 +23,8 @@ /** * Print Stats page for PRO UI - * Author: Miguel A. Risco-Castillo (MRISCOC) + * Based on the original work of: Miguel Risco-Castillo (MRISCOC) + * https://github.com/mriscoc/Ender3V2S1 * Version: 1.4.0 * Date: 2022/12/03 */ diff --git a/Marlin/src/lcd/e3v2/proui/proui_extui.cpp b/Marlin/src/lcd/e3v2/proui/proui_extui.cpp new file mode 100644 index 0000000000..ae85a5a60c --- /dev/null +++ b/Marlin/src/lcd/e3v2/proui/proui_extui.cpp @@ -0,0 +1,246 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/********************* + * proui_extui.cpp * + *********************/ + +/**************************************************************************** + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../../../inc/MarlinConfigPre.h" + +#if ENABLED(DWIN_LCD_PROUI) + +#include "dwin_popup.h" + +#include "../../extui/ui_api.h" +#include "../../../module/stepper.h" + +#if ENABLED(PREVENT_COLD_EXTRUSION) + #include "../../../module/temperature.h" +#endif + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../../feature/powerloss.h" +#endif + +namespace ExtUI { + + void onStartup() { dwinInitScreen(); } + + void onIdle() {} + void onPrinterKilled(FSTR_P const error, FSTR_P const component) {} + + void onMediaMounted() {} + void onMediaError() {} + void onMediaRemoved() {} + + void onHeatingError(const heater_id_t heater_id) { + dwinPopupTemperature(heater_id, 2); // "Heating failed" + } + void onMinTempError(const heater_id_t heater_id) { + dwinPopupTemperature(heater_id, 0); // "Too low" + } + void onMaxTempError(const heater_id_t heater_id) { + dwinPopupTemperature(heater_id, 1); // "Too high" + } + + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {} + void onPrintTimerStarted() {} + void onPrintTimerPaused() {} + void onPrintTimerStopped() {} + + #if HAS_FILAMENT_SENSOR + void onFilamentRunout(const extruder_t extruder) { + dwinFilamentRunout(extruder); + } + #endif + + void onUserConfirmRequired(const char * const cstr) { + // TODO: A version of this method that takes an icon and button title, + // or implement some kind of ExtUI enum. + onUserConfirmRequired(ICON_Continue_1, cstr, GET_TEXT_F(MSG_USERWAIT)); + } + + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + dwinPopupConfirm(icon, cstr, fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + dwinPopupConfirm(icon, fstr, fBtn); + } + + void onStatusChanged(const char * const) { dwinCheckStatusMessage(); } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode(const PauseMessage message, const PauseMode mode/*=PAUSE_MODE_SAME*/, const uint8_t extruder/*=active_extruder*/) { + if (mode != PAUSE_MODE_SAME) pause_mode = mode; + switch (message) { + case PAUSE_MESSAGE_PARKING: dwinPopupPause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; // M125 + case PAUSE_MESSAGE_CHANGING: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; // pause_print (M125, M600) + case PAUSE_MESSAGE_WAITING: dwinPopupPause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), BTN_Continue); break; + case PAUSE_MESSAGE_INSERT: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT), BTN_Continue); break; + case PAUSE_MESSAGE_LOAD: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; + case PAUSE_MESSAGE_UNLOAD: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; // Unload of pause and Unload of M702 + case PAUSE_MESSAGE_PURGE: dwinPopupPause(GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE))); break; + case PAUSE_MESSAGE_OPTION: gotoFilamentPurge(); break; + case PAUSE_MESSAGE_RESUME: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; + case PAUSE_MESSAGE_HEAT: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT), BTN_Continue); break; + case PAUSE_MESSAGE_HEATING: dwinPopupPause(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; + case PAUSE_MESSAGE_STATUS: hmiReturnScreen(); break; // Exit from Pause, Load and Unload + default: break; + } + } + #endif + + void onHomingStart() { dwinHomingStart(); } + void onHomingDone() { dwinHomingDone(); } + + void onPrintDone() {} + + void onFactoryReset() { dwinSetDataDefaults(); } + + // Copy settings to EEPROM buffer for write + void onStoreSettings(char *buff) { dwinCopySettingsTo(buff); } + + // Get settings from loaded EEPROM data + void onLoadSettings(const char *buff) { dwinCopySettingsFrom(buff); } + + void onPostprocessSettings() { + // Called after loading or resetting stored settings + } + + void onSettingsStored(const bool success) { + // Called after the entire EEPROM has been written, + // whether successful or not. + } + + void onSettingsLoaded(const bool success) { + // Called after the entire EEPROM has been read, + // whether successful or not. + } + + #if HAS_LEVELING + void onLevelingStart() { dwinLevelingStart(); } + void onLevelingDone() { dwinLevelingDone(); } + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return hmiData.bedLevT; } + #endif + #endif + + #if HAS_MESH + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { + const int16_t idx = ypos * (GRID_MAX_POINTS_X) + xpos; + dwinMeshUpdate(_MIN(idx, GRID_MAX_POINTS), int(GRID_MAX_POINTS), zval); + dwinRedrawScreen(); + } + + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const probe_state_t state) { + // Called to indicate a special condition + } + #endif + + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t t) { hmiData.extMinT = t; } + #endif + + #if ENABLED(POWER_LOSS_RECOVERY) + void onSetPowerLoss(const bool onoff) { + // Called when power-loss is enabled/disabled + } + void onPowerLoss() { + // Called when power-loss state is detected + } + void onPowerLossResume() { + // Called on resume from power-loss + recovery.ui_flag_resume = true; + } + #endif + + #if HAS_PID_HEATING + void onPIDTuning(const pidresult_t rst) { + // Called for temperature PID tuning result + switch (rst) { + #if ENABLED(PIDTEMP) + case PID_STARTED: dwinPIDTuning(PIDTEMP_START); break; + #endif + #if ENABLED(PIDTEMPBED) + case PID_BED_STARTED: dwinPIDTuning(PIDTEMPBED_START); break; + #endif + #if ENABLED(PIDTEMPCHAMBER) + case PID_CHAMBER_STARTED: dwinPIDTuning(PIDTEMPCHAMBER_START); break; + #endif + case PID_BAD_HEATER_ID: dwinPIDTuning(tempcontrol_t(PID_BAD_HEATER_ID)); break; + case PID_TEMP_TOO_HIGH: dwinPIDTuning(tempcontrol_t(PID_TEMP_TOO_HIGH)); break; + case PID_TUNING_TIMEOUT: dwinPIDTuning(tempcontrol_t(PID_TUNING_TIMEOUT)); break; + case PID_DONE: dwinPIDTuning(AUTOTUNE_DONE); break; + + } + } + + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + dwinStartM303(count, hid, temp); + } + + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + switch (rst) { + case MPC_STARTED: dwinMPCTuning(MPC_STARTED); break; + case MPC_TEMP_ERROR: dwinMPCTuning(MPC_TEMP_ERROR); break; + case MPC_INTERRUPTED: dwinMPCTuning(MPC_INTERRUPTED); break; + case MPC_DONE: dwinMPCTuning(AUTOTUNE_DONE); break; + } + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() { dwinRebootScreen(); } + #endif + + void onSteppersDisabled() {} + void onSteppersEnabled() {} + void onAxisDisabled(const axis_t axis) { + set_axis_untrusted(AxisEnum(axis)); // MRISCOC workaround: https://github.com/MarlinFirmware/Marlin/issues/23095 + } + void onAxisEnabled(const axis_t) {} + +} // ExtUI + +#endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp index 4ed0461afe..b983fa3740 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp @@ -45,11 +45,15 @@ namespace ExtUI { chiron.printerKilled(error, component); } - void onMediaInserted() { chiron.mediaEvent(AC_media_inserted); } - void onMediaError() { chiron.mediaEvent(AC_media_error); } - void onMediaRemoved() { chiron.mediaEvent(AC_media_removed); } + void onMediaMounted() { chiron.mediaEvent(AC_media_inserted); } + void onMediaError() { chiron.mediaEvent(AC_media_error); } + void onMediaRemoved() { chiron.mediaEvent(AC_media_removed); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) { + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { #if ENABLED(SPEAKER) ::tone(BEEPER_PIN, frequency, duration); #endif @@ -58,12 +62,34 @@ namespace ExtUI { void onPrintTimerStarted() { chiron.timerEvent(AC_timer_started); } void onPrintTimerPaused() { chiron.timerEvent(AC_timer_paused); } void onPrintTimerStopped() { chiron.timerEvent(AC_timer_stopped); } + void onPrintDone() {} - void onFilamentRunout(const extruder_t) { chiron.filamentRunout(); } + void onFilamentRunout(const extruder_t) { chiron.filamentRunout(); } - void onUserConfirmRequired(const char * const msg) { chiron.confirmationRequest(msg); } - void onStatusChanged(const char * const msg) { chiron.statusChange(msg); } + void onUserConfirmRequired(const char * const msg) { chiron.confirmationRequest(msg); } + + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + + void onStatusChanged(const char * const msg) { chiron.statusChange(msg); } void onHomingStart() {} void onHomingDone() {} @@ -107,6 +133,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -121,6 +150,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -133,13 +166,28 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPidTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} - void onSteppersEnabled() {} + void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // ANYCUBIC_LCD_CHIRON diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp index 63b1ef9c19..9e38face6f 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp @@ -564,8 +564,8 @@ void ChironTFT::panelInfo(uint8_t req) { } break; case 8: // A8 Get SD Card list A8 S0 - if (!isMediaInserted()) safe_delay(500); - if (!isMediaInserted()) // Make sure the card is removed + if (!isMediaMounted()) safe_delay(500); + if (!isMediaMounted()) // Make sure the card is removed tftSendLn(AC_msg_no_sd_card); else if (panel_command[3] == 'S') sendFileList( atoi( &panel_command[4] ) ); @@ -780,11 +780,11 @@ void ChironTFT::panelProcess(uint8_t req) { DEBUG_ECHOLNPGM("Moving to mesh point at x: ", pos.x, " y: ", pos.y, " z: ", pos_z); #endif // Go up before moving - setAxisPosition_mm(3.0,Z); + setAxisPosition_mm(3.0f, Z); - setAxisPosition_mm(17 + (93 * pos.x), X); - setAxisPosition_mm(20 + (93 * pos.y), Y); - setAxisPosition_mm(0.0, Z); + setAxisPosition_mm(17.0f + (93.0f * pos.x), X); + setAxisPosition_mm(20.0f + (93.0f * pos.y), Y); + setAxisPosition_mm(0.0f, Z); #if ACDEBUG(AC_INFO) DEBUG_ECHOLNPGM("Current Z: ", getAxisPosition_mm(Z)); #endif diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp index 2bd2a458b8..7070c22602 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp @@ -38,21 +38,50 @@ namespace ExtUI { void onStartup() { anycubicTFT.onSetup(); } void onIdle() { anycubicTFT.onCommandScan(); } void onPrinterKilled(FSTR_P const error, FSTR_P const component) { anycubicTFT.onKillTFT(); } - void onMediaInserted() { anycubicTFT.onSDCardStateChange(true); } + + void onMediaMounted() { anycubicTFT.onSDCardStateChange(true); } void onMediaError() { anycubicTFT.onSDCardError(); } void onMediaRemoved() { anycubicTFT.onSDCardStateChange(false); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) { + + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { TERN_(SPEAKER, ::tone(BEEPER_PIN, frequency, duration)); } void onPrintTimerStarted() { anycubicTFT.onPrintTimerStarted(); } void onPrintTimerPaused() { anycubicTFT.onPrintTimerPaused(); } void onPrintTimerStopped() { anycubicTFT.onPrintTimerStopped(); } + void onFilamentRunout(const extruder_t extruder) { anycubicTFT.onFilamentRunout(); } void onUserConfirmRequired(const char * const msg) { anycubicTFT.onUserConfirmRequired(msg); } + + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) {} void onHomingStart() {} void onHomingDone() {} + void onPrintDone() {} void onFactoryReset() {} @@ -94,6 +123,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -106,6 +138,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -119,13 +155,28 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPidTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} - void onSteppersEnabled() {} + void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // ANYCUBIC_LCD_I3MEGA 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 f8cba15676..66792ce5ca 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -138,8 +138,8 @@ void AnycubicTFT::onKillTFT() { SENDLINE_DBG_PGM("J11", "TFT Serial Debug: Kill command... J11"); } -void AnycubicTFT::onSDCardStateChange(bool isInserted) { - DEBUG_ECHOLNPGM("TFT Serial Debug: onSDCardStateChange event triggered...", isInserted); +void AnycubicTFT::onSDCardStateChange(bool isMounted) { + DEBUG_ECHOLNPGM("TFT Serial Debug: onSDCardStateChange event triggered...", isMounted); doSDCardStateCheck(); } @@ -283,7 +283,7 @@ void AnycubicTFT::handleSpecialMenu() { break; case '9': // "<09HtBedPID>" - SERIAL_ECHOLNPGM("Special Menu: ", F("Auto Tune Hotbed Pid")); + SERIAL_ECHOLNPGM("Special Menu: ", F("Auto Tune Hotbed PID")); injectCommands(F("M303 E-1 S65 C6 U1")); break; } @@ -328,7 +328,7 @@ void AnycubicTFT::handleSpecialMenu() { break; case '4': // "<04HtbedPID>" - SERIAL_ECHOLNPGM("Special Menu: ", F("Auto Tune Hotbed Pid")); + SERIAL_ECHOLNPGM("Special Menu: ", F("Auto Tune Hotbed PID")); injectCommands(F("M303 E-1 S65 C6 U1")); break; @@ -363,7 +363,7 @@ void AnycubicTFT::renderCurrentFileList() { SENDLINE_PGM("FN "); // Filelist start - if (!isMediaInserted() && !specialMenu) { + if (!isMediaMounted() && !specialMenu) { SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to render Current File List... J02"); SENDLINE_PGM(" 0) { FileList currentFileList; if ((selectedDirectory[0] == '.') && (selectedDirectory[1] == '.')) { @@ -883,12 +883,12 @@ void AnycubicTFT::getCommandFromTFT() { } void AnycubicTFT::doSDCardStateCheck() { - #if ALL(HAS_MEDIA, HAS_SD_DETECT) - bool isInserted = isMediaInserted(); - if (isInserted) - SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted"); + #if HAS_MEDIA + const bool isMounted = isMediaMounted(); + if (isMounted) + SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isMounted"); else - SENDLINE_DBG_PGM("J01", "TFT Serial Debug: SD card state changed... !isInserted"); + SENDLINE_DBG_PGM("J01", "TFT Serial Debug: SD card state changed... !isMounted"); #endif } @@ -897,7 +897,7 @@ void AnycubicTFT::doFilamentRunoutCheck() { #if ENABLED(FILAMENT_RUNOUT_SENSOR) // NOTE: getFilamentRunoutState() only returns the runout state if the job is printing // we want to actually check the status of the pin here, regardless of printstate - if (READ(FIL_RUNOUT1_PIN)) { + if (READ(FIL_RUNOUT1_PIN) == FIL_RUNOUT1_STATE) { if (mediaPrintingState == AMPRINTSTATE_PRINTING || mediaPrintingState == AMPRINTSTATE_PAUSED || mediaPrintingState == AMPRINTSTATE_PAUSE_REQUESTED) { // play tone to indicate filament is out injectCommands(F("\nM300 P200 S1567\nM300 P200 S1174\nM300 P200 S1567\nM300 P200 S1174\nM300 P2000 S1567")); @@ -940,7 +940,7 @@ void AnycubicTFT::pausePrint() { void AnycubicTFT::resumePrint() { #if HAS_MEDIA #if ENABLED(FILAMENT_RUNOUT_SENSOR) - if (READ(FIL_RUNOUT1_PIN)) { + if (READ(FIL_RUNOUT1_PIN) == FIL_RUNOUT1_STATE) { DEBUG_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... "); // trigger the user message box diff --git a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp index ed4f8c7367..9be00411cc 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp @@ -39,6 +39,7 @@ #include "../../../core/serial.h" #include "../../../module/stepper.h" #include "../../../module/probe.h" +#include "../../../module/temperature.h" #if ENABLED(POWER_LOSS_RECOVERY) #include "../../../feature/powerloss.h" @@ -1267,7 +1268,7 @@ namespace Anycubic { break; case 4: // page refresh - if (!isMediaInserted()) safe_delay(500); + if (!isMediaMounted()) safe_delay(500); filenavigator.reset(); diff --git a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.h b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.h index 371066a569..514e8c7303 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.h +++ b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.h @@ -281,7 +281,6 @@ #define KEY_LEVEL_DEC 2 #define KEY_LEVEL_ENSURE 4 - #define KEY_PREPARE_TO_PREHEAT 3 #define KEY_PREHEAT_TO_PREPARE 1 #define KEY_PREHEAT_PLA 2 diff --git a/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp b/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp index 470fe10c43..4b18b0a380 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp @@ -45,11 +45,15 @@ namespace ExtUI { dgus.printerKilled(error, component); } - void onMediaInserted() { dgus.mediaEvent(AC_media_inserted); } - void onMediaError() { dgus.mediaEvent(AC_media_error); } - void onMediaRemoved() { dgus.mediaEvent(AC_media_removed); } + void onMediaMounted() { dgus.mediaEvent(AC_media_inserted); } + void onMediaError() { dgus.mediaEvent(AC_media_error); } + void onMediaRemoved() { dgus.mediaEvent(AC_media_removed); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) { + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { #if ENABLED(SPEAKER) ::tone(BEEPER_PIN, frequency, duration); #endif @@ -58,12 +62,34 @@ namespace ExtUI { void onPrintTimerStarted() { dgus.timerEvent(AC_timer_started); } void onPrintTimerPaused() { dgus.timerEvent(AC_timer_paused); } void onPrintTimerStopped() { dgus.timerEvent(AC_timer_stopped); } + void onPrintDone() {} - void onFilamentRunout(const extruder_t) { dgus.filamentRunout(); } + void onFilamentRunout(const extruder_t) { dgus.filamentRunout(); } void onUserConfirmRequired(const char * const msg) { dgus.confirmationRequest(msg); } - void onStatusChanged(const char * const msg) { dgus.statusChange(msg); } + + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + + void onStatusChanged(const char * const msg) { dgus.statusChange(msg); } void onHomingStart() { dgus.homingStart(); } void onHomingDone() { dgus.homingComplete(); } @@ -111,6 +137,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -125,6 +154,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) // Called when power-loss is enabled/disabled void onSetPowerLoss(const bool) { dgus.powerLoss(); } @@ -135,20 +168,28 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPidTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result - switch (rst) { - case PID_STARTED: break; - case PID_BAD_HEATER_ID: break; - case PID_TEMP_TOO_HIGH: break; - case PID_TUNING_TIMEOUT: break; - case PID_DONE: break; - } + } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI } #endif + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} + #endif + void onSteppersDisabled() {} - void onSteppersEnabled() {} + void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // ANYCUBIC_LCD_VYPER diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index 4403716fff..00876f10e1 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -62,7 +62,7 @@ void (*DGUSScreenHandler::confirm_action_cb)() = nullptr; filament_data_t filament_data; #endif -void DGUSScreenHandler::sendInfoScreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool l4inflash) { +void DGUSScreenHandler::sendInfoScreen_P(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool l4inflash) { DGUS_VP_Variable ramcopy; if (populate_VPVar(VP_MSGSTR1, &ramcopy)) { ramcopy.memadr = (void*) line1; @@ -89,7 +89,7 @@ void DGUSScreenHandler::handleUserConfirmationPopUp(uint16_t VP, PGM_P const lin popToOldScreen(); confirmVP = VP; - sendInfoScreen(line1, line2, line3, line4, l1, l2, l3, l4); + sendInfoScreen_P(line1, line2, line3, line4, l1, l2, l3, l4); gotoScreen(DGUS_SCREEN_CONFIRM); } @@ -264,7 +264,7 @@ void DGUSScreenHandler::sendHeaterStatusToDisplay(DGUS_VP_Variable &var) { void DGUSScreenHandler::screenChangeHookIfSD(DGUS_VP_Variable &var, void *val_ptr) { // default action executed when there is a SD card, but not printing - if (ExtUI::isMediaInserted() && !ExtUI::isPrintingFromMedia()) { + if (ExtUI::isMediaMounted() && !ExtUI::isPrintingFromMedia()) { screenChangeHook(var, val_ptr); dgus.requestScreen(current_screenID); return; @@ -279,7 +279,7 @@ void DGUSScreenHandler::sendHeaterStatusToDisplay(DGUS_VP_Variable &var) { } // Don't let the user in the dark why there is no reaction. - if (!ExtUI::isMediaInserted()) { + if (!ExtUI::isMediaMounted()) { setStatusMessage(GET_TEXT_F(MSG_NO_MEDIA)); return; } diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h index 3764920be1..8ee0fa68c8 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandlerBase.h @@ -37,12 +37,12 @@ public: // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. - static void sendInfoScreen(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); + static void sendInfoScreen_P(PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); static void sendInfoScreen(FSTR_P const line1, FSTR_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { - sendInfoScreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); + sendInfoScreen_P(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } static void sendInfoScreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { - sendInfoScreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); + sendInfoScreen_P(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } static void handleUserConfirmationPopUp(uint16_t confirmVP, PGM_P const line1, PGM_P const line2, PGM_P const line3, PGM_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); diff --git a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp index 30d1c710b2..adc78caf07 100644 --- a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp +++ b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp @@ -48,11 +48,15 @@ namespace ExtUI { while (!screen.loop()); // Wait while anything is left to be sent } - void onMediaInserted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); } - void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); } - void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); } + void onMediaMounted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); } + void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); } + void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) {} + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {} void onPrintTimerStarted() {} void onPrintTimerPaused() {} void onPrintTimerStopped() {} @@ -70,10 +74,31 @@ namespace ExtUI { } } + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) { screen.setStatusMessage(msg); } void onHomingStart() {} void onHomingDone() {} + void onPrintDone() {} void onFactoryReset() {} @@ -115,6 +140,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -127,6 +155,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -141,10 +173,12 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPidTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result switch (rst) { case PID_STARTED: + case PID_BED_STARTED: + case PID_CHAMBER_STARTED: screen.setStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; case PID_BAD_HEATER_ID: @@ -162,10 +196,40 @@ namespace ExtUI { } screen.gotoScreen(DGUS_SCREEN_MAIN); } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + switch (rst) { + case MPC_STARTED: + screen.setStatusMessage(GET_TEXT_F(MSG_MPC_AUTOTUNE)); + break; + case MPC_TEMP_ERROR: + //screen.setStatusMessage(GET_TEXT_F(MSG_MPC_TEMP_ERROR)); + break; + case MPC_INTERRUPTED: + //screen.setStatusMessage(GET_TEXT_F(MSG_MPC_INTERRUPTED)); + break; + case MPC_DONE: + //screen.setStatusMessage(GET_TEXT_F(MSG_MPC_AUTOTUNE_DONE)); + break; + } + screen.gotoScreen(DGUS_SCREEN_MAIN); + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} - void onSteppersEnabled() {} + void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // HAS_DGUS_LCD_CLASSIC diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp index 5878d145ea..d78364cb3b 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp @@ -33,7 +33,7 @@ #include "../../../../module/planner.h" #include "../../ui_api.h" -#include "../../../marlinui.h" +#include "../../../marlinui.h" // For material presets #if HAS_STEALTHCHOP #include "../../../../module/stepper/trinamic.h" diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h index 53e57e1c65..da2cf96a87 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h @@ -241,7 +241,6 @@ enum DGUS_ScreenID : uint8_t { DGUS_SCREEN_UNUSED = 255 }; - // Place for status messages. constexpr uint16_t VP_M117 = 0x7020; constexpr uint8_t VP_M117_LEN = 0x20; @@ -299,7 +298,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040; constexpr uint16_t VP_MARLIN_VERSION = 0x1A00; constexpr uint8_t VP_MARLIN_VERSION_LEN = 16; // there is more space on the display, if needed. - constexpr uint16_t VP_SCREENCHANGE_ASK = 0x1500; constexpr uint16_t VP_SCREENCHANGE = 0x1501; // Key-Return button to new menu pressed. Data contains target screen in low byte and info in high byte. constexpr uint16_t VP_TEMP_ALL_OFF = 0x1502; // Turn all heaters off. Value arbitrary ;)= @@ -515,7 +513,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040; constexpr uint16_t VP_TMC_E1_Current = 0x3442; constexpr uint16_t VP_TMC_Z1_Current = 0x3444; - constexpr uint16_t VP_PrintTime_H = 0x3500; constexpr uint16_t VP_PrintTime_M = 0x3502; constexpr uint16_t VP_PrintTime_S = 0x3504; @@ -591,7 +588,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040; constexpr uint16_t VP_Level_Point_Five_X = 0x4110; constexpr uint16_t VP_Level_Point_Five_Y = 0x4112; - /* H43 Version */ constexpr uint16_t VP_MKS_H43_VERSION = 0x4A00; // MKS H43 V1.0.0 constexpr uint16_t VP_MKS_H43_VERSION_LEN = 16; @@ -630,7 +626,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040; constexpr uint16_t VP_E0_Max_Acc_Speed_Dis = 0x5210; constexpr uint16_t VP_E1_Max_Acc_Speed_Dis = 0x5220; - constexpr uint16_t VP_PrintTime_Dis = 0x5470; constexpr uint16_t VP_E0_Temp_Dis = 0x5310; constexpr uint16_t VP_E1_Temp_Dis = 0x5320; @@ -641,12 +636,10 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040; constexpr uint16_t VP_Min_Ex_Temp_Dis = 0x5380; - constexpr uint16_t VP_X_PARK_POS_Dis = 0x53E0; constexpr uint16_t VP_Y_PARK_POS_Dis = 0x53F0; constexpr uint16_t VP_Z_PARK_POS_Dis = 0x5400; - constexpr uint16_t VP_TravelAcc_Dis = 0x5440; constexpr uint16_t VP_FeedRateMin_Dis = 0x5450; constexpr uint16_t VP_TravelFeeRateMin_Dis = 0x5460; diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.cpp index b897466c6a..571626aa77 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.cpp @@ -337,8 +337,8 @@ void DGUSDisplay::processRx() { size_t DGUSDisplay::getFreeTxBuffer() { return ( - #ifdef LCD_SERIAL_GET_TX_BUFFER_FREE - LCD_SERIAL_GET_TX_BUFFER_FREE() + #ifdef LCD_SERIAL_TX_BUFFER_FREE + LCD_SERIAL_TX_BUFFER_FREE() #else SIZE_MAX #endif diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h index 8d8a3cf013..f635c3191b 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h @@ -71,7 +71,7 @@ public: write(addr, static_cast(&data), sizeof(T)); } - // Until now I did not need to actively read from the display. That's why there is no ReadVariable + // Until now I did not need to actively read from the display. That's why there is no readVariable // (I extensively use the auto upload of the display) // Read GUI and OS version from screen diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSReturnKeyCodeHandler.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSReturnKeyCodeHandler.cpp index f6d2e2bb89..0cc011b2f9 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSReturnKeyCodeHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSReturnKeyCodeHandler.cpp @@ -72,7 +72,7 @@ void DGUSReturnKeyCodeHandler::Command_MenuSelect(DGUS_VP &vp, void *data) { break; case DGUS_Data::MenuSelectCommand::Print: - if (ExtUI::isMediaInserted()) { + if (ExtUI::isMediaMounted()) { dgus_sdcard_handler.Reset(); screen.triggerScreenChange(DGUS_ScreenID::FILE1); } @@ -241,7 +241,7 @@ void DGUSReturnKeyCodeHandler::Command_CheckOK(DGUS_VP &vp, void *data) { #endif // HAS_FILAMENT_SENSOR case DGUS_Data::CheckOKCommand::SDCardCheck_Yes: - if (ExtUI::isMediaInserted()) { + if (ExtUI::isMediaMounted()) { dgus_sdcard_handler.Reset(); screen.triggerScreenChange(DGUS_ScreenID::FILE1); } @@ -401,15 +401,14 @@ static void _gotoTrammingPoint(unsigned char point) { switch (point) { default: return; case 1: x = X_CENTER; y = Y_CENTER; break; - case 2: x = X_MIN_POS + lfrb[0]; y = Y_MIN_POS + lfrb[1]; break; - case 3: x = X_MAX_POS - lfrb[2]; y = Y_MIN_POS + lfrb[1]; break; - case 4: x = X_MAX_POS - lfrb[2]; y = Y_MAX_POS - lfrb[3]; break; - case 5: x = X_MIN_POS + lfrb[0]; y = Y_MAX_POS - lfrb[3]; break; + case 2: x = X_MIN_BED + lfrb[0]; y = Y_MIN_BED + lfrb[1]; break; + case 3: x = X_MAX_BED - lfrb[2]; y = Y_MIN_BED + lfrb[1]; break; + case 4: x = X_MAX_BED - lfrb[2]; y = Y_MAX_BED - lfrb[3]; break; + case 5: x = X_MIN_BED + lfrb[0]; y = Y_MAX_BED - lfrb[3]; break; } - 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); - + if (BED_TRAMMING_Z_HOP) + ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(ExtUI::Z) + (BED_TRAMMING_Z_HOP), ExtUI::Z); ExtUI::setAxisPosition_mm(x, ExtUI::X); ExtUI::setAxisPosition_mm(y, ExtUI::Y); ExtUI::setAxisPosition_mm((Z_MIN_POS) + (BED_TRAMMING_HEIGHT), ExtUI::Z); diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp index 94c881f384..c88412fe2c 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp @@ -281,7 +281,7 @@ void DGUSScreenHandler::configurationStoreRead(bool success) { } } -void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration) { +void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration/*=0*/) { if (WITHIN(frequency, 1, 255)) { if (WITHIN(duration, 1, 255)) dgus.playSound((uint8_t)frequency, (uint8_t)duration); @@ -369,7 +369,7 @@ void DGUSScreenHandler::addCurrentPageStringLength(size_t stringLength, size_t t #endif #if HAS_PID_HEATING - void DGUSScreenHandler::pidTuning(const ExtUI::result_t rst) { + void DGUSScreenHandler::pidTuning(const ExtUI::pidresult_t rst) { dgus.playSound(3); } #endif diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h index 9220f09aa3..2f8c53f14d 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h @@ -99,7 +99,7 @@ public: static void configurationStoreWritten(bool success); static void configurationStoreRead(bool success); - static void playTone(const uint16_t frequency, const uint16_t duration); + static void playTone(const uint16_t frequency, const uint16_t duration=0); static void angryBeeps(const uint8_t beepCount); static void levelingStart(); @@ -132,7 +132,7 @@ public: #endif #if HAS_PID_HEATING - static void pidTuning(const ExtUI::result_t rst); + static void pidTuning(const ExtUI::pidresult_t rst); #endif static void steppersStatusChanged(bool steppersEnabled); diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSTxHandler.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSTxHandler.cpp index 3a9ca9c762..c717740791 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSTxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSTxHandler.cpp @@ -84,7 +84,7 @@ void DGUSTxHandler::levelingProgressIcon(DGUS_VP &vp) { #endif void DGUSTxHandler::sdCardInsertionStatus(DGUS_VP &vp) { - const uint16_t data = ExtUI::isMediaInserted() ? 1 : 0; + const uint16_t data = ExtUI::isMediaMounted() ? 1 : 0; dgus.write((uint16_t)vp.addr, Endianness::toBE(data)); } diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/config/DGUS_Constants.h b/Marlin/src/lcd/extui/dgus_e3s1pro/config/DGUS_Constants.h index 3c89f7ad8a..030fc81671 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/config/DGUS_Constants.h +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/config/DGUS_Constants.h @@ -45,13 +45,3 @@ #ifndef DGUS_STATUS_EXPIRATION_MS #define DGUS_STATUS_EXPIRATION_MS 30000 #endif - -#ifndef BED_TRAMMING_Z_HOP - #define BED_TRAMMING_Z_HOP 4.0 -#endif - -#ifndef BED_TRAMMING_HEIGHT - #define BED_TRAMMING_HEIGHT 0.0 -#endif - -static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0. Please update your configuration."); diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/definition/DGUS_ScreenAddrList.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/definition/DGUS_ScreenAddrList.cpp index 00083ced8c..7f2697513a 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/definition/DGUS_ScreenAddrList.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/definition/DGUS_ScreenAddrList.cpp @@ -153,7 +153,6 @@ constexpr DGUS_Addr LIST_CONTROL[] PROGMEM = { DGUS_Addr::END }; - constexpr DGUS_Addr LIST_ADJUST[] PROGMEM = { DGUS_Addr::ADJUST_Icon_Adjust, DGUS_Addr::IO_Icon_ExtruderTemp, diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp index 4916c0b59e..3b3f6db5b2 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp @@ -55,11 +55,15 @@ namespace ExtUI { screen.printerKilled(error, component); } - void onMediaInserted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); } - void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); } - void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); } + void onMediaMounted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); } + void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); } + void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) { + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { screen.playTone(frequency, duration); } @@ -83,6 +87,26 @@ namespace ExtUI { screen.userConfirmRequired(msg); } + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) { screen.setStatusMessage(msg); } @@ -117,22 +141,25 @@ namespace ExtUI { screen.configurationStoreRead(success); } + #if HAS_LEVELING + void onLevelingStart() { screen.levelingStart(); } + void onLevelingDone() { screen.levelingEnd(); } + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif + #endif + #if HAS_MESH - void onLevelingStart() { - screen.levelingStart(); - } - - void onLevelingDone() { - screen.levelingEnd(); - } - void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { screen.meshUpdate(xpos, ypos); } - void onMeshUpdate(const int8_t xpos, const int8_t ypos, const probe_state_t state) { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -147,10 +174,23 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPidTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result screen.pidTuning(rst); } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature PID tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() { @@ -160,6 +200,9 @@ namespace ExtUI { void onSteppersEnabled() { screen.steppersStatusChanged(true); } + + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // DGUS_LCD_UI_RELOADED diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp index 3127268180..741c36fde6 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp @@ -334,8 +334,8 @@ void DGUSDisplay::processRx() { size_t DGUSDisplay::getFreeTxBuffer() { return ( - #ifdef LCD_SERIAL_GET_TX_BUFFER_FREE - LCD_SERIAL_GET_TX_BUFFER_FREE() + #ifdef LCD_SERIAL_TX_BUFFER_FREE + LCD_SERIAL_TX_BUFFER_FREE() #else SIZE_MAX #endif diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h index 7c27162ce6..63830ddee5 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h @@ -74,7 +74,7 @@ public: write(addr, static_cast(&data), sizeof(T)); } - // Until now I did not need to actively read from the display. That's why there is no ReadVariable + // Until now I did not need to actively read from the display. That's why there is no readVariable // (I extensively use the auto upload of the display) // Read GUI and OS version from screen diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index c953b417a5..d408b49e83 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -49,7 +49,7 @@ void DGUSRxHandler::screenChange(DGUS_VP &vp, void *data_ptr) { #if HAS_MEDIA IF_DISABLED(HAS_SD_DETECT, card.mount()); - if (!ExtUI::isMediaInserted()) { + if (!ExtUI::isMediaMounted()) { screen.setStatusMessage(GET_TEXT_F(MSG_NO_MEDIA)); return; } @@ -474,29 +474,28 @@ void DGUSRxHandler::moveToPoint(DGUS_VP &vp, void *data_ptr) { y = DGUS_LEVEL_CENTER_Y; break; case 2: - x = X_MIN_POS + lfrb[0]; - y = Y_MIN_POS + lfrb[1]; + x = X_MIN_BED + lfrb[0]; + y = Y_MIN_BED + lfrb[1]; break; case 3: - x = X_MAX_POS - lfrb[2]; - y = Y_MIN_POS + lfrb[1]; + x = X_MAX_BED - lfrb[2]; + y = Y_MIN_BED + lfrb[1]; break; case 4: - x = X_MAX_POS - lfrb[2]; - y = Y_MAX_POS - lfrb[3]; + x = X_MAX_BED - lfrb[2]; + y = Y_MAX_BED - lfrb[3]; break; case 5: - x = X_MIN_POS + lfrb[0]; - y = Y_MAX_POS - lfrb[3]; + x = X_MIN_BED + lfrb[0]; + y = Y_MAX_BED - lfrb[3]; break; } - 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); - } + if (BED_TRAMMING_Z_HOP) + ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(ExtUI::Z) + (BED_TRAMMING_Z_HOP), ExtUI::Z); ExtUI::setAxisPosition_mm(x, ExtUI::X); ExtUI::setAxisPosition_mm(y, ExtUI::Y); - ExtUI::setAxisPosition_mm(Z_MIN_POS + BED_TRAMMING_HEIGHT, ExtUI::Z); + ExtUI::setAxisPosition_mm((Z_MIN_POS) + (BED_TRAMMING_HEIGHT), ExtUI::Z); } void DGUSRxHandler::probe(DGUS_VP &vp, void *data_ptr) { @@ -598,7 +597,7 @@ void DGUSRxHandler::filamentMove(DGUS_VP &vp, void *data_ptr) { } if (ExtUI::getActualTemp_celsius(extruder) < (float)EXTRUDE_MINTEMP) { - screen.setStatusMessage(GET_TEXT_F(DGUS_MSG_TEMP_TOO_LOW)); + screen.setStatusMessage(GET_TEXT_F(MSG_TEMP_TOO_LOW)); return; } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index 703c56d1e1..bb31a1d71a 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -149,7 +149,7 @@ void DGUSScreenHandler::loop() { void DGUSScreenHandler::printerKilled(FSTR_P const error, FSTR_P const component) { setMessageLine(error, 1); setMessageLine(component, 2); - setMessageLinePGM(NUL_STR, 3); + setMessageLine_P(NUL_STR, 3); setMessageLine(GET_TEXT_F(MSG_PLEASE_RESET), 4); dgus.playSound(3, 1, 200); @@ -158,10 +158,10 @@ void DGUSScreenHandler::printerKilled(FSTR_P const error, FSTR_P const component } void DGUSScreenHandler::userConfirmRequired(const char * const msg) { - setMessageLinePGM(NUL_STR, 1); + setMessageLine_P(NUL_STR, 1); setMessageLine(msg, 2); - setMessageLinePGM(NUL_STR, 3); - setMessageLinePGM(NUL_STR, 4); + setMessageLine_P(NUL_STR, 3); + setMessageLine_P(NUL_STR, 4); dgus.playSound(3); @@ -224,7 +224,7 @@ void DGUSScreenHandler::configurationStoreRead(bool success) { } } -void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration) { +void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration/*=0*/) { if (WITHIN(frequency, 1, 255)) { if (WITHIN(duration, 1, 255)) dgus.playSound((uint8_t)frequency, (uint8_t)duration); @@ -305,9 +305,11 @@ void DGUSScreenHandler::filamentRunout(const ExtUI::extruder_t extruder) { #if HAS_PID_HEATING - void DGUSScreenHandler::pidTuning(const ExtUI::result_t rst) { + void DGUSScreenHandler::pidTuning(const ExtUI::pidresult_t rst) { switch (rst) { case ExtUI::PID_STARTED: + case ExtUI::PID_BED_STARTED: + case ExtUI::PID_CHAMBER_STARTED: setStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; case ExtUI::PID_BAD_HEATER_ID: @@ -349,7 +351,7 @@ void DGUSScreenHandler::setMessageLine(const char * const msg, const uint8_t lin } } -void DGUSScreenHandler::setMessageLinePGM(PGM_P const msg, const uint8_t line) { +void DGUSScreenHandler::setMessageLine_P(PGM_P const msg, const uint8_t line) { switch (line) { default: return; case 1: @@ -387,10 +389,10 @@ void DGUSScreenHandler::showWaitScreen(const DGUS_ScreenID return_screenID, cons } void DGUSScreenHandler::showWaitScreen(FSTR_P const msg, const DGUS_ScreenID return_screenID, const bool has_continue/*=false*/) { - setMessageLinePGM(NUL_STR, 1); + setMessageLine_P(NUL_STR, 1); setMessageLine(msg, 2); - setMessageLinePGM(NUL_STR, 3); - setMessageLinePGM(NUL_STR, 4); + setMessageLine_P(NUL_STR, 3); + setMessageLine_P(NUL_STR, 4); showWaitScreen(return_screenID, has_continue); } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h index e5942ad44d..d233ed6fe3 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h @@ -45,7 +45,7 @@ public: static void configurationStoreWritten(bool success); static void configurationStoreRead(bool success); - static void playTone(const uint16_t frequency, const uint16_t duration); + static void playTone(const uint16_t frequency, const uint16_t duration=0); static void meshUpdate(const int8_t xpos, const int8_t ypos); static void printTimerStarted(); static void printTimerPaused(); @@ -66,12 +66,12 @@ public: #endif #if HAS_PID_HEATING - static void pidTuning(const ExtUI::result_t rst); + static void pidTuning(const ExtUI::pidresult_t rst); #endif static void setMessageLine(const char * const msg, const uint8_t line); - static void setMessageLinePGM(PGM_P const msg, const uint8_t line); - static void setMessageLine(FSTR_P const msg, const uint8_t line) { setMessageLinePGM(FTOP(msg), line); } + static void setMessageLine_P(PGM_P const msg, const uint8_t line); + static void setMessageLine(FSTR_P const msg, const uint8_t line) { setMessageLine_P(FTOP(msg), line); } static void setStatusMessage(const char* msg, const millis_t duration=DGUS_STATUS_EXPIRATION_MS); static void setStatusMessage(FSTR_P const msg, const millis_t duration=DGUS_STATUS_EXPIRATION_MS); 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 dda3c888fe..0562b89239 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Constants.h @@ -73,16 +73,6 @@ #define DGUS_DEFAULT_FILAMENT_LEN 10 #endif -#ifndef BED_TRAMMING_Z_HOP - #define BED_TRAMMING_Z_HOP 4.0 -#endif - -#ifndef BED_TRAMMING_HEIGHT - #define BED_TRAMMING_HEIGHT 0.0 -#endif - -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) #endif diff --git a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp index 68e405776e..9aeb06dba1 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp @@ -50,11 +50,15 @@ namespace ExtUI { screen.printerKilled(error, component); } - void onMediaInserted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); } + void onMediaMounted() { TERN_(HAS_MEDIA, screen.sdCardInserted()); } void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); } void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) { + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { screen.playTone(frequency, duration); } @@ -78,12 +82,33 @@ namespace ExtUI { screen.userConfirmRequired(msg); } + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) { screen.setStatusMessage(msg); } void onHomingStart() {} void onHomingDone() {} + void onPrintDone() {} void onFactoryReset() { @@ -111,6 +136,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -124,6 +152,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -138,14 +170,29 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPidTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result screen.pidTuning(rst); } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature PID tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} - void onSteppersEnabled() {} + void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // DGUS_LCD_UI_RELOADED diff --git a/Marlin/src/lcd/extui/example/example.cpp b/Marlin/src/lcd/extui/example/example.cpp index e78e4b9679..05d4730149 100644 --- a/Marlin/src/lcd/extui/example/example.cpp +++ b/Marlin/src/lcd/extui/example/example.cpp @@ -47,19 +47,44 @@ namespace ExtUI { } void onIdle() {} void onPrinterKilled(FSTR_P const error, FSTR_P const component) {} - void onMediaInserted() {} + + void onMediaMounted() {} void onMediaError() {} void onMediaRemoved() {} - void onPlayTone(const uint16_t frequency, const uint16_t duration) {} + + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {} + void onPrintTimerStarted() {} void onPrintTimerPaused() {} void onPrintTimerStopped() {} + void onFilamentRunout(const extruder_t extruder) {} + void onUserConfirmRequired(const char * const msg) {} + + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) {} + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) {} + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) {} void onHomingStart() {} void onHomingDone() {} + void onPrintDone() {} void onFactoryReset() {} @@ -101,6 +126,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -113,6 +141,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -126,20 +158,43 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPidTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result switch (rst) { - case PID_STARTED: break; - case PID_BAD_HEATER_ID: break; - case PID_TEMP_TOO_HIGH: break; - case PID_TUNING_TIMEOUT: break; - case PID_DONE: break; + case PID_STARTED: + case PID_BED_STARTED: + case PID_CHAMBER_STARTED: break; + case PID_BAD_HEATER_ID: break; + case PID_TEMP_TOO_HIGH: break; + case PID_TUNING_TIMEOUT: break; + case PID_DONE: break; + } + } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature MPC tuning result + switch (rst) { + case MPC_STARTED: break; + case MPC_TEMP_ERROR: break; + case MPC_INTERRUPTED: break; + case MPC_DONE: break; } } #endif + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} + #endif + void onSteppersDisabled() {} - void onSteppersEnabled() {} + void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // EXTUI_EXAMPLE && EXTENSIBLE_UI diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp index 9fb56bce11..72a1d739f4 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/bioprinter/status_screen.cpp @@ -244,7 +244,7 @@ void StatusScreen::draw_overlay_icons(draw_mode_t what) { void StatusScreen::draw_buttons(draw_mode_t what) { int16_t x, y, h, v; - const bool has_media = isMediaInserted() && !isPrintingFromMedia(); + const bool has_media = isMediaMounted() && !isPrintingFromMedia(); CommandProcessor cmd; PolyUI ui(cmd, what); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h index 3e2b5546e9..162c32b956 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h @@ -22,7 +22,6 @@ #pragma once - /********************************* DL CACHE SLOTS ******************************/ // In order to reduce SPI traffic, we cache display lists (DL) in RAMG. This diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp index fd73ca0a4b..df29ac4d23 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp @@ -38,7 +38,6 @@ void StatisticsScreen::onRedraw(draw_mode_t what) { if (what & BACKGROUND) { char buffer[21]; - cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) .cmd(CLEAR(true,true,true)) .cmd(COLOR_RGB(bg_text_enabled)) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp index 421d90bf7f..b273ac7dde 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp @@ -227,8 +227,8 @@ void StatusScreen::draw_buttons(draw_mode_t what) { if (what & FOREGROUND) { int16_t x, y, w, h; - const bool can_print = !isPrinting() && isMediaInserted() && isFileSelected(); - const bool can_select = !isPrinting() && isMediaInserted(); + const bool can_print = !isPrinting() && isMediaMounted() && isFileSelected(); + const bool can_select = !isPrinting() && isMediaMounted(); const bool sdOrHostPrinting = ExtUI::isPrinting(); const bool sdOrHostPaused = ExtUI::isPrintingPaused(); @@ -284,7 +284,7 @@ void StatusScreen::draw_file(draw_mode_t what) { .cmd (BITMAP_SIZE (File_Icon_Info)) .icon(ICON_POS(x, y, w, h), File_Icon_Info, icon_scale); - if (!isMediaInserted()) + if (!isMediaMounted()) draw_text_with_ellipsis(cmd, TEXT_POS(x, y, w, h), F("No media present"), OPT_CENTERY, font_small); else if (isFileSelected()) { FileList list; @@ -311,7 +311,7 @@ void StatusScreen::draw_message(draw_mode_t what, const char *message) { } bool StatusScreen::isFileSelected() { - if (!isMediaInserted()) return false; + if (!isMediaMounted()) return false; FileList list; if (list.isDir()) return false; const char *filename = list.filename(); @@ -431,7 +431,7 @@ void StatusScreen::onIdle() { } } -void StatusScreen::onMediaInserted() { +void StatusScreen::onMediaMounted() { if (AT_SCREEN(StatusScreen)) setStatusMessage(GET_TEXT_F(MSG_MEDIA_INSERTED)); } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h index 57cf2308ab..4833bbd941 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h @@ -58,6 +58,6 @@ class StatusScreen : public BaseScreen, public CachedScreen. * ****************************************************************************/ - #include "../../../../MarlinCore.h" #if ENABLED(TOUCH_UI_FTDI_EVE) #include "language.h" diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp index c7607f71d0..b17ac9c7cb 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp @@ -26,7 +26,6 @@ #include "screens.h" tiny_timer_t refresh_timer; - /** * DECL_SCREEN_IF_INCLUDED allows for a concise * definition of SCREEN_TABLE: diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bootscreen_logo_portrait.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bootscreen_logo_portrait.h deleted file mode 100644 index 169a306afc..0000000000 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bootscreen_logo_portrait.h +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * To view a copy of the GNU General Public License, go to the following * - * location: . * - ****************************************************************************/ - -/** - * This file was auto-generated using "svg2cpp.pl" - * - * The encoding consists of x,y pairs with the min and max scaled to - * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the - * start of a new closed path. - */ -#pragma once - -constexpr float x_min = 0.000000, x_max = 272.000000, - y_min = 0.000000, y_max = 480.000000; - -const PROGMEM uint16_t logo_green[] = {0x8048, 0x46D9, 0x27BC, 0x9DBA, 0xD8D3, 0x9DBA}; -const PROGMEM uint16_t logo_mark[] = {0xDB9F, 0xAC0C, 0xDA6F, 0xAC2D, 0xD970, 0xAC91, 0xD8C0, 0xAD23, 0xD885, 0xADCF, 0xD8C0, 0xAE7A, 0xD970, 0xAF0C, 0xDA6F, 0xAF6F, 0xDB9F, 0xAF8F, 0xDCCE, 0xAF6F, 0xDDD0, 0xAF0C, 0xDE7D, 0xAE7B, 0xDEB9, 0xADCF, 0xDE7D, 0xAD22, 0xDDD0, 0xAC91, 0xDCCE, 0xAC2D, 0xFFFF, 0xDB9F, 0xABC3, 0xDCFE, 0xABEA, 0xDE28, 0xAC5E, 0xDEF1, 0xAD06, 0xDF36, 0xADCF, 0xDEF1, 0xAE95, 0xDE28, 0xAF3E, 0xDCFE, 0xAFB1, 0xDB9F, 0xAFD8, 0xDA3F, 0xAFB1, 0xD916, 0xAF3E, 0xD849, 0xAE95, 0xD808, 0xADCF, 0xD849, 0xAD06, 0xD916, 0xAC5E, 0xDA3F, 0xABEA, 0xFFFF, 0xDB7D, 0xACE6, 0xDAE4, 0xACE6, 0xDAE4, 0xADA9, 0xDB7D, 0xADA9, 0xDC3B, 0xAD94, 0xDC71, 0xAD48, 0xDC3B, 0xACFD, 0xFFFF, 0xDB85, 0xAC9E, 0xDCCB, 0xACC8, 0xDD37, 0xAD47, 0xDCF6, 0xADAC, 0xDC3E, 0xADDE, 0xDC85, 0xADFF, 0xDCE8, 0xAE4E, 0xDD92, 0xAEEA, 0xDCBD, 0xAEEA, 0xDC1E, 0xAE58, 0xDBA7, 0xAE03, 0xDB36, 0xADEF, 0xDAE4, 0xADEF, 0xDAE4, 0xAEEA, 0xDA26, 0xAEEA, 0xDA26, 0xAC9E}; -const PROGMEM uint16_t logo_type[] = {0xD8D5, 0xA520, 0xD8A5, 0xA563, 0xD82E, 0xA57F, 0xD348, 0xA57F, 0xD2D1, 0xA598, 0xD2A0, 0xA5D9, 0xD2A0, 0xAF7A, 0xD274, 0xAFBE, 0xD202, 0xAFDA, 0xCD37, 0xAFDA, 0xCCBF, 0xAFBE, 0xCC8F, 0xAF7A, 0xCC8F, 0xA5D9, 0xCC63, 0xA598, 0xCBF1, 0xA57F, 0xC70B, 0xA57F, 0xC694, 0xA563, 0xC664, 0xA520, 0xC664, 0xA28C, 0xC70B, 0xA22C, 0xD82E, 0xA22C, 0xD8A5, 0xA248, 0xD8D5, 0xA28C, 0xFFFF, 0xB138, 0xAC8C, 0xB952, 0xAC8C, 0xB952, 0xA57F, 0xB138, 0xA57F, 0xFFFF, 0xBF27, 0xA421, 0xBF57, 0xA476, 0xBF6D, 0xA4D0, 0xBF6D, 0xAD36, 0xBF57, 0xAD90, 0xBF27, 0xADE6, 0xBBFA, 0xAFB2, 0xBB60, 0xAFCF, 0xBABD, 0xAFDA, 0xAFCE, 0xAFDA, 0xAF30, 0xAFCF, 0xAE9A, 0xAFB2, 0xAB6E, 0xADE6, 0xAB39, 0xAD90, 0xAB28, 0xAD36, 0xAB28, 0xA4D0, 0xAB39, 0xA476, 0xAB6E, 0xA421, 0xAE9A, 0xA255, 0xAF30, 0xA239, 0xAFCE, 0xA22C, 0xBABD, 0xA22C, 0xBB60, 0xA239, 0xBBFA, 0xA255, 0xFFFF, 0x93A4, 0xACDC, 0x9CEA, 0xACDC, 0x9CEA, 0xAA34, 0x93A4, 0xAA34, 0x93A4, 0xACDC, 0xFFFF, 0x93A4, 0xA796, 0x9CEA, 0xA796, 0x9CEA, 0xA525, 0x93A4, 0xA525, 0xFFFF, 0xA227, 0xA421, 0xA258, 0xA478, 0xA26E, 0xA4D5, 0xA26E, 0xA700, 0xA24F, 0xA757, 0xA204, 0xA7A5, 0xA089, 0xA8B8, 0xA061, 0xA903, 0xA092, 0xA949, 0xA1FC, 0xAA43, 0xA24B, 0xAA91, 0xA26E, 0xAAE8, 0xA26E, 0xAD36, 0xA258, 0xAD90, 0xA227, 0xADE6, 0x9EFC, 0xAFB2, 0x9E61, 0xAFCF, 0x9DBE, 0xAFDA, 0x8ED0, 0xAFDA, 0x8E28, 0xAF7A, 0x8E28, 0xA28C, 0x8E59, 0xA248, 0x8ED0, 0xA22C, 0x9DBE, 0xA22C, 0x9E61, 0xA239, 0x9EFC, 0xA255, 0xFFFF, 0x853C, 0xA502, 0x8517, 0xA557, 0x84C9, 0xA5A2, 0x7994, 0xACC8, 0x8494, 0xACC8, 0x850A, 0xACE4, 0x853C, 0xAD27, 0x853C, 0xAF7A, 0x850A, 0xAFBE, 0x8494, 0xAFDA, 0x7371, 0xAFDA, 0x72C9, 0xAF7A, 0x72C9, 0xAD09, 0x72E8, 0xACB2, 0x7333, 0xAC64, 0x7EA5, 0xA53E, 0x73A6, 0xA53E, 0x732F, 0xA522, 0x72FE, 0xA4DF, 0x72FE, 0xA28C, 0x732F, 0xA248, 0x73A6, 0xA22C, 0x8494, 0xA22C, 0x850A, 0xA248, 0x853C, 0xA28C, 0xFFFF, 0x6B68, 0xAC87, 0x6BDB, 0xACA3, 0x6C07, 0xACE6, 0x6C07, 0xAF7A, 0x6BDB, 0xAFBE, 0x6B68, 0xAFDA, 0x5C84, 0xAFDA, 0x5BDC, 0xAF7A, 0x5BDC, 0xA28C, 0x5C84, 0xA22C, 0x6146, 0xA22C, 0x61EE, 0xA28C, 0x61EE, 0xAC2D, 0x621E, 0xAC6E, 0x6295, 0xAC87, 0xFFFF, 0x52C6, 0xA248, 0x52F7, 0xA28C, 0x52F7, 0xAD45, 0x52EE, 0xAD45, 0x52DC, 0xAD9B, 0x52B1, 0xADE6, 0x4F85, 0xAFB2, 0x4EEA, 0xAFCF, 0x4E47, 0xAFDA, 0x4359, 0xAFDA, 0x42BA, 0xAFCF, 0x4224, 0xAFB2, 0x3EF8, 0xADE6, 0x3EC3, 0xAD90, 0x3EB2, 0xAD36, 0x3EB2, 0xA28C, 0x3EE2, 0xA248, 0x3F5A, 0xA22C, 0x441B, 0xA22C, 0x4493, 0xA248, 0x44C3, 0xA28C, 0x44C3, 0xAC2D, 0x44F4, 0xAC71, 0x456B, 0xAC8C, 0x4C3E, 0xAC8C, 0x4CB1, 0xAC71, 0x4CDD, 0xAC2D, 0x4CDD, 0xA28C, 0x4D0D, 0xA248, 0x4D85, 0xA22C, 0x524F, 0xA22C, 0xFFFF, 0x3748, 0xAC87, 0x37BB, 0xACA3, 0x37E7, 0xACE6, 0x37E7, 0xAF7A, 0x37BB, 0xAFBE, 0x3748, 0xAFDA, 0x2864, 0xAFDA, 0x27BC, 0xAF7A, 0x27BC, 0xA28C, 0x2864, 0xA22C, 0x2D26, 0xA22C, 0x2DCD, 0xA28C, 0x2DCD, 0xAC2D, 0x2DFE, 0xAC6E, 0x2E75, 0xAC87}; -const PROGMEM uint16_t logo_black[] = {0x8048, 0x527A, 0x8ADE, 0x5CDE, 0x75B2, 0x5CDE, 0xFFFF, 0x8048, 0x4FF6, 0x71D9, 0x5E20, 0x8EB8, 0x5E20, 0x8048, 0x4FF6, 0xFFFF, 0x4436, 0x8D8E, 0x4ECC, 0x97F2, 0x39A0, 0x97F2, 0xFFFF, 0x4436, 0x8B0A, 0x35C8, 0x9934, 0x52A5, 0x9934, 0xFFFF, 0xBC3D, 0x8D8E, 0xC6D4, 0x97F2, 0xB1A7, 0x97F2, 0xFFFF, 0xBC3D, 0x8B0A, 0xADCE, 0x9934, 0xCAAC, 0x9934, 0xFFFF, 0x8045, 0x6778, 0x7F6D, 0x67A7, 0x7E9D, 0x689F, 0x7D49, 0x69EA, 0x7B41, 0x6A81, 0x7908, 0x6A3A, 0x7726, 0x692C, 0x75EA, 0x685A, 0x7505, 0x684C, 0x744A, 0x6899, 0x73F5, 0x69A8, 0x7345, 0x6B1A, 0x7193, 0x6BF8, 0x6F4D, 0x6C08, 0x6CFA, 0x6B45, 0x6B61, 0x6AA3, 0x6A7D, 0x6AB7, 0x69EB, 0x6B1D, 0x6A1D, 0x6C34, 0x6A22, 0x6DB8, 0x68E5, 0x6ECD, 0x66B9, 0x6F33, 0x6417, 0x6EC5, 0x6239, 0x6E5C, 0x6165, 0x6E91, 0x6108, 0x6F09, 0x61C1, 0x7018, 0x6282, 0x7196, 0x61CF, 0x72D1, 0x5FE5, 0x7384, 0x5D38, 0x7380, 0x5B4B, 0x7365, 0x5A97, 0x73B7, 0x5A74, 0x7438, 0x5B90, 0x7520, 0x5CE8, 0x7671, 0x5CCB, 0x77BB, 0x5B43, 0x78B0, 0x58B6, 0x7914, 0x56D7, 0x7944, 0x564F, 0x79AD, 0x5667, 0x7A2F, 0x57DA, 0x7AE3, 0x59B7, 0x7BF3, 0x5A31, 0x7D37, 0x5927, 0x7E5D, 0x56E0, 0x7F1E, 0x5529, 0x7F93, 0x54D7, 0x800D, 0x5529, 0x8087, 0x56E0, 0x80FD, 0x5926, 0x81BE, 0x5A30, 0x82E5, 0x59B5, 0x8428, 0x57D8, 0x8538, 0x5664, 0x85EB, 0x564C, 0x866D, 0x56D4, 0x86D7, 0x58B2, 0x8708, 0x5B3F, 0x876B, 0x5CC6, 0x8860, 0x5CE3, 0x89AA, 0x5B8B, 0x8AFC, 0x5A6D, 0x8BE3, 0x5A91, 0x8C65, 0x5B44, 0x8CB7, 0x5D32, 0x8C9C, 0x5FDE, 0x8C98, 0x61C7, 0x8D4B, 0x627A, 0x8E87, 0x61B9, 0x9005, 0x60FF, 0x9114, 0x615C, 0x918B, 0x622F, 0x91C0, 0x640E, 0x9158, 0x66B0, 0x90EA, 0x68DC, 0x9150, 0x6A18, 0x9266, 0x6A12, 0x93E9, 0x69E0, 0x9501, 0x6A72, 0x9567, 0x6B56, 0x957B, 0x6CEE, 0x94D9, 0x6F43, 0x9417, 0x7188, 0x9428, 0x7339, 0x9506, 0x73E9, 0x9678, 0x743E, 0x9787, 0x74F8, 0x97D4, 0x75DD, 0x97C6, 0x771A, 0x96F4, 0x78FB, 0x95E6, 0x7B35, 0x95A1, 0x7D3D, 0x9637, 0x7E91, 0x9782, 0x7F60, 0x987A, 0x8038, 0x98AA, 0x810F, 0x987B, 0x81DF, 0x9782, 0x8333, 0x9638, 0x853B, 0x95A1, 0x8775, 0x95E7, 0x8956, 0x96F5, 0x8A92, 0x97C8, 0x8B78, 0x97D6, 0x8C32, 0x9789, 0x8C88, 0x967A, 0x8D37, 0x9508, 0x8EE9, 0x942A, 0x912F, 0x941A, 0x9383, 0x94DD, 0x951B, 0x957F, 0x95FF, 0x956B, 0x9690, 0x9505, 0x9660, 0x93ED, 0x9659, 0x926A, 0x9797, 0x9154, 0x99C3, 0x90EF, 0x9C65, 0x915D, 0x9E43, 0x91C6, 0x9F17, 0x9191, 0x9F74, 0x9119, 0x9EBB, 0x900A, 0x9DFA, 0x8E8C, 0x9EAE, 0x8D51, 0xA098, 0x8C9E, 0xA345, 0x8CA2, 0xA531, 0x8CBE, 0xA5E5, 0x8C6B, 0xA609, 0x8BEA, 0xA4EC, 0x8B02, 0xA394, 0x89B1, 0xA3B2, 0x8867, 0xA53A, 0x8772, 0xA7C6, 0x870E, 0xA9A5, 0x86DE, 0xAA2D, 0x8675, 0xAA14, 0x85F2, 0xA8A2, 0x853F, 0xA6C5, 0x842E, 0xA64B, 0x82EB, 0xA755, 0x81C5, 0xA99C, 0x8104, 0xAB52, 0x808F, 0xABA6, 0x8015, 0xAB52, 0x7F9B, 0xA99C, 0x7F25, 0xA755, 0x7E64, 0xA64C, 0x7D3E, 0xA6C7, 0x7BFA, 0xA8A5, 0x7AEA, 0xAA18, 0x7A37, 0xAA31, 0x79B5, 0xA9A9, 0x794B, 0xA7CA, 0x791B, 0xA53C, 0x78B7, 0xA3B6, 0x77C1, 0xA39A, 0x7677, 0xA4F1, 0x7526, 0xA60E, 0x743F, 0xA5EB, 0x73BD, 0xA538, 0x736B, 0xA34B, 0x7387, 0xA09E, 0x738A, 0x9EB4, 0x72D6, 0x9E02, 0x719B, 0x9EC4, 0x701D, 0x9F7E, 0x6F0E, 0x9F20, 0x6E96, 0x9E4E, 0x6E61, 0x9C6E, 0x6ECA, 0x99CB, 0x6F37, 0x97A0, 0x6ED2, 0x9664, 0x6DBC, 0x966B, 0x6C38, 0x969B, 0x6B21, 0x960B, 0x6ABB, 0x9526, 0x6AA6, 0x938E, 0x6B48, 0x913B, 0x6C0B, 0x8EF4, 0x6BFA, 0x8D43, 0x6B1D, 0x8C94, 0x69AA, 0x8C3F, 0x689B, 0x8B85, 0x684D, 0x8A9E, 0x685C, 0x8962, 0x692E, 0x8781, 0x6A3C, 0x8546, 0x6A82, 0x833F, 0x69EA, 0x81EC, 0x68A0, 0x811C, 0x67A8, 0x8045, 0x6778, 0x8045, 0x6778, 0xFFFF, 0x8047, 0x6AA0, 0x81C8, 0x6AFA, 0x8268, 0x6BD5, 0x81C8, 0x6CAF, 0x8047, 0x6D09, 0x7EC6, 0x6CAF, 0x7E27, 0x6BD5, 0x7EC6, 0x6AFA, 0x8047, 0x6AA0, 0x8047, 0x6AA0, 0xFFFF, 0x803E, 0x6E19, 0x867C, 0x6E71, 0x8C65, 0x6F75, 0x91D7, 0x711B, 0x96AD, 0x735B, 0x9ABC, 0x762C, 0x9DA2, 0x794C, 0x9F5F, 0x7CA2, 0x9FF3, 0x8011, 0x9F5E, 0x8380, 0x9DA1, 0x86D5, 0x9ABA, 0x89F6, 0x96AB, 0x8CC7, 0x91D6, 0x8F08, 0x8C65, 0x90AD, 0x867C, 0x91B1, 0x803D, 0x9209, 0x7A00, 0x91B1, 0x7416, 0x90AD, 0x6EA6, 0x8F08, 0x69D0, 0x8CC7, 0x65D6, 0x8A0A, 0x62EE, 0x86F4, 0x6125, 0x839B, 0x6089, 0x8011, 0x6124, 0x7C88, 0x62ED, 0x792E, 0x65D6, 0x7619, 0x69CF, 0x735B, 0x6EA5, 0x711B, 0x7416, 0x6F75, 0x7A00, 0x6E71, 0x803E, 0x6E19, 0x803E, 0x6E19, 0xFFFF, 0x803E, 0x6EB2, 0x7A5A, 0x6F04, 0x74B2, 0x6FF8, 0x6F4B, 0x7194, 0x6A8F, 0x73C7, 0x66A2, 0x7681, 0x63D5, 0x7986, 0x6226, 0x7CBF, 0x6197, 0x8011, 0x6226, 0x8363, 0x63D5, 0x869C, 0x66A2, 0x89A2, 0x6A8F, 0x8C5B, 0x6F4B, 0x8E8E, 0x74B2, 0x902B, 0x7A5A, 0x911E, 0x803D, 0x9170, 0x803E, 0x9170, 0x8621, 0x911E, 0x8BCA, 0x902B, 0x9130, 0x8E8E, 0x95ED, 0x8C5B, 0x99CF, 0x89AB, 0x9CA7, 0x869C, 0x9E55, 0x8367, 0x9EE5, 0x8011, 0x9E55, 0x7CBB, 0x9CA7, 0x7986, 0x99CF, 0x7677, 0x95ED, 0x73C7, 0x9130, 0x7194, 0x8BCA, 0x6FF8, 0x8621, 0x6F04, 0x803E, 0x6EB2, 0x803E, 0x6EB2, 0xFFFF, 0x80BC, 0x6FD7, 0x80AF, 0x71D8, 0x7FC8, 0x71D9, 0x7FB7, 0x6FD8, 0x80BC, 0x6FD7, 0x80BC, 0x6FD7, 0xFFFF, 0x83CB, 0x6FF6, 0x84CD, 0x700B, 0x843E, 0x7206, 0x835B, 0x71F4, 0xFFFF, 0x7CA9, 0x6FF8, 0x7D1A, 0x71F5, 0x7C37, 0x7207, 0x7BA7, 0x700D, 0x7CA9, 0x6FF8, 0x7CA9, 0x6FF8, 0xFFFF, 0x87CD, 0x7068, 0x88C7, 0x7092, 0x87BA, 0x727C, 0x86DF, 0x7258, 0xFFFF, 0x78A8, 0x706B, 0x7997, 0x725A, 0x78BA, 0x727E, 0x77AD, 0x7095, 0x78A8, 0x706B, 0x78A8, 0x706B, 0xFFFF, 0x6700, 0x708A, 0x6880, 0x70E5, 0x6920, 0x71BF, 0x6880, 0x7299, 0x66FF, 0x72F4, 0x657F, 0x7299, 0x64E0, 0x71BF, 0x657F, 0x70E4, 0x6700, 0x708A, 0x6700, 0x708A, 0xFFFF, 0x998D, 0x708C, 0x9B0E, 0x70E6, 0x9BAE, 0x71C0, 0x9B0E, 0x729B, 0x998D, 0x72F6, 0x980D, 0x729B, 0x976E, 0x71C1, 0x980D, 0x70E7, 0x998D, 0x708C, 0x998D, 0x708C, 0xFFFF, 0x8BA7, 0x712C, 0x8C95, 0x716A, 0x8B10, 0x7339, 0x8A3F, 0x7303, 0x8BA7, 0x712C, 0xFFFF, 0x74CE, 0x712F, 0x7635, 0x7307, 0x7564, 0x733C, 0x73DE, 0x716D, 0x74CE, 0x712F, 0x74CE, 0x712F, 0xFFFF, 0x8F47, 0x723F, 0x9023, 0x728E, 0x8E2D, 0x743A, 0x8D6B, 0x73F4, 0x8F47, 0x723F, 0xFFFF, 0x712D, 0x7242, 0x7308, 0x73F7, 0x7248, 0x743D, 0x7050, 0x7292, 0x712D, 0x7242, 0x712D, 0x7242, 0xFFFF, 0x803E, 0x72F6, 0x891B, 0x73F4, 0x909A, 0x76CC, 0x959F, 0x7B0B, 0x975E, 0x8011, 0x959F, 0x8517, 0x909A, 0x8957, 0x891B, 0x8C2E, 0x803E, 0x8D2B, 0x7761, 0x8C2E, 0x6FE2, 0x8957, 0x6ADD, 0x8517, 0x691E, 0x8011, 0x6ADD, 0x7B0B, 0x6FE2, 0x76CC, 0x7761, 0x73F4, 0x803E, 0x72F6, 0x803E, 0x72F6, 0xFFFF, 0x803E, 0x738F, 0x77C8, 0x7481, 0x70A0, 0x7738, 0x6BD7, 0x7B46, 0x6A2C, 0x8011, 0x6BD7, 0x84DC, 0x70A1, 0x88EA, 0x77C9, 0x8BA1, 0x803E, 0x8C93, 0x88B4, 0x8BA1, 0x8FDB, 0x88EA, 0x94A5, 0x84DD, 0x9650, 0x8011, 0x94A5, 0x7B46, 0x8FDB, 0x7738, 0x88B4, 0x7481, 0x803E, 0x738F, 0x803E, 0x738F, 0xFFFF, 0x929B, 0x739A, 0x935C, 0x73FA, 0x9100, 0x7578, 0x905A, 0x7527, 0x9175, 0x745E, 0xFFFF, 0x6DDC, 0x739D, 0x7022, 0x7527, 0x6F74, 0x757C, 0x6D16, 0x73FF, 0x6DDC, 0x739D, 0x6DDC, 0x739D, 0xFFFF, 0x9589, 0x7533, 0x9634, 0x75A4, 0x937E, 0x76ED, 0x92E8, 0x768B, 0xFFFF, 0x6AEB, 0x7539, 0x6D8D, 0x7690, 0x6CFB, 0x76F0, 0x6CEC, 0x76FA, 0x6BED, 0x7674, 0x6A40, 0x75A9, 0x6A45, 0x75A7, 0x6AEB, 0x7539, 0x6AEB, 0x7539, 0xFFFF, 0x980B, 0x7707, 0x989A, 0x7784, 0x9597, 0x7892, 0x951A, 0x7825, 0xFFFF, 0x686A, 0x770C, 0x6B5B, 0x782A, 0x6ADF, 0x7897, 0x67DD, 0x7788, 0x686A, 0x770C, 0x686A, 0x770C, 0xFFFF, 0x9A12, 0x790A, 0x9A7E, 0x7991, 0x9740, 0x7A5E, 0x96E1, 0x79E8, 0x9A12, 0x790A, 0xFFFF, 0x6664, 0x790F, 0x6996, 0x79ED, 0x6937, 0x7A63, 0x65F9, 0x7996, 0x6664, 0x790F, 0x6664, 0x790F, 0xFFFF, 0x9B91, 0x7B32, 0x9BDB, 0x7BC1, 0x9870, 0x7C48, 0x9831, 0x7BCB, 0xFFFF, 0x64E6, 0x7B37, 0x6847, 0x7BD0, 0x6807, 0x7C4C, 0x649D, 0x7BC5, 0x64E6, 0x7B37, 0x64E6, 0x7B37, 0xFFFF, 0x9C82, 0x7D72, 0x9CA7, 0x7E06, 0x9925, 0x7E46, 0x9903, 0x7DC5, 0xFFFF, 0x63F7, 0x7D78, 0x6776, 0x7DC9, 0x6756, 0x7E49, 0x63D3, 0x7E0A, 0x63F7, 0x7D78, 0x63F7, 0x7D78, 0xFFFF, 0x5C87, 0x7EDB, 0x5E08, 0x7F35, 0x5EA8, 0x800F, 0x5E08, 0x80E9, 0x5C87, 0x8144, 0x5C85, 0x8144, 0x5B06, 0x80E9, 0x5A67, 0x800F, 0x5B06, 0x7F35, 0x5C87, 0x7EDB, 0x5C87, 0x7EDB, 0xFFFF, 0xA402, 0x7EDE, 0xA583, 0x7F38, 0xA623, 0x8011, 0xA623, 0x8013, 0xA583, 0x80EC, 0xA402, 0x8147, 0xA281, 0x80ED, 0xA1E2, 0x8013, 0xA281, 0x7F38, 0xA402, 0x7EDE, 0xA402, 0x7EDE, 0xFFFF, 0x9CE0, 0x7FC0, 0x9CE0, 0x8055, 0x9957, 0x804D, 0x9957, 0x7FCB, 0xFFFF, 0x639D, 0x7FC5, 0x6726, 0x7FCE, 0x6726, 0x8051, 0x639D, 0x805A, 0x639D, 0x7FC5, 0x639D, 0x7FC5, 0xFFFF, 0x9927, 0x81D1, 0x9CAA, 0x8210, 0x9C87, 0x82A2, 0x9907, 0x8252, 0x9927, 0x81D1, 0x9927, 0x81D1, 0xFFFF, 0x6757, 0x81D5, 0x6777, 0x8255, 0x63F9, 0x82A7, 0x63D4, 0x8214, 0xFFFF, 0x9877, 0x83CF, 0x9BE2, 0x8455, 0x9B99, 0x84E3, 0x9838, 0x844C, 0x9877, 0x83CF, 0x9877, 0x83CF, 0xFFFF, 0x6808, 0x83D3, 0x6848, 0x8450, 0x64E7, 0x84E8, 0x649E, 0x845A, 0xFFFF, 0x9749, 0x85B9, 0x9A88, 0x8684, 0x9A1D, 0x870C, 0x96EB, 0x862E, 0x9749, 0x85B9, 0x9749, 0x85B9, 0xFFFF, 0x6938, 0x85BD, 0x6997, 0x8634, 0x6665, 0x8710, 0x65F9, 0x8689, 0xFFFF, 0x95A2, 0x8785, 0x98A5, 0x8892, 0x9818, 0x890F, 0x9527, 0x87F2, 0x95A2, 0x8785, 0x95A2, 0x8785, 0xFFFF, 0x6ADF, 0x878A, 0x6B5B, 0x87F8, 0x686A, 0x8914, 0x67DC, 0x8897, 0x6ADF, 0x878A, 0xFFFF, 0x6CF7, 0x892F, 0x6D8D, 0x8991, 0x6AEB, 0x8AE9, 0x6A40, 0x8A79, 0xFFFF, 0x9380, 0x8932, 0x9645, 0x8A72, 0x963E, 0x8A77, 0x9599, 0x8AE3, 0x92F5, 0x898D, 0x9380, 0x8932, 0x9380, 0x8932, 0xFFFF, 0x9110, 0x8AA1, 0x936F, 0x8C1F, 0x92AA, 0x8C80, 0x9064, 0x8AF7, 0x9110, 0x8AA1, 0x9110, 0x8AA1, 0xFFFF, 0x6F73, 0x8AA5, 0x7021, 0x8AFB, 0x7035, 0x8B04, 0x6DED, 0x8C8B, 0x6DE1, 0x8C87, 0x6D17, 0x8C23, 0xFFFF, 0x8E3E, 0x8BE1, 0x9037, 0x8D8B, 0x8F59, 0x8DDC, 0x8D7C, 0x8C27, 0x8E3E, 0x8BE1, 0x8E3E, 0x8BE1, 0xFFFF, 0x7259, 0x8BEB, 0x731B, 0x8C31, 0x7140, 0x8DE7, 0x7064, 0x8D97, 0xFFFF, 0x8B21, 0x8CE3, 0x8CA9, 0x8EB2, 0x8BBA, 0x8EEF, 0x8A51, 0x8D18, 0x8B21, 0x8CE3, 0x8B21, 0x8CE3, 0xFFFF, 0x7576, 0x8CEB, 0x7648, 0x8D20, 0x74E0, 0x8EF8, 0x73F2, 0x8EBB, 0xFFFF, 0x66F3, 0x8D2F, 0x6874, 0x8D8A, 0x687D, 0x8D8F, 0x6886, 0x8D94, 0x6926, 0x8E6E, 0x6887, 0x8F48, 0x6705, 0x8FA2, 0x6584, 0x8F49, 0x657F, 0x8F45, 0x6570, 0x8F3E, 0x6573, 0x8F3E, 0x64D3, 0x8E63, 0x6573, 0x8D89, 0x66F3, 0x8D2F, 0x66F3, 0x8D2F, 0xFFFF, 0x9993, 0x8D31, 0x9B13, 0x8D8C, 0x9BB4, 0x8E66, 0x9B16, 0x8F40, 0x9993, 0x8F9A, 0x9814, 0x8F40, 0x9774, 0x8E66, 0x9812, 0x8D8C, 0x9993, 0x8D31, 0x9993, 0x8D31, 0xFFFF, 0x87CD, 0x8DA1, 0x88DC, 0x8F8B, 0x87E0, 0x8FB5, 0x86F0, 0x8DC6, 0x87CD, 0x8DA1, 0x87CD, 0x8DA1, 0xFFFF, 0x78CD, 0x8DA8, 0x79A8, 0x8DCB, 0x78BC, 0x8FBB, 0x77C1, 0x8F92, 0xFFFF, 0x8450, 0x8E19, 0x84E2, 0x9014, 0x83E0, 0x9029, 0x836C, 0x8E2C, 0x8450, 0x8E19, 0x8450, 0x8E19, 0xFFFF, 0x7C48, 0x8E1C, 0x7D2B, 0x8E2E, 0x7CBD, 0x902C, 0x7BBB, 0x9017, 0x7C48, 0x8E1C, 0xFFFF, 0x80BF, 0x8E49, 0x80D2, 0x904A, 0x7FCC, 0x904A, 0x7FD9, 0x8E49, 0x80BF, 0x8E49, 0x80BF, 0x8E49, 0xFFFF, 0x804F, 0x9321, 0x81D0, 0x937A, 0x8271, 0x9455, 0x81D1, 0x952F, 0x8051, 0x958A, 0x7ECF, 0x9530, 0x7E2F, 0x9456, 0x7ECE, 0x937B, 0x804F, 0x9321, 0x804F, 0x9321, 0xFFFF, 0x8048, 0x46D9, 0x27BC, 0x9DBA, 0xD8D3, 0x9DBA, 0xFFFF, 0x8048, 0x4BC9, 0x952E, 0x604A, 0x6B62, 0x604A, 0xFFFF, 0x68D2, 0x62CE, 0x97BF, 0x62CE, 0xB9BA, 0x8427, 0xA239, 0x9B36, 0x5E16, 0x9B36, 0x46B6, 0x8446, 0x68D2, 0x62CE, 0xFFFF, 0xBC3E, 0x869F, 0xD13B, 0x9B36, 0xA742, 0x9B36, 0xFFFF, 0x4431, 0x86BE, 0x590E, 0x9B36, 0x2F54, 0x9B36, 0x4431, 0x86BE}; -const PROGMEM uint16_t logo_white[] = {0x80BC, 0x6FD7, 0x80AF, 0x71D8, 0x7FC8, 0x71D9, 0x7FB7, 0x6FD8, 0x80BC, 0x6FD7, 0xFFFF, 0x83CB, 0x6FF6, 0x84CD, 0x700B, 0x843E, 0x7206, 0x835B, 0x71F4, 0xFFFF, 0x7CA9, 0x6FF8, 0x7D1A, 0x71F5, 0x7C37, 0x7207, 0x7BA7, 0x700D, 0x7CA9, 0x6FF8, 0x7CA9, 0x6FF8, 0xFFFF, 0x87CD, 0x7068, 0x88C7, 0x7092, 0x87BA, 0x727C, 0x86DF, 0x7258, 0xFFFF, 0x78A8, 0x706B, 0x7997, 0x725A, 0x78BA, 0x727E, 0x77AD, 0x7095, 0x78A8, 0x706B, 0x78A8, 0x706B, 0xFFFF, 0x8BA7, 0x712C, 0x8C95, 0x716A, 0x8B10, 0x7339, 0x8A3F, 0x7303, 0xFFFF, 0x74CE, 0x712F, 0x7635, 0x7307, 0x7564, 0x733C, 0x73DE, 0x716D, 0x74CE, 0x712F, 0x74CE, 0x712F, 0xFFFF, 0x8F47, 0x723F, 0x9023, 0x728E, 0x8E2D, 0x743A, 0x8D6B, 0x73F4, 0xFFFF, 0x712D, 0x7242, 0x7309, 0x73F7, 0x7248, 0x743D, 0x7050, 0x7292, 0x712D, 0x7242, 0x712D, 0x7242, 0xFFFF, 0x929B, 0x739A, 0x935C, 0x73FA, 0x9100, 0x7578, 0x905A, 0x7527, 0xFFFF, 0x6DDC, 0x739D, 0x7022, 0x7527, 0x6F74, 0x757C, 0x6D16, 0x73FF, 0x6DDC, 0x739D, 0x6DDC, 0x739D, 0xFFFF, 0x9589, 0x7533, 0x9634, 0x75A4, 0x937E, 0x76ED, 0x92E8, 0x768B, 0xFFFF, 0x6AEB, 0x7539, 0x6D8D, 0x7690, 0x6CFB, 0x76F0, 0x6A40, 0x75A9, 0x6AEB, 0x7539, 0xFFFF, 0x980B, 0x7707, 0x989A, 0x7784, 0x9597, 0x7892, 0x951A, 0x7825, 0xFFFF, 0x686A, 0x770C, 0x6B5B, 0x782A, 0x6ADF, 0x7897, 0x67DD, 0x7788, 0x686A, 0x770C, 0x686A, 0x770C, 0xFFFF, 0x9A12, 0x790A, 0x9A7E, 0x7991, 0x9740, 0x7A5E, 0x96E1, 0x79E8, 0xFFFF, 0x6664, 0x790F, 0x6996, 0x79ED, 0x6937, 0x7A63, 0x65F9, 0x7996, 0x6664, 0x790F, 0x6664, 0x790F, 0xFFFF, 0x9B91, 0x7B32, 0x9BDB, 0x7BC1, 0x9870, 0x7C48, 0x9831, 0x7BCC, 0xFFFF, 0x64E6, 0x7B37, 0x6847, 0x7BD0, 0x6807, 0x7C4C, 0x649D, 0x7BC5, 0x64E6, 0x7B37, 0x64E6, 0x7B37, 0xFFFF, 0x9C82, 0x7D72, 0x9CA7, 0x7E06, 0x9925, 0x7E46, 0x9903, 0x7DC5, 0xFFFF, 0x63F7, 0x7D78, 0x6776, 0x7DC9, 0x6756, 0x7E49, 0x63D3, 0x7E0A, 0x63F7, 0x7D78, 0x63F7, 0x7D78, 0xFFFF, 0x9CE0, 0x7FC0, 0x9CE0, 0x8055, 0x9957, 0x804D, 0x9957, 0x7FCB, 0xFFFF, 0x639D, 0x7FC5, 0x6726, 0x7FCE, 0x6726, 0x8051, 0x639D, 0x805A, 0x639D, 0x7FC5, 0xFFFF, 0x9927, 0x81D1, 0x9CAA, 0x8210, 0x9C87, 0x82A2, 0x9907, 0x8252, 0x9927, 0x81D1, 0x9927, 0x81D1, 0xFFFF, 0x6757, 0x81D5, 0x6777, 0x8256, 0x63F9, 0x82A7, 0x63D4, 0x8214, 0xFFFF, 0x9877, 0x83CF, 0x9BE2, 0x8455, 0x9B99, 0x84E3, 0x9838, 0x844C, 0x9877, 0x83CF, 0xFFFF, 0x6808, 0x83D3, 0x6848, 0x8450, 0x64E7, 0x84E8, 0x649E, 0x845A, 0xFFFF, 0x9749, 0x85B9, 0x9A88, 0x8684, 0x9A1D, 0x870C, 0x96EB, 0x862E, 0x9749, 0x85B9, 0x9749, 0x85B9, 0xFFFF, 0x6938, 0x85BD, 0x6997, 0x8634, 0x6665, 0x8710, 0x65F9, 0x8689, 0xFFFF, 0x95A2, 0x8785, 0x98A5, 0x8892, 0x9818, 0x890F, 0x9527, 0x87F2, 0x95A2, 0x8785, 0x95A2, 0x8785, 0xFFFF, 0x6ADF, 0x878A, 0x6B5B, 0x87F8, 0x686A, 0x8915, 0x67DC, 0x8897, 0xFFFF, 0x6CF7, 0x8930, 0x6D8D, 0x8991, 0x6AEB, 0x8AE9, 0x6A40, 0x8A79, 0xFFFF, 0x9380, 0x8932, 0x9645, 0x8A72, 0x9599, 0x8AE3, 0x92F5, 0x898D, 0x9380, 0x8932, 0xFFFF, 0x9110, 0x8AA1, 0x936F, 0x8C1F, 0x92AA, 0x8C80, 0x9064, 0x8AF7, 0x9110, 0x8AA1, 0x9110, 0x8AA1, 0xFFFF, 0x6F73, 0x8AA5, 0x7021, 0x8AFB, 0x6DED, 0x8C8C, 0x6D17, 0x8C23, 0xFFFF, 0x8E3E, 0x8BE1, 0x9037, 0x8D8B, 0x8F59, 0x8DDC, 0x8D7C, 0x8C27, 0x8E3E, 0x8BE1, 0x8E3E, 0x8BE1, 0xFFFF, 0x7259, 0x8BEB, 0x731B, 0x8C31, 0x7140, 0x8DE7, 0x7064, 0x8D97, 0xFFFF, 0x8B21, 0x8CE3, 0x8CA9, 0x8EB2, 0x8BBA, 0x8EEF, 0x8A51, 0x8D18, 0x8B21, 0x8CE3, 0x8B21, 0x8CE3, 0xFFFF, 0x7576, 0x8CEB, 0x7648, 0x8D20, 0x74E0, 0x8EF8, 0x73F2, 0x8EBB, 0xFFFF, 0x87CD, 0x8DA1, 0x88DC, 0x8F8B, 0x87E0, 0x8FB5, 0x86F0, 0x8DC6, 0x87CD, 0x8DA1, 0x87CD, 0x8DA1, 0xFFFF, 0x78CC, 0x8DA8, 0x79A8, 0x8DCB, 0x78BC, 0x8FBB, 0x77C0, 0x8F92, 0xFFFF, 0x8450, 0x8E19, 0x84E2, 0x9014, 0x83E0, 0x9029, 0x836C, 0x8E2C, 0x8450, 0x8E19, 0x8450, 0x8E19, 0xFFFF, 0x7C48, 0x8E1C, 0x7D2B, 0x8E2E, 0x7CBD, 0x902C, 0x7BBB, 0x9017, 0xFFFF, 0x80BE, 0x8E49, 0x80D1, 0x904A, 0x7FCC, 0x904A, 0x7FD9, 0x8E49, 0x80BE, 0x8E49, 0xFFFF, 0x8276, 0x75D6, 0x83AF, 0x75FE, 0x8436, 0x7628, 0x84AE, 0x7661, 0x8542, 0x7706, 0x8512, 0x77BA, 0x8457, 0x7845, 0x8335, 0x788B, 0x8318, 0x7882, 0x82D8, 0x7860, 0x831E, 0x7830, 0x8353, 0x7823, 0x83E6, 0x77F9, 0x8464, 0x7790, 0x847A, 0x771A, 0x8415, 0x76B7, 0x83B6, 0x7691, 0x8351, 0x7676, 0x827F, 0x7662, 0x81BB, 0x7687, 0x8161, 0x76AF, 0x8123, 0x76DA, 0x80E5, 0x771A, 0x80C5, 0x774D, 0x80B8, 0x77C1, 0x80D1, 0x77EE, 0x8107, 0x7814, 0x81CC, 0x786B, 0x837F, 0x7918, 0x8464, 0x7983, 0x84C0, 0x79B2, 0x852D, 0x79FD, 0x859D, 0x7ABC, 0x858E, 0x7B79, 0x8545, 0x7C25, 0x84D9, 0x7CC5, 0x8469, 0x7D4D, 0x843B, 0x7DCD, 0x8555, 0x7DA8, 0x85D3, 0x7D67, 0x870D, 0x7CA0, 0x87E0, 0x7BC0, 0x880D, 0x7B5B, 0x886D, 0x7A46, 0x88B3, 0x799B, 0x88CC, 0x7970, 0x893A, 0x78EA, 0x8995, 0x78A8, 0x8A01, 0x786F, 0x8AF8, 0x781F, 0x8BA6, 0x77FD, 0x8C0C, 0x77EF, 0x8C96, 0x77FB, 0x8D1D, 0x7815, 0x8D59, 0x7826, 0x8E40, 0x7889, 0x8EDB, 0x7925, 0x8EFC, 0x797B, 0x8EFF, 0x79D4, 0x8E71, 0x7A7B, 0x8D58, 0x7AD2, 0x8C23, 0x7ADE, 0x8AFF, 0x7A97, 0x8AF5, 0x7A81, 0x8AEF, 0x7A4E, 0x8B68, 0x7A52, 0x8B96, 0x7A5F, 0x8C39, 0x7A87, 0x8D33, 0x7A7F, 0x8E07, 0x7A3F, 0x8E66, 0x79CB, 0x8E63, 0x7985, 0x8E43, 0x793F, 0x8DC6, 0x78C6, 0x8CFA, 0x7876, 0x8C7E, 0x785F, 0x8C18, 0x7857, 0x8B84, 0x7874, 0x8B22, 0x788F, 0x8A7D, 0x78CA, 0x8A2E, 0x78F9, 0x89F0, 0x7930, 0x89A3, 0x79A5, 0x8979, 0x7AC0, 0x897C, 0x7B9C, 0x8972, 0x7BF2, 0x88CC, 0x7D32, 0x87B7, 0x7E4C, 0x8665, 0x7F52, 0x8660, 0x7F5A, 0x878F, 0x7F01, 0x88AE, 0x7EC2, 0x89FD, 0x7E9E, 0x8B8D, 0x7EC6, 0x8C40, 0x7F0E, 0x8CB6, 0x7F68, 0x8D1D, 0x7FD7, 0x8DFA, 0x80BD, 0x8EA8, 0x816E, 0x8F34, 0x81D4, 0x8F8A, 0x81F9, 0x8FDA, 0x820A, 0x90AB, 0x820F, 0x9120, 0x81FF, 0x91A5, 0x81DC, 0x91F4, 0x81B8, 0x922C, 0x8198, 0x9288, 0x812B, 0x927D, 0x80AB, 0x9252, 0x8068, 0x921C, 0x8033, 0x9174, 0x7FEB, 0x9099, 0x7FEB, 0x8FCF, 0x8029, 0x8F5D, 0x808D, 0x8F47, 0x80A4, 0x8ED4, 0x80A4, 0x8EC5, 0x8070, 0x8F65, 0x7FE6, 0x906D, 0x7F92, 0x91A4, 0x7F90, 0x92A8, 0x7FF7, 0x92FC, 0x8043, 0x9331, 0x8090, 0x9349, 0x813D, 0x92D1, 0x81E3, 0x9264, 0x8227, 0x91E5, 0x825B, 0x915D, 0x8280, 0x90D3, 0x8296, 0x8FA0, 0x829A, 0x8F2C, 0x8286, 0x8EE7, 0x8273, 0x8E78, 0x824A, 0x8DA9, 0x81D4, 0x8CB9, 0x8127, 0x8B68, 0x802C, 0x8B22, 0x8001, 0x8AC3, 0x7FE7, 0x8A50, 0x7FF4, 0x88FD, 0x8068, 0x87A4, 0x811D, 0x879E, 0x812D, 0x8904, 0x81F1, 0x89D4, 0x8285, 0x8A7C, 0x8343, 0x8A94, 0x8431, 0x8A4E, 0x84A1, 0x89E8, 0x850E, 0x892F, 0x85E5, 0x88B0, 0x86E5, 0x88C0, 0x8757, 0x88F2, 0x878D, 0x8927, 0x87AD, 0x8ABF, 0x8821, 0x8B0E, 0x881E, 0x8B70, 0x8811, 0x8C1B, 0x87D6, 0x8C9B, 0x8776, 0x8CC4, 0x873D, 0x8CD3, 0x8705, 0x8CA2, 0x86A3, 0x8C06, 0x8662, 0x8B39, 0x864F, 0x8A77, 0x8662, 0x89F9, 0x864D, 0x8A10, 0x8606, 0x8A66, 0x85F7, 0x8B35, 0x85DC, 0x8C50, 0x85FD, 0x8D3C, 0x8663, 0x8D94, 0x870A, 0x8D7D, 0x875F, 0x8D3A, 0x87B8, 0x8CB1, 0x882D, 0x8BC1, 0x888C, 0x8B30, 0x88A7, 0x8A8D, 0x88AE, 0x89EE, 0x8898, 0x896E, 0x887E, 0x8869, 0x882D, 0x87EE, 0x87EA, 0x87A4, 0x87A8, 0x878E, 0x8785, 0x874D, 0x86E3, 0x875D, 0x8637, 0x87FD, 0x8466, 0x8705, 0x835A, 0x86B8, 0x8359, 0x84A4, 0x8358, 0x7F20, 0x851B, 0x7F13, 0x864D, 0x8016, 0x86F9, 0x818E, 0x87D8, 0x823B, 0x8869, 0x8272, 0x88C9, 0x8276, 0x8915, 0x8266, 0x893D, 0x81FB, 0x89D8, 0x8197, 0x8A21, 0x8119, 0x8A62, 0x80A7, 0x8A8A, 0x8016, 0x8AAA, 0x7EDC, 0x8AAE, 0x7DC5, 0x8A63, 0x7D55, 0x8A29, 0x7CFA, 0x89E5, 0x7CAD, 0x8939, 0x7D1B, 0x8895, 0x7E00, 0x8825, 0x7F27, 0x8800, 0x7F66, 0x880F, 0x7F69, 0x8850, 0x7E49, 0x8873, 0x7D9A, 0x88C9, 0x7D4F, 0x893E, 0x7D8B, 0x89B2, 0x7DD8, 0x89E6, 0x7E36, 0x8A10, 0x7F02, 0x8A40, 0x7FDB, 0x8A34, 0x8046, 0x8A16, 0x8091, 0x89F5, 0x80A5, 0x89EB, 0x80FE, 0x89AB, 0x8126, 0x8981, 0x8159, 0x8918, 0x814F, 0x88E6, 0x8128, 0x88B8, 0x8094, 0x8856, 0x7EFC, 0x8796, 0x7D74, 0x86E7, 0x7D3D, 0x86C5, 0x7CD8, 0x8674, 0x7C98, 0x8605, 0x7CA0, 0x8536, 0x7D7C, 0x83E6, 0x7E07, 0x8357, 0x7DED, 0x835B, 0x79CC, 0x843E, 0x7962, 0x8448, 0x77CB, 0x8450, 0x76F3, 0x8438, 0x763E, 0x841E, 0x7502, 0x83FE, 0x746C, 0x83FD, 0x73E4, 0x840A, 0x72CE, 0x8444, 0x729B, 0x8457, 0x71E6, 0x84B7, 0x71B5, 0x84EB, 0x719B, 0x853B, 0x719B, 0x8558, 0x71D4, 0x85E0, 0x72B0, 0x8642, 0x73D4, 0x8661, 0x74B3, 0x8616, 0x74AD, 0x84D7, 0x74B2, 0x84B3, 0x74B5, 0x849B, 0x751E, 0x8496, 0x753B, 0x84B8, 0x75C5, 0x856E, 0x756D, 0x865A, 0x74D0, 0x86B8, 0x73FA, 0x86EA, 0x7250, 0x86CF, 0x70E7, 0x863F, 0x707E, 0x85C8, 0x705F, 0x8549, 0x7075, 0x84CC, 0x70AC, 0x8475, 0x70CD, 0x8452, 0x71FF, 0x839C, 0x7287, 0x8376, 0x736A, 0x833A, 0x7443, 0x8319, 0x751E, 0x8311, 0x76AC, 0x8327, 0x77C4, 0x8341, 0x7810, 0x8340, 0x799F, 0x8313, 0x7A2A, 0x82EA, 0x7B24, 0x8281, 0x7BE4, 0x820C, 0x7BEC, 0x81B1, 0x7A5E, 0x81C8, 0x7809, 0x81ED, 0x7751, 0x81F8, 0x7664, 0x81EF, 0x7571, 0x81B4, 0x74BB, 0x8141, 0x7483, 0x80F9, 0x7408, 0x802F, 0x73D9, 0x7FEB, 0x7359, 0x7F50, 0x72A0, 0x7EC4, 0x719E, 0x7E89, 0x7074, 0x7EA8, 0x7015, 0x7ECC, 0x6FD0, 0x7EF8, 0x6FA3, 0x7F19, 0x6F6B, 0x7FBB, 0x6F93, 0x8017, 0x6FA7, 0x8032, 0x6FD7, 0x805A, 0x70DF, 0x8092, 0x7205, 0x805A, 0x729E, 0x7FCB, 0x72B3, 0x7FBC, 0x7309, 0x7FA6, 0x733B, 0x7FDE, 0x72F9, 0x804B, 0x726D, 0x80A7, 0x70E6, 0x80FB, 0x700D, 0x80EC, 0x6F48, 0x80A8, 0x6EFC, 0x8073, 0x6EC1, 0x8026, 0x6E93, 0x7FCC, 0x6ED4, 0x7ED8, 0x6F54, 0x7E72, 0x6FCB, 0x7E3A, 0x700B, 0x7E25, 0x71AB, 0x7DED, 0x7356, 0x7E3E, 0x7472, 0x7EF4, 0x7536, 0x7FBD, 0x75DA, 0x8075, 0x7628, 0x80B6, 0x767B, 0x80D8, 0x76D9, 0x80EF, 0x7755, 0x80FC, 0x7881, 0x80D5, 0x7931, 0x8093, 0x7A00, 0x801E, 0x799B, 0x7D9B, 0x789A, 0x7CD8, 0x77C0, 0x7BE5, 0x7783, 0x7B55, 0x7787, 0x7AB9, 0x77AE, 0x7A67, 0x77E6, 0x7A1D, 0x781E, 0x79CD, 0x785E, 0x7909, 0x7853, 0x78C0, 0x7823, 0x788B, 0x7808, 0x7875, 0x7649, 0x77E8, 0x74B6, 0x7869, 0x7488, 0x78B3, 0x7472, 0x7901, 0x74D2, 0x796F, 0x75D8, 0x799A, 0x76EE, 0x7971, 0x774A, 0x797A, 0x7751, 0x79B4, 0x76A0, 0x79F0, 0x75E4, 0x7A0A, 0x7454, 0x79E1, 0x73AF, 0x7986, 0x7369, 0x7909, 0x7374, 0x7891, 0x739D, 0x783C, 0x73B6, 0x781E, 0x74B7, 0x7768, 0x765D, 0x772C, 0x77ED, 0x7769, 0x7932, 0x77FC, 0x7979, 0x7836, 0x79B8, 0x787B, 0x79DF, 0x7912, 0x7998, 0x7A14, 0x7967, 0x7AB4, 0x796A, 0x7AD8, 0x79C5, 0x7B60, 0x7A9D, 0x7BE9, 0x7B72, 0x7C47, 0x7EBA, 0x7BD6, 0x8206, 0x7CA8, 0x82FA, 0x7C2E, 0x8391, 0x7BB4, 0x83F6, 0x7B40, 0x8413, 0x7AD0, 0x83DD, 0x7A71, 0x838A, 0x7A39, 0x8296, 0x79B7, 0x80F3, 0x78FA, 0x8016, 0x788A, 0x7FB4, 0x7833, 0x7F8D, 0x77DF, 0x7F92, 0x77A9, 0x7FB3, 0x7718, 0x7FF6, 0x76C2, 0x8036, 0x768A, 0x8097, 0x764A, 0x80DF, 0x762A, 0x813C, 0x7605, 0x8275, 0x75D5}; - -#define LOGO_BACKGROUND 0xDEEA5C - -#define LOGO_PAINT_PATHS \ - LOGO_PAINT_PATH(0xC1D82F, logo_green) \ - LOGO_PAINT_PATH(0x000000, logo_black) \ - LOGO_PAINT_PATH(0x000000, logo_type) \ - LOGO_PAINT_PATH(0x000000, logo_mark) \ - LOGO_PAINT_PATH(0xFFFFFF, logo_white) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp index d8407406a1..49967be086 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp @@ -165,7 +165,6 @@ namespace Theme { {ORGAN, NOTE_A4, 4}, {SILENCE, REST, 36}, - {ORGAN, NOTE_C5S, 4}, {ORGAN, NOTE_D5, 2}, {ORGAN, NOTE_E5, 2}, diff --git a/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp b/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp index f16bdde29a..3254da3a37 100644 --- a/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp +++ b/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp @@ -91,7 +91,6 @@ void FileNavigator::getFiles(uint16_t index) { } lastindex = index; - // Clear currently drawn screen for (int i = 0; i < DISPLAY_FILES; i++) { for (int j = 0; j < 20; j++) diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp index 490e427b85..4fb974da23 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp @@ -59,7 +59,7 @@ void onPrinterKilled(FSTR_P const error, FSTR_P const component) { delay_ms(10); } -void onMediaInserted() { +void onMediaMounted() { filenavigator.reset(); filenavigator.getFiles(0); fileIndex = 0; @@ -98,7 +98,11 @@ void onMediaRemoved() { } } -void onPlayTone(const uint16_t frequency, const uint16_t duration) { +void onHeatingError(const heater_id_t header_id) {} +void onMinTempError(const heater_id_t header_id) {} +void onMaxTempError(const heater_id_t header_id) {} + +void onPlayTone(const uint16_t, const uint16_t/*=0*/) { rts.sendData(StartSoundSet, SoundAddr); } @@ -228,6 +232,26 @@ void onUserConfirmRequired(const char *const msg) { lastPauseMsgState = ExtUI::pauseModeStatus; } +// For fancy LCDs include an icon ID, message, and translated button title +void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); +} +void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); +} + +#if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } +#endif + void onStatusChanged(const char *const statMsg) { for (int16_t j = 0; j < 20; j++) // Clear old message rts.sendData(' ', StatusMessageString + j); @@ -249,41 +273,14 @@ void onFactoryReset() { show_status = true; } -void onMeshUpdate(const int8_t xpos, const int8_t ypos, probe_state_t state) {} - -void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { - if (waitway == 3) - if (isPositionKnown() && (getActualTemp_celsius(BED) >= (getTargetTemp_celsius(BED) - 1))) - rts.sendData(ExchangePageBase + 64, ExchangepageAddr); - #if HAS_MESH - uint8_t abl_probe_index = 0; - for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) - for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { - const bool zig = outer & 1; // != ((PR_OUTER_END) & 1); - const xy_uint8_t point = { uint8_t(zig ? (GRID_MAX_POINTS_X - 1) - inner : inner), outer }; - if (point.x == xpos && outer == ypos) - rts.sendData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + (abl_probe_index * 2)); - ++abl_probe_index; - } - #endif -} +static_assert(eeprom_data_size >= sizeof(creality_dwin_settings_t), "Insufficient space in EEPROM for UI parameters"); void onStoreSettings(char *buff) { - static_assert( - ExtUI::eeprom_data_size >= sizeof(creality_dwin_settings_t), - "Insufficient space in EEPROM for UI parameters" - ); - // Write to buffer memcpy(buff, &dwin_settings, sizeof(creality_dwin_settings_t)); } void onLoadSettings(const char *buff) { - static_assert( - ExtUI::eeprom_data_size >= sizeof(creality_dwin_settings_t), - "Insufficient space in EEPROM for UI parameters" - ); - creality_dwin_settings_t eepromSettings; memcpy(&eepromSettings, buff, sizeof(creality_dwin_settings_t)); @@ -305,7 +302,7 @@ void onLoadSettings(const char *buff) { } void onSettingsStored(const bool success) { - // This is called after the entire EEPROM has been written, + // Called after the entire EEPROM has been written, // whether successful or not. } @@ -334,6 +331,59 @@ void onSettingsLoaded(const bool success) { rts.setTouchScreenConfiguration(); } +void onPostprocessSettings() {} + +#if HAS_LEVELING + void onLevelingStart() {} + + void onLevelingDone() { + #if HAS_MESH + if (ExtUI::getLevelingIsValid()) { + uint8_t abl_probe_index = 0; + for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) + for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { + const bool zig = outer & 1; + const xy_uint8_t point = { uint8_t(zig ? (GRID_MAX_POINTS_X - 1) - inner : inner), outer }; + rts.sendData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + abl_probe_index * 2); + ++abl_probe_index; + } + + rts.sendData(3, AutoLevelIcon); // 2=On, 3=Off + setLevelingActive(true); + } + else { + rts.sendData(2, AutoLevelIcon); /*Off*/ + setLevelingActive(false); + } + #endif + } +#endif + +#if HAS_MESH + void onMeshUpdate(const int8_t xpos, const int8_t ypos, probe_state_t state) {} + + void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { + if (waitway == 3) + if (isPositionKnown() && (getActualTemp_celsius(BED) >= (getTargetTemp_celsius(BED) - 1))) + rts.sendData(ExchangePageBase + 64, ExchangepageAddr); + #if HAS_MESH + uint8_t abl_probe_index = 0; + for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) + for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { + const bool zig = outer & 1; // != ((PR_OUTER_END) & 1); + const xy_uint8_t point = { uint8_t(zig ? (GRID_MAX_POINTS_X - 1) - inner : inner), outer }; + if (point.x == xpos && outer == ypos) + rts.sendData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + (abl_probe_index * 2)); + ++abl_probe_index; + } + #endif + } +#endif + +#if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} +#endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -351,7 +401,7 @@ void onSettingsLoaded(const bool success) { #endif #if HAS_PID_HEATING - void onPidTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result rts.sendData(pid_hotendAutoTemp, HotendPID_AutoTmp); rts.sendData(pid_bedAutoTemp, BedPID_AutoTmp); @@ -365,39 +415,31 @@ void onSettingsLoaded(const bool success) { #endif onStatusChanged(F("PID Tune Finished")); } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } #endif -void onLevelingStart() {} +#if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature PID tuning result + } +#endif -void onLevelingDone() { - #if HAS_MESH - if (ExtUI::getLevelingIsValid()) { - uint8_t abl_probe_index = 0; - for (uint8_t outer = 0; outer < GRID_MAX_POINTS_Y; outer++) - for (uint8_t inner = 0; inner < GRID_MAX_POINTS_X; inner++) { - const bool zig = outer & 1; - const xy_uint8_t point = { uint8_t(zig ? (GRID_MAX_POINTS_X - 1) - inner : inner), outer }; - rts.sendData(ExtUI::getMeshPoint(point) * 1000, AutolevelVal + abl_probe_index * 2); - ++abl_probe_index; - } +#if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} +#endif - rts.sendData(3, AutoLevelIcon); // 2=On, 3=Off - setLevelingActive(true); - } - else { - rts.sendData(2, AutoLevelIcon); /*Off*/ - setLevelingActive(false); - } - #endif -} - -void onSteppersEnabled() {} -void onPrintDone() {} void onHomingStart() {} void onHomingDone() {} -void onSteppersDisabled() {} -void onPostprocessSettings() {} -} // namespace ExtUI +void onPrintDone() {} + +void onSteppersDisabled() {} +void onSteppersEnabled() {} +void onAxisDisabled(const axis_t) {} +void onAxisEnabled(const axis_t) {} + +} // ExtUI #endif // DGUS_LCD_UI_IA_CREALITY diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp index 8ff9fd9f71..557d4f8579 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp @@ -163,21 +163,10 @@ void RTS::onIdle() { TERN_(HAS_MULTI_HOTEND, rts.sendData(uint8_t(getActiveTool() + 1), ActiveToolVP)); if (awaitingUserConfirm() && (lastPauseMsgState != ExtUI::pauseModeStatus || userConfValidation > 99)) { - switch (ExtUI::pauseModeStatus) { - case PAUSE_MESSAGE_PARKING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; - case PAUSE_MESSAGE_CHANGING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; - case PAUSE_MESSAGE_UNLOAD: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; - case PAUSE_MESSAGE_WAITING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING)); break; - case PAUSE_MESSAGE_INSERT: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; - case PAUSE_MESSAGE_LOAD: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; - case PAUSE_MESSAGE_PURGE: ExtUI::onUserConfirmRequired(GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE))); break; - case PAUSE_MESSAGE_RESUME: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; - case PAUSE_MESSAGE_HEAT: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); break; - case PAUSE_MESSAGE_HEATING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; - case PAUSE_MESSAGE_OPTION: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_OPTION_HEADER)); break; - case PAUSE_MESSAGE_STATUS: break; - default: onUserConfirmRequired(PSTR("Confirm Continue")); break; - } + if (ExtUI::pauseModeStatus < PAUSE_MESSAGE_COUNT) + ui.pause_show_message(ExtUI::pauseModeStatus); + else + ExtUI::onUserConfirmRequired(F("Confirm Continue")); userConfValidation = 0; } else if (pause_resume_selected && !awaitingUserConfirm()) { @@ -262,8 +251,8 @@ void RTS::onIdle() { delay_ms(3000); // Delay to show bootscreen } else if (startprogress < 250) { - if (isMediaInserted()) // Re init media as it happens too early on STM32 boards often - onMediaInserted(); + if (isMediaMounted()) // Re init media as it happens too early on STM32 boards often + onMediaMounted(); else injectCommands(F("M22\nM21")); startprogress = 254; @@ -386,7 +375,7 @@ void RTS::onIdle() { if (++autoHomeIconNum > 9) autoHomeIconNum = 0; } - if (isMediaInserted()) { + if (isMediaMounted()) { const uint16_t currPage = fileIndex == 0 ? 1 : CEIL(float(fileIndex) / float(DISPLAY_FILES)) + 1, maxPageAdd = filenavigator.folderdepth ? 1 : 0, maxPages = CEIL(float(filenavigator.maxFiles() + maxPageAdd) / float(DISPLAY_FILES) ); @@ -459,12 +448,13 @@ int16_t RTS::receiveData() { } /* AutoUpload, (and answer to) Command 0x83 : - | tmp[0 1 2 3 4 ... ] - | Example 5A A5 06 83 20 01 01 78 01 …… - | / / | | \ / | \ \ - | Header | | | | \_____\_ DATA (Words!) - | DatagramLen / VPAdr | - | Command DataLen (in Words) */ + * tmp[0 1 2 3 4 ... ] + * Example 5A A5 06 83 20 01 01 78 01 …… + * / / | | \ / | \ \ + * Header | | | | \_____\_ DATA (Words!) + * DatagramLen / VPAdr | + * Command DataLen (in Words) + */ if (command == VarAddr_R) { const uint16_t vp = tmp[0] << 8 | tmp[1]; @@ -478,7 +468,6 @@ int16_t RTS::receiveData() { rx_datagram_state = DGUS_IDLE; return 2; - break; } // discard anything else @@ -637,7 +626,7 @@ void RTS::handleData() { recdat.head[1] = FHTWO; return; } - for (int16_t i = 0; Addrbuf[i] != 0; i++) + for (int16_t i = 0; Addrbuf[i] != 0; i++) { if (recdat.addr == Addrbuf[i]) { if (Addrbuf[i] == NzBdSet || Addrbuf[i] == NozzlePreheat || Addrbuf[i] == BedPreheat || Addrbuf[i] == Flowrate) Checkkey = ManualSetTemp; @@ -651,6 +640,7 @@ void RTS::handleData() { Checkkey = i; break; } + } switch (recdat.addr) { case Flowrate: @@ -662,7 +652,7 @@ void RTS::handleData() { case HotendPID_P ... HotendPID_D: case BedPID_P ... BedPID_D: #if ENABLED(DUAL_X_CARRIAGE) - case T2Offset_X ... T2Offset_Z + case T2Offset_X ... T2Offset_Z: #if ENABLED(EDITABLE_STEPS_PER_UNIT) case T2StepMM_E: #endif @@ -700,7 +690,8 @@ void RTS::handleData() { #endif switch (Checkkey) { - case Printfile: + + case Printfile: { if (recdat.data[0] == 1) { // card show_status = false; filenavigator.getFiles(0); @@ -734,9 +725,9 @@ void RTS::handleData() { else if (recdat.data[0] == 4) { // Settings show_status = false; } - break; + } break; - case Adjust: + case Adjust: { if (recdat.data[0] == 1) { show_status = false; } @@ -752,13 +743,13 @@ void RTS::handleData() { else if (recdat.data[0] == 3) setTargetFan_percent(getTargetFan_percent((fan_t)getActiveTool()) != 0 ? 100 : 0, FAN0); - break; + } break; - case Feedrate: + case Feedrate: { setFeedrate_percent(recdat.data[0]); - break; + } break; - case PrintChoice: + case PrintChoice: { if (recdat.addr == Stopprint) { if (recdat.data[0] == 240) { // no sendData(ExchangePageBase + 53, ExchangepageAddr); @@ -792,17 +783,17 @@ void RTS::handleData() { show_status = true; sendData(ExchangePageBase + 82, ExchangepageAddr); } - break; + } break; #if HAS_BED_PROBE - case Zoffset: + case Zoffset: { float tmp_zprobe_offset; if (recdat.data[0] >= 32768) tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100; else tmp_zprobe_offset = float(recdat.data[0]) / 100; - if (WITHIN((tmp_zprobe_offset), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { + if (WITHIN(tmp_zprobe_offset, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, axis_t(Z)); if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1; smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false); @@ -815,11 +806,11 @@ void RTS::handleData() { } sendData(getZOffset_mm() * 100, ProbeOffset_Z); - break; + } break; #endif // HAS_BED_PROBE - case TempControl: + case TempControl: { if (recdat.data[0] == 0) { show_status = true; tpShowStatus = false; @@ -868,9 +859,9 @@ void RTS::handleData() { sendData(ExchangePageBase + 57, ExchangepageAddr); printerStatusKey[1] = 2; } - break; + } break; - case ManualSetTemp: + case ManualSetTemp: { if (recdat.addr == NzBdSet) { if (recdat.data[0] == 0) { if (getTargetFan_percent((fan_t)getActiveTool()) == 0) @@ -942,11 +933,9 @@ void RTS::handleData() { setTargetFan_percent(uint16_t(recdat.data[0]), (fan_t)getActiveTool()); } else { - float tmp_float_handling; - if (recdat.data[0] >= 32768) - tmp_float_handling = (float(recdat.data[0]) - 65536) / 100; - else - tmp_float_handling = float(recdat.data[0]) / 100; + float tmp_float_handling = float(recdat.data[0]); + if (tmp_float_handling >= 32768) tmp_float_handling -= 65536; + tmp_float_handling /= 100; if (false) {} @@ -1053,9 +1042,9 @@ void RTS::handleData() { #endif #endif // HAS_PID_HEATING } - break; + } break; - case Setting: + case Setting: { if (recdat.data[0] == 0) { // return to main page show_status = true; tpShowStatus = false; @@ -1108,29 +1097,27 @@ void RTS::handleData() { injectCommands(F("M84")); sendData(11, FilenameIcon); } - break; + } break; - case ReturnBack: + case ReturnBack: { if (recdat.data[0] == 1) { // return to the tool page show_status = false; sendData(ExchangePageBase + 63, ExchangepageAddr); } - if (recdat.data[0] == 2) // return to the Level mode page + else if (recdat.data[0] == 2) // return to the Level mode page sendData(ExchangePageBase + 64, ExchangepageAddr); - break; + } break; - case Bedlevel: + case Bedlevel: { switch (recdat.data[0]) { - case 1: { // Z-axis to home + case 1: // Z-axis to home // Disallow Z homing if X or Y are unknown injectCommands(isAxisPositionKnown(axis_t(X)) && isAxisPositionKnown(axis_t(Y)) ? F("G28Z\nG1F1500Z0.0") : F("G28\nG1F1500Z0.0")); sendData(getZOffset_mm() * 100, ProbeOffset_Z); break; - } #if HAS_BED_PROBE - - case 2: { // Z-axis to Up + case 2: // Z-axis to Up if (WITHIN((getZOffset_mm() + 0.1), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { smartAdjustAxis_steps(getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); //setZOffset_mm(getZOffset_mm() + 0.1); @@ -1138,8 +1125,8 @@ void RTS::handleData() { onStatusChanged(MString<20>(GET_TEXT_F(MSG_UBL_Z_OFFSET), p_float_t(getZOffset_mm(), 3))); } break; - } - case 3: { // Z-axis to Down + + case 3: // Z-axis to Down if (WITHIN((getZOffset_mm() - 0.1), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { smartAdjustAxis_steps(-getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); //babystepAxis_steps(int16_t(-getAxisSteps_per_mm(Z)) / 10, axis_t(Z)); @@ -1148,17 +1135,15 @@ void RTS::handleData() { onStatusChanged(MString<20>(GET_TEXT_F(MSG_UBL_Z_OFFSET), p_float_t(getZOffset_mm(), 3))); } break; - } - #endif // HAS_BED_PROBE - case 4: { // Assistant Level + case 4: // Assistant Level TERN_(HAS_MESH, setLevelingActive(false)); injectCommands(isPositionKnown() ? F("G1 F1000 Z0.0") : F("G28\nG1 F1000 Z0.0")); waitway = 2; sendData(ExchangePageBase + 84, ExchangepageAddr); break; - } + case 5: { // AutoLevel "Measuring" Button #if ENABLED(MESH_BED_LEVELING) sendData(ExchangePageBase + 93, ExchangepageAddr); @@ -1173,45 +1158,44 @@ void RTS::handleData() { sendData(ExchangePageBase + 64, ExchangepageAddr); injectCommands(F(MEASURING_GCODE)); #endif - break; - } + } break; #if ENABLED(LCD_BED_TRAMMING) - case 6: { // Bed Tramming, Centre 1 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + case 6: // Bed Tramming, Centre 1 + if (BED_TRAMMING_Z_HOP) setAxisPosition_mm(current_position.z + (BED_TRAMMING_Z_HOP), axis_t(Z)); setAxisPosition_mm(X_CENTER, axis_t(X)); setAxisPosition_mm(Y_CENTER, axis_t(Y)); waitway = 6; break; - } - case 7: { // Bed Tramming, Front Left 2 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + + case 7: // Bed Tramming, Front Left 2 + if (BED_TRAMMING_Z_HOP) setAxisPosition_mm(current_position.z + (BED_TRAMMING_Z_HOP), axis_t(Z)); setAxisPosition_mm(X_MIN_BED + lfrb[0], axis_t(X)); setAxisPosition_mm(Y_MIN_BED + lfrb[1], axis_t(Y)); waitway = 6; break; - } - case 8: { // Bed Tramming, Front Right 3 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + + case 8: // Bed Tramming, Front Right 3 + if (BED_TRAMMING_Z_HOP) setAxisPosition_mm(current_position.z + (BED_TRAMMING_Z_HOP), axis_t(Z)); setAxisPosition_mm(X_MAX_BED - lfrb[2], axis_t(X)); setAxisPosition_mm(Y_MIN_BED + lfrb[1], axis_t(Y)); waitway = 6; break; - } - case 9: { // Bed Tramming, Back Right 4 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + + case 9: // Bed Tramming, Back Right 4 + if (BED_TRAMMING_Z_HOP) setAxisPosition_mm(current_position.z + (BED_TRAMMING_Z_HOP), axis_t(Z)); setAxisPosition_mm(X_MAX_BED - lfrb[2], axis_t(X)); setAxisPosition_mm(Y_MAX_BED - lfrb[3], axis_t(Y)); waitway = 6; break; - } - case 10: { // Bed Tramming, Back Left 5 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + + case 10: // Bed Tramming, Back Left 5 + if (BED_TRAMMING_Z_HOP) setAxisPosition_mm(current_position.z + (BED_TRAMMING_Z_HOP), axis_t(Z)); setAxisPosition_mm(X_MIN_BED + lfrb[0], axis_t(X)); setAxisPosition_mm(Y_MAX_BED - lfrb[3], axis_t(Y)); waitway = 6; break; - } + #endif // LCD_BED_TRAMMING case 11: { // Autolevel switch @@ -1223,113 +1207,92 @@ void RTS::handleData() { #if HAS_BED_PROBE sendData(getZOffset_mm() * 100, ProbeOffset_Z); #endif - break; - } + } break; + #if ENABLED(G26_MESH_VALIDATION) - case 12: { + case 12: injectCommands(F("G26R255")); onStatusChanged(F("Beginning G26.. Heating")); break; - } #endif #if ENABLED(MESH_BED_LEVELING) - case 13: { + case 13: injectCommands(F("G29S1")); onStatusChanged(F("Begin Manual Mesh")); break; - } - case 14: { + case 14: injectCommands(F("G29S2")); onStatusChanged(F("Moving to Next Mesh Point")); break; - } #endif - case 15: { + case 15: injectCommands(F("M211S0\nG91\nG1Z-0.025\nG90\nM211S1")); onStatusChanged(F("Moved down 0.025")); break; - } - case 16: { + case 16: injectCommands(F("M211S0\nG91\nG1Z0.025\nG90\nM211S1")); onStatusChanged(F("Moved up 0.025")); break; - } - case 17: { + case 17: dwin_settings.display_volume = 0; dwin_settings.display_sound = false; setTouchScreenConfiguration(); break; - } - case 18: { + case 18: dwin_settings.display_volume = 255; dwin_settings.display_sound = true; setTouchScreenConfiguration(); break; - } - case 19: { + case 19: dwin_settings.screen_brightness = 10; setTouchScreenConfiguration(); break; - } - case 20: { + case 20: dwin_settings.screen_brightness = 100; setTouchScreenConfiguration(); break; - } - case 21: { + case 21: dwin_settings.display_standby ^= true; setTouchScreenConfiguration(); break; - } - case 22: { - dwin_settings.screen_rotation = dwin_settings.screen_rotation == 10 ? 0 : 10; + case 22: + dwin_settings.screen_rotation = 10 - dwin_settings.screen_rotation == 10 ? 0 : 10; setTouchScreenConfiguration(); break; - } - case 23: { // Set IDEX Autopark + case 23: // Set IDEX Autopark injectCommands(F("M605S1\nG28X\nG1X0")); break; - } - case 24: { // Set IDEX Duplication + case 24: // Set IDEX Duplication injectCommands(F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0")); break; - } - case 25: { // Set IDEX Mirrored Duplication + case 25: // Set IDEX Mirrored Duplication injectCommands(F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3")); break; - } - case 26: { // Set IDEX Full Control + case 26: // Set IDEX Full Control injectCommands(F("M605S0\nG28X")); break; - } - case 27: { // Change Tool + case 27: // Change Tool setActiveTool(getActiveTool() == E0 ? E1 : E0, !isAxisPositionKnown(X)); break; - } + default: break; } sendData(10, FilenameIcon); - break; + } break; case XYZEaxis: { axis_t axis = X; float min = 0.0f, max = 0.0f; waitway = 4; if (recdat.addr == DisplayXaxis) { - axis = X; - min = X_MIN_POS; - max = X_MAX_POS; + axis = X; min = X_MIN_POS; max = X_MAX_POS; } else if (recdat.addr == DisplayYaxis) { - axis = Y; - min = Y_MIN_POS; - max = Y_MAX_POS; + axis = Y; min = Y_MIN_POS; max = Y_MAX_POS; } else if (recdat.addr == DisplayZaxis) { - axis = Z; - min = Z_MIN_POS; - max = Z_MAX_POS; + axis = Z; min = Z_MIN_POS; max = Z_MAX_POS; } else if (recdat.addr == AutoZero) { if (recdat.data[0] == 3) { // autohome @@ -1343,19 +1306,16 @@ void RTS::handleData() { axisPageNum = recdat.data[0]; waitway = 0; } - break; - } + } break; float targetPos = float(recdat.data[0]) / 10; LIMIT(targetPos, min, max); setAxisPosition_mm(targetPos, axis); waitway = 0; sendData(10, FilenameIcon); - break; - } - - case Filament: + } break; + case Filament: { uint16_t IconTemp; if (recdat.addr == Exchfilament) { if (getActualTemp_celsius(getActiveTool()) < EXTRUDE_MINTEMP && recdat.data[0] < 5) { @@ -1366,23 +1326,23 @@ void RTS::handleData() { } switch (recdat.data[0]) { - case 1: { // Unload filament1 + case 1: // Unload filament1 setAxisPosition_mm(getAxisPosition_mm(E0) - changeMaterialBuf[0], E0); break; - } - case 2: { // Load filament1 + + case 2: // Load filament1 setAxisPosition_mm(getAxisPosition_mm(E0) + changeMaterialBuf[0], E0); break; - } - case 3: { // Unload filament2 + + case 3: // Unload filament2 setAxisPosition_mm(getAxisPosition_mm(E1) - changeMaterialBuf[1], E1); break; - } - case 4: { // Load filament2 + + case 4: // Load filament2 setAxisPosition_mm(getAxisPosition_mm(E1) + changeMaterialBuf[1], E1); break; - } - case 5: { // sure to heat + + case 5: // sure to heat nozzleTempStatus[0] = 1; setTargetTemp_celsius((PREHEAT_1_TEMP_HOTEND + 10), getActiveTool()); @@ -1397,17 +1357,17 @@ void RTS::handleData() { delay_ms(5); sendData(ExchangePageBase + 68, ExchangepageAddr); break; - } - case 6: { // cancel to heat + + case 6: // cancel to heat sendData(ExchangePageBase + 65, ExchangepageAddr); break; - } - case 0xF1: { // Sure to cancel heating + + case 0xF1: // Sure to cancel heating nozzleTempStatus[0] = 0; delay_ms(1); sendData(ExchangePageBase + 65, ExchangepageAddr); break; - } + case 0xF0: // not to cancel heating break; } @@ -1420,57 +1380,53 @@ void RTS::handleData() { else if (recdat.addr == FilamentUnit2) { changeMaterialBuf[1] = float(recdat.data[0]) / 10; } - break; + } break; - case LanguageChoice: + case LanguageChoice: { //if (recdat.data[0] == 1) settings.save(); else injectCommands(F("M300")); // may at some point use language change screens to save eeprom explicitly switch (recdat.data[0]) { - case 0: { + case 0: injectCommands(F("M500")); break; - } - case 1: { + + case 1: sendData(ExchangePageBase + 94, ExchangepageAddr); break; - } #if ENABLED(PIDTEMP) - case 2: { + case 2: onStatusChanged(F("Hotend PID Started")); startPIDTune(static_cast(pid_hotendAutoTemp), getActiveTool()); break; - } #endif - case 3: { + case 3: injectCommands(F("M502\nM500")); break; - } - case 4: { + + case 4: injectCommands(F("M999\nM280P0S160")); break; - } #if ENABLED(PIDTEMPBED) - case 5: { + case 5: onStatusChanged(F("Bed PID Started")); startBedPIDTune(static_cast(pid_bedAutoTemp)); break; - } #endif - case 6: { + case 6: injectCommands(F("M500")); break; - } + default: break; } - break; + } break; - case No_Filament: + case No_Filament: { if (recdat.data[0] == 1) { // Filament is out, resume / resume selected on screen if (ExtUI::pauseModeStatus != PAUSE_MESSAGE_PURGE && ExtUI::pauseModeStatus != PAUSE_MESSAGE_OPTION) { // setPauseMenuResponse(PAUSE_RESPONSE_RESUME_PRINT); @@ -1507,7 +1463,7 @@ void RTS::handleData() { setUserConfirmed(); } } - break; + } break; #if ENABLED(POWER_LOSS_RECOVERY) case PwrOffNoF: @@ -1518,14 +1474,8 @@ void RTS::handleData() { break; #endif - case Volume: - if (recdat.data[0] < 0) - dwin_settings.display_volume = 0; - else if (recdat.data[0] > 255) - dwin_settings.display_volume = 0xFF; - else - dwin_settings.display_volume = recdat.data[0]; - + case Volume: { + dwin_settings.display_volume = constrain(recdat.data[0], 0, 255); if (dwin_settings.display_volume == 0) { sendData(0, VolumeIcon); sendData(9, SoundIcon); @@ -1535,10 +1485,10 @@ void RTS::handleData() { sendData(8, SoundIcon); } sendData(dwin_settings.display_volume << 8, SoundAddr + 1); - break; + } break; - case Filename: - if (isMediaInserted() && recdat.addr == FilenameChs) { + case Filename: { + if (isMediaMounted() && recdat.addr == FilenameChs) { recordcount = recdat.data[0] - 1; if (filenavigator.currentindex == 0 && filenavigator.folderdepth > 0 && (fileIndex + recordcount) == 0) { @@ -1571,7 +1521,7 @@ void RTS::handleData() { } } else if (recdat.addr == FilenamePlay) { - if (recdat.data[0] == 1 && isMediaInserted()) { // for sure + if (recdat.data[0] == 1 && isMediaMounted()) { // for sure printFile(filenavigator.getIndexName(fileIndex + recordcount)); for (int16_t j = 0; j < 10; j++) // clean screen. @@ -1616,7 +1566,7 @@ void RTS::handleData() { tpShowStatus = false; } } - break; + } break; case VolumeDisplay: { if (recdat.data[0] == 0) { @@ -1632,8 +1582,7 @@ void RTS::handleData() { dwin_settings.display_sound = true; } setTouchScreenConfiguration(); - break; - } + } break; case DisplayBrightness: { if (recdat.data[0] < 10) @@ -1643,8 +1592,7 @@ void RTS::handleData() { else dwin_settings.screen_brightness = (uint8_t)recdat.data[0]; setTouchScreenConfiguration(); - break; - } + } break; case DisplayStandbyBrightness: { if (recdat.data[0] < 10) @@ -1654,8 +1602,7 @@ void RTS::handleData() { else dwin_settings.standby_brightness = (uint8_t)recdat.data[0]; setTouchScreenConfiguration(); - break; - } + } break; case DisplayStandbySeconds: { if (recdat.data[0] < 5) @@ -1665,8 +1612,7 @@ void RTS::handleData() { else dwin_settings.standby_time_seconds = (uint8_t)recdat.data[0]; setTouchScreenConfiguration(); - break; - } + } break; case AutolevelVal: { uint8_t meshPoint = (recdat.addr - AutolevelVal) / 2, @@ -1680,8 +1626,7 @@ void RTS::handleData() { xy_uint8_t point = { xPnt, yPnt }; setMeshPoint(point, meshVal); sendData(meshVal * 1000, recdat.addr); - break; - } + } break; default: break; } diff --git a/Marlin/src/lcd/extui/malyan/malyan.cpp b/Marlin/src/lcd/extui/malyan/malyan.cpp index c2e6bcdb7d..4eb5ceaf5f 100644 --- a/Marlin/src/lcd/extui/malyan/malyan.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan.cpp @@ -106,7 +106,6 @@ void set_lcd_error(FSTR_P const error, FSTR_P const component/*=nullptr*/) { write_to_lcd(F("}")); } - /** * Process an LCD 'C' command. * These are currently all temperature commands diff --git a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp index f82f1f06a7..3ed4678a41 100644 --- a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp @@ -104,11 +104,13 @@ namespace ExtUI { #if HAS_PID_HEATING - void onPidTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result - //SERIAL_ECHOLNPGM("OnPidTuning:", rst); + //SERIAL_ECHOLNPGM("OnPIDTuning:", rst); switch (rst) { case PID_STARTED: + case PID_BED_STARTED: + case PID_CHAMBER_STARTED: set_lcd_error(GET_TEXT_F(MSG_PID_AUTOTUNE)); break; case PID_BAD_HEATER_ID: @@ -126,6 +128,10 @@ namespace ExtUI { } } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif void onPrintTimerStarted() { write_to_lcd(F("{SYS:BUILD}")); } @@ -134,16 +140,38 @@ namespace ExtUI { // Not needed for Malyan LCD void onStatusChanged(const char * const) {} - void onMediaInserted() {} + + void onMediaMounted() {} void onMediaError() {} void onMediaRemoved() {} - void onPlayTone(const uint16_t, const uint16_t) {} + + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + + void onPlayTone(const uint16_t, const uint16_t/*=0*/) {} + void onFilamentRunout(const extruder_t extruder) {} void onUserConfirmRequired(const char * const) {} + + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) {} + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) {} + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) {} + #endif + void onHomingStart() {} void onHomingDone() {} + void onPrintDone() {} void onFactoryReset() {} + void onStoreSettings(char*) {} void onLoadSettings(const char*) {} void onPostprocessSettings() {} @@ -153,6 +181,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -160,6 +191,10 @@ namespace ExtUI { void onMeshUpdate(const int8_t, const int8_t, const ExtUI::probe_state_t) {} #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -172,8 +207,20 @@ namespace ExtUI { } #endif + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature PID tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} + #endif + void onSteppersDisabled() {} - void onSteppersEnabled() {} + void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // MALYAN_LCD diff --git a/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.cpp b/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.cpp index 2c6dda5121..0554c34a19 100644 --- a/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.cpp +++ b/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.cpp @@ -158,7 +158,6 @@ void SPIFlashStorage::beginWrite(const uint32_t startAddress) { #endif } - void SPIFlashStorage::endWrite() { // Flush remaining data #if HAS_SPI_FLASH_COMPRESSION diff --git a/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp index 1f703f3652..32eb7e77d7 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp @@ -396,7 +396,7 @@ void lv_draw_dialog(uint8_t type) { F(DIALOG_UPLOAD_FINISH_EN), '\n', F(DIALOG_UPLOAD_SIZE_EN), F(": "), int(upload_size / 1024), F(" KBytes\n"), F(DIALOG_UPLOAD_TIME_EN), F(": "), int(upload_time_sec), F(" s\n"), - F(DIALOG_UPLOAD_SPEED_EN), F(": "), int(upload_size / upload_time_sec / 1024), F(" KBytes/s\n"), + F(DIALOG_UPLOAD_SPEED_EN), F(": "), int(upload_size / upload_time_sec / 1024), F(" KBytes/s\n") ); lv_label_set_text(labelDialog, buf); lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20); diff --git a/Marlin/src/lcd/extui/mks_ui/draw_wifi.h b/Marlin/src/lcd/extui/mks_ui/draw_wifi.h index a89bbd67d8..18cfd0755c 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_wifi.h +++ b/Marlin/src/lcd/extui/mks_ui/draw_wifi.h @@ -25,7 +25,6 @@ extern "C" { #endif - void lv_draw_wifi(); void lv_clear_wifi(); void disp_wifi_state(); diff --git a/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h b/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h index a289a80dc7..6f1499a068 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h +++ b/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h @@ -25,7 +25,6 @@ extern "C" { #endif - void lv_draw_wifi_tips(); void lv_clear_wifi_tips(); diff --git a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp index eb9cac641a..f06ffcd89d 100644 --- a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp +++ b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp @@ -99,7 +99,9 @@ #define ESTATE(S) (READ(S##_PIN) == S##_ENDSTOP_HIT_STATE) void test_gpio_readlevel_L() { - WRITE(WIFI_IO0_PIN, HIGH); + #if PIN_EXISTS(WIFI_IO0) + WRITE(WIFI_IO0_PIN, HIGH); + #endif delay(10); pw_det_sta = (READ(MKS_TEST_POWER_LOSS_PIN) == LOW); pw_off_sta = (READ(MKS_TEST_PS_ON_PIN) == LOW); @@ -132,7 +134,9 @@ } void test_gpio_readlevel_H() { - WRITE(WIFI_IO0_PIN, LOW); + #if PIN_EXISTS(WIFI_IO0) + WRITE(WIFI_IO0_PIN, LOW); + #endif delay(10); pw_det_sta = (READ(MKS_TEST_POWER_LOSS_PIN) == HIGH); pw_off_sta = (READ(MKS_TEST_PS_ON_PIN) == HIGH); @@ -169,7 +173,9 @@ void init_test_gpio() { endstops.init(); - SET_OUTPUT(WIFI_IO0_PIN); + #if PIN_EXISTS(WIFI_IO0) + SET_OUTPUT(WIFI_IO0_PIN); + #endif #if PIN_EXISTS(MT_DET_1) SET_INPUT_PULLUP(MT_DET_1_PIN); diff --git a/Marlin/src/lcd/extui/mks_ui/tft_Language_fr.h b/Marlin/src/lcd/extui/mks_ui/tft_Language_fr.h index f0b19d4e02..35c753ad1a 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_Language_fr.h +++ b/Marlin/src/lcd/extui/mks_ui/tft_Language_fr.h @@ -154,7 +154,6 @@ #define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Chargement terminé,\n pour revenir!" #define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Déchargement terminé,\n pour revenir!" - #define PRE_HEAT_EXT_TEXT_FR "E" #define PRE_HEAT_BED_TEXT_FR "Bed" 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 a10d0119f0..f8dda5bd7b 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp @@ -216,7 +216,6 @@ void tft_lvgl_init() { tft_style_init(); filament_pin_setup(); - lv_encoder_pin_init(); #if ENABLED(MKS_WIFI_MODULE) mks_esp_wifi_init(); @@ -331,12 +330,12 @@ bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data) { } int16_t enc_diff = 0; -lv_indev_state_t state = LV_INDEV_STATE_REL; +lv_indev_state_t indev_enc_state = LV_INDEV_STATE_REL; // ENC button is pressed or released bool my_mousewheel_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) { - (void) indev_drv; // Unused + UNUSED(indev_drv); - data->state = state; + data->state = indev_enc_state; data->enc_diff = enc_diff; enc_diff = 0; @@ -446,102 +445,50 @@ lv_fs_res_t sd_tell_cb(lv_fs_drv_t * drv, void * file_p, uint32_t * pos_p) { return LV_FS_RES_OK; } -void lv_encoder_pin_init() { - #if BUTTON_EXISTS(EN1) - SET_INPUT_PULLUP(BTN_EN1); +void lv_update_encoder() { + + #if ANY_BUTTON(EN1, EN2) + constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; // We can fill in + static uint8_t pulse_count; + pulse_count += ui.get_encoder_delta(); + const int8_t fullSteps = pulse_count / epps; + pulse_count -= fullSteps * epps; + enc_diff += fullSteps; #endif - #if BUTTON_EXISTS(EN2) - SET_INPUT_PULLUP(BTN_EN2); + + #if ANY_BUTTON(ENC, BACK, UP, DOWN, LEFT, RIGHT) + static millis_t last_encoder_ms; + const millis_t now = millis(), diffTime = getTickDiff(now, last_encoder_ms); + if (diffTime <= 50) return; #endif + #if BUTTON_EXISTS(ENC) - SET_INPUT_PULLUP(BTN_ENC); + static uint8_t old_button_enc = LV_INDEV_STATE_REL; + const uint8_t enc_c = BUTTON_PRESSED(ENC) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; + if (enc_c != old_button_enc) { + indev_enc_state = enc_c ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; + old_button_enc = enc_c; + } #endif #if BUTTON_EXISTS(BACK) - SET_INPUT_PULLUP(BTN_BACK); + if (BUTTON_PRESSED(BACK)) {} #endif - #if BUTTON_EXISTS(UP) - SET_INPUT(BTN_UP); + if (BUTTON_PRESSED(UP)) {} #endif #if BUTTON_EXISTS(DOWN) - SET_INPUT(BTN_DOWN); + if (BUTTON_PRESSED(DOWN)) {} #endif #if BUTTON_EXISTS(LEFT) - SET_INPUT(BTN_LEFT); + if (BUTTON_PRESSED(LEFT)) {} #endif #if BUTTON_EXISTS(RIGHT) - SET_INPUT(BTN_RIGHT); + if (BUTTON_PRESSED(RIGHT)) {} #endif + } -#if 1 // HAS_ENCODER_ACTION - - void lv_update_encoder() { - static uint32_t encoder_time1; - uint32_t tmpTime, diffTime = 0; - tmpTime = millis(); - diffTime = getTickDiff(tmpTime, encoder_time1); - if (diffTime > 50) { - - #if HAS_ENCODER_WHEEL - - #if ANY_BUTTON(EN1, EN2, ENC, BACK) - - uint8_t newbutton = 0; - if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; - if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; - if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; - if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; - - #else - - constexpr uint8_t newbutton = 0; - - #endif - - static uint8_t buttons = 0; - buttons = newbutton; - static uint8_t lastEncoderBits; - - #define encrot0 0 - #define encrot1 1 - #define encrot2 2 - - uint8_t enc = 0; - if (buttons & EN_A) enc |= B01; - if (buttons & EN_B) enc |= B10; - if (enc != lastEncoderBits) { - switch (enc) { - case encrot1: - if (lastEncoderBits == encrot0) { - enc_diff--; - encoder_time1 = tmpTime; - } - break; - case encrot2: - if (lastEncoderBits == encrot0) { - enc_diff++; - encoder_time1 = tmpTime; - } - break; - } - lastEncoderBits = enc; - } - static uint8_t last_button_state = LV_INDEV_STATE_REL; - const uint8_t enc_c = (buttons & EN_C) ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; - if (enc_c != last_button_state) { - state = enc_c ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL; - last_button_state = enc_c; - } - - #endif // HAS_ENCODER_WHEEL - - } // encoder_time1 - } - -#endif // HAS_ENCODER_ACTION - #ifdef __PLAT_NATIVE_SIM__ #include typedef void (*lv_log_print_g_cb_t)(lv_log_level_t level, const char *, uint32_t, const char *); diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h index 80335b7370..43e82bd34d 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h @@ -40,12 +40,7 @@ void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * co bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data); bool my_mousewheel_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data); -void LCD_Clear(uint16_t color); -void tft_set_point(uint16_t x, uint16_t y, uint16_t point); -void LCD_setWindowArea(uint16_t StartX, uint16_t StartY, uint16_t width, uint16_t height); -void LCD_WriteRAM_Prepare(); -void lcd_draw_logo(); -void lv_encoder_pin_init(); +void lcdClear(uint16_t color); void lv_update_encoder(); lv_fs_res_t spi_flash_open_cb(lv_fs_drv_t * drv, void * file_p, const char * path, lv_fs_mode_t mode); diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp index 122712e9e1..46ba860239 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp @@ -1920,7 +1920,9 @@ void mks_esp_wifi_init() { SET_OUTPUT(WIFI_RESET_PIN); WIFI_SET(); SET_OUTPUT(WIFI_IO1_PIN); - SET_INPUT_PULLUP(WIFI_IO0_PIN); + #if PIN_EXISTS(WIFI_IO0) + SET_INPUT_PULLUP(WIFI_IO0_PIN); + #endif WIFI_IO1_SET(); esp_state = TRANSFER_IDLE; diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp index 2d4d19e7a2..3ce8bb42ec 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp @@ -650,12 +650,14 @@ void resetWiFiForUpload(int begin_or_end) { //#if 0 uint32_t start = getWifiTick(); - if (begin_or_end == 0) { - SET_OUTPUT(WIFI_IO0_PIN); - WRITE(WIFI_IO0_PIN, LOW); - } - else - SET_INPUT_PULLUP(WIFI_IO0_PIN); + #if PIN_EXISTS(WIFI_IO0) + if (begin_or_end == 0) { + SET_OUTPUT(WIFI_IO0_PIN); + WRITE(WIFI_IO0_PIN, LOW); + } + else + SET_INPUT_PULLUP(WIFI_IO0_PIN); + #endif WIFI_RESET(); while (getWifiTickDiff(start, getWifiTick()) < 500) { /* nada */ } diff --git a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp index b1e1997a3a..570624afcc 100644 --- a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp +++ b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp @@ -38,19 +38,48 @@ namespace ExtUI { void onStartup() { nextion.startup(); } void onIdle() { nextion.idleLoop(); } void onPrinterKilled(FSTR_P const error, FSTR_P const component) { nextion.printerKilled(error, component); } - void onMediaInserted() {} + + void onMediaMounted() {} void onMediaError() {} void onMediaRemoved() {} - void onPlayTone(const uint16_t frequency, const uint16_t duration) {} + + void onHeatingError(const heater_id_t header_id) {} + void onMinTempError(const heater_id_t header_id) {} + void onMaxTempError(const heater_id_t header_id) {} + + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {} void onPrintTimerStarted() {} void onPrintTimerPaused() {} void onPrintTimerStopped() {} void onFilamentRunout(const extruder_t) {} + void onUserConfirmRequired(const char * const msg) { nextion.confirmationRequest(msg); } + + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) { + onUserConfirmRequired(cstr); + UNUSED(icon); UNUSED(fBtn); + } + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn) { + onUserConfirmRequired(fstr); + UNUSED(icon); UNUSED(fBtn); + } + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + void onPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + stdOnPauseMode(message, mode, extruder); + } + #endif + void onStatusChanged(const char * const msg) { nextion.statusChange(msg); } void onHomingStart() {} void onHomingDone() {} + void onPrintDone() { nextion.PrintFinished(); } void onFactoryReset() {} @@ -92,6 +121,9 @@ namespace ExtUI { #if HAS_LEVELING void onLevelingStart() {} void onLevelingDone() {} + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp() { return LEVELING_BED_TEMP; } + #endif #endif #if HAS_MESH @@ -104,6 +136,10 @@ namespace ExtUI { } #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t) {} + #endif + #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff) { // Called when power-loss is enabled/disabled @@ -117,15 +153,29 @@ namespace ExtUI { #endif #if HAS_PID_HEATING - void onPidTuning(const result_t rst) { + void onPIDTuning(const pidresult_t rst) { // Called for temperature PID tuning result nextion.panelInfo(37); } + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp) { + // Called by M303 to update the UI + } + #endif + + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst) { + // Called for temperature PID tuning result + } + #endif + + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash() {} #endif void onSteppersDisabled() {} - void onSteppersEnabled() {} - + void onSteppersEnabled() {} + void onAxisDisabled(const axis_t) {} + void onAxisEnabled(const axis_t) {} } #endif // NEXTION_TFT diff --git a/Marlin/src/lcd/extui/nextion/nextion_tft.cpp b/Marlin/src/lcd/extui/nextion/nextion_tft.cpp index 0474328650..9ebd783124 100644 --- a/Marlin/src/lcd/extui/nextion/nextion_tft.cpp +++ b/Marlin/src/lcd/extui/nextion/nextion_tft.cpp @@ -210,8 +210,8 @@ void NextionTFT::panelInfo(uint8_t req) { case 1: // Get SD Card list if (!isPrinting()) { - if (!isMediaInserted()) safe_delay(500); - if (!isMediaInserted()) { // Make sure the card is removed + if (!isMediaMounted()) safe_delay(500); + if (!isMediaMounted()) { // Make sure the card is removed //SEND_TXT("tmppage.M117", msg_no_sd_card); } else if (nextion_command[3] == 'S') diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 2ba01a694d..5c7246d4cd 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -20,9 +20,9 @@ * */ -/************** - * ui_api.cpp * - **************/ +/************************************* + * ui_api.cpp - Shared ExtUI methods * + *************************************/ /**************************************************************************** * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * @@ -106,7 +106,7 @@ #include "../../feature/host_actions.h" #endif -#if M600_PURGE_MORE_RESUMABLE +#if ENABLED(ADVANCED_PAUSE_FEATURE) #include "../../feature/pause.h" #endif @@ -343,7 +343,7 @@ namespace ExtUI { // This assumes the center is 0,0 #if ENABLED(DELTA) if (axis != Z) { - max = SQRT(sq(float(PRINTABLE_RADIUS)) - sq(current_position[Y - axis])); // (Y - axis) == the other axis + max = SQRT(FLOAT_SQ(PRINTABLE_RADIUS) - sq(current_position[Y - axis])); // (Y - axis) == the other axis min = -max; } #endif @@ -1116,10 +1116,39 @@ namespace ExtUI { } void setUserConfirmed() { TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); } - #if M600_PURGE_MORE_RESUMABLE + #if ENABLED(ADVANCED_PAUSE_FEATURE) void setPauseMenuResponse(PauseMenuResponse response) { pause_menu_response = response; } + PauseMode getPauseMode() { return pause_mode; } + PauseMessage pauseModeStatus = PAUSE_MESSAGE_STATUS; - PauseMode getPauseMode() { return pause_mode;} + + void stdOnPauseMode( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + if (mode != PAUSE_MODE_SAME) pause_mode = mode; + pauseModeStatus = message; + switch (message) { + case PAUSE_MESSAGE_PARKING: onUserConfirmRequired(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; + case PAUSE_MESSAGE_CHANGING: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; + case PAUSE_MESSAGE_UNLOAD: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; + case PAUSE_MESSAGE_WAITING: onUserConfirmRequired(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING)); break; + case PAUSE_MESSAGE_INSERT: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; + case PAUSE_MESSAGE_LOAD: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; + case PAUSE_MESSAGE_PURGE: onUserConfirmRequired( + GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE)) + ); + break; + case PAUSE_MESSAGE_RESUME: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; + case PAUSE_MESSAGE_HEAT: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); break; + case PAUSE_MESSAGE_HEATING: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; + case PAUSE_MESSAGE_OPTION: onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_OPTION_HEADER)); break; + case PAUSE_MESSAGE_STATUS: break; + default: break; + } + } + #endif void printFile(const char *filename) { @@ -1140,7 +1169,7 @@ namespace ExtUI { return isPrinting() && (isPrintingFromMediaPaused() || print_job_timer.isPaused()); } - bool isMediaInserted() { return TERN0(HAS_MEDIA, IS_SD_INSERTED()); } + bool isMediaMounted() { return TERN0(HAS_MEDIA, card.isMounted()); } // Pause/Resume/Stop are implemented in MarlinUI void pausePrint() { ui.pause_print(); } @@ -1225,18 +1254,33 @@ namespace ExtUI { } // namespace ExtUI -// At the moment we hook into MarlinUI methods, but this could be cleaned up in the future +// +// MarlinUI passthroughs to ExtUI +// +#if DISABLED(HAS_DWIN_E3V2) + void MarlinUI::init_lcd() { ExtUI::onStartup(); } -void MarlinUI::init_lcd() { ExtUI::onStartup(); } + void MarlinUI::update() { ExtUI::onIdle(); } -void MarlinUI::update() { ExtUI::onIdle(); } - -void MarlinUI::kill_screen(FSTR_P const error, FSTR_P const component) { - using namespace ExtUI; - if (!flags.printer_killed) { - flags.printer_killed = true; - onPrinterKilled(error, component); + void MarlinUI::kill_screen(FSTR_P const error, FSTR_P const component) { + using namespace ExtUI; + if (!flags.printer_killed) { + flags.printer_killed = true; + onPrinterKilled(error, component); + } } -} +#endif + +#if ENABLED(ADVANCED_PAUSE_FEATURE) + + void MarlinUI::pause_show_message( + const PauseMessage message, + const PauseMode mode/*=PAUSE_MODE_SAME*/, + const uint8_t extruder/*=active_extruder*/ + ) { + ExtUI::onPauseMode(message, mode, extruder); + } + +#endif #endif // EXTENSIBLE_UI diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 28c34bd08a..7065e21f8f 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -43,10 +43,13 @@ ****************************************************************************/ #include "../../inc/MarlinConfig.h" + #include "../marlinui.h" #include "../../gcode/gcode.h" +#include "../../module/temperature.h" -#if M600_PURGE_MORE_RESUMABLE +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #include "../../module/motion.h" #include "../../feature/pause.h" #endif @@ -56,25 +59,48 @@ namespace ExtUI { // in the EEPROM when the methods onStoreSettings and // onLoadSettings are called. - static constexpr size_t eeprom_data_size = 48; + #ifndef EXTUI_EEPROM_DATA_SIZE + #define EXTUI_EEPROM_DATA_SIZE 48 + #endif + static constexpr size_t eeprom_data_size = EXTUI_EEPROM_DATA_SIZE; enum axis_t : uint8_t { X, Y, Z, I, J, K, U, V, W, X2, Y2, Z2, Z3, Z4 }; enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5, E6, E7 }; enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER, COOLER }; enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 }; - enum result_t : uint8_t { PID_STARTED, PID_BAD_HEATER_ID, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE }; + #if HAS_PID_HEATING + enum pidresult_t : uint8_t { PID_STARTED, PID_BED_STARTED, PID_CHAMBER_STARTED, PID_BAD_HEATER_ID, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE }; + #endif + #if ENABLED(MPC_AUTOTUNE) + enum mpcresult_t : uint8_t { MPC_STARTED, MPC_TEMP_ERROR, MPC_INTERRUPTED, MPC_DONE }; + #endif constexpr uint8_t extruderCount = EXTRUDERS; constexpr uint8_t hotendCount = HOTENDS; constexpr uint8_t fanCount = FAN_COUNT; + inline const axis_t axis_to_axis_t(const AxisEnum a) { + switch (a) { + TERN_(HAS_X_AXIS, case X_AXIS:) + default: return X; + OPTCODE(HAS_Y_AXIS, case Y_AXIS: return Y) + OPTCODE(HAS_Z_AXIS, case Z_AXIS: return Z) + OPTCODE(HAS_I_AXIS, case I_AXIS: return I) + OPTCODE(HAS_J_AXIS, case J_AXIS: return J) + OPTCODE(HAS_K_AXIS, case K_AXIS: return K) + OPTCODE(HAS_U_AXIS, case U_AXIS: return U) + OPTCODE(HAS_V_AXIS, case V_AXIS: return V) + OPTCODE(HAS_W_AXIS, case W_AXIS: return W) + } + } + #if HAS_MESH typedef float bed_mesh_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; #endif /** * The Extensible UI API is a utility class that can be used to implement: - * - An LCD view that responds to standard events, e.g., onMediaInserted(...) + * - An LCD view that responds to standard events, e.g., onMediaMounted(...) * - An LCD that polls firmware states and settings in a standard manner. * (e.g., With tool indexes and extruder indexes). * - Standard hooks to send data to a serial-based controller. @@ -208,6 +234,9 @@ namespace ExtUI { bool getLevelingIsValid(); void onLevelingStart(); void onLevelingDone(); + #if ENABLED(PREHEAT_BEFORE_LEVELING) + celsius_t getLevelingBedTemp(); + #endif #if HAS_MESH // Mesh data, utilities, events bed_mesh_t& getMeshArray(); @@ -286,10 +315,9 @@ namespace ExtUI { bool awaitingUserConfirm(); void setUserConfirmed(); - #if M600_PURGE_MORE_RESUMABLE + #if ENABLED(ADVANCED_PAUSE_FEATURE) // "Purge More" has a control screen void setPauseMenuResponse(PauseMenuResponse); - extern PauseMessage pauseModeStatus; PauseMode getPauseMode(); #endif @@ -423,7 +451,7 @@ namespace ExtUI { * Media access routines * Use these to operate on files */ - bool isMediaInserted(); + bool isMediaMounted(); bool isPrintingFromMediaPaused(); bool isPrintingFromMedia(); bool isPrinting(); @@ -457,38 +485,76 @@ namespace ExtUI { */ void onStartup(); void onIdle(); - void onMediaInserted(); + + void onMediaMounted(); void onMediaError(); void onMediaRemoved(); - void onPlayTone(const uint16_t frequency, const uint16_t duration); + + void onHeatingError(const heater_id_t header_id); + void onMinTempError(const heater_id_t header_id); + void onMaxTempError(const heater_id_t header_id); + + void onPlayTone(const uint16_t frequency, const uint16_t duration=0); + void onPrinterKilled(FSTR_P const error, FSTR_P const component); void onSurviveInKilled(); + void onPrintTimerStarted(); void onPrintTimerPaused(); void onPrintTimerStopped(); void onPrintDone(); + void onFilamentRunout(const extruder_t extruder); + void onUserConfirmRequired(const char * const msg); void onUserConfirmRequired(FSTR_P const fstr); + + // For fancy LCDs include an icon ID, message, and translated button title + void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn); + void onUserConfirmRequired(const int icon, FSTR_P const fstr, FSTR_P const fBtn); + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + // Standard stdOnPauseMode sets pauseModeStatus and calls onUserConfirmRequired + extern PauseMessage pauseModeStatus; + void stdOnPauseMode(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder); + void onPauseMode(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder); + #endif + void onStatusChanged(const char * const msg); void onStatusChanged(FSTR_P const fstr); + void onHomingStart(); void onHomingDone(); + void onSteppersDisabled(); void onSteppersEnabled(); + void onAxisDisabled(const axis_t axis); + void onAxisEnabled(const axis_t axis); + void onFactoryReset(); void onStoreSettings(char *); void onLoadSettings(const char *); void onPostprocessSettings(); void onSettingsStored(const bool success); void onSettingsLoaded(const bool success); + + #if ENABLED(PREVENT_COLD_EXTRUSION) + void onSetMinExtrusionTemp(const celsius_t t); + #endif #if ENABLED(POWER_LOSS_RECOVERY) void onSetPowerLoss(const bool onoff); void onPowerLoss(); void onPowerLossResume(); #endif #if HAS_PID_HEATING - void onPidTuning(const result_t rst); + void onPIDTuning(const pidresult_t rst); + void onStartM303(const int count, const heater_id_t hid, const celsius_t temp); + #endif + #if ENABLED(MPC_AUTOTUNE) + void onMPCTuning(const mpcresult_t rst); + #endif + #if ENABLED(PLATFORM_M997_SUPPORT) + void onFirmwareFlash(); #endif }; diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 037beb2b3c..828a44bf52 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -85,9 +85,9 @@ namespace LanguageNarrow_de { LSTR MSG_LEVEL_BED_DONE = _UxGT("Nivellieren fertig!"); LSTR MSG_Z_FADE_HEIGHT = _UxGT("Ausblendhöhe"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Setze Homeversatz"); - 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_X = _UxGT("Homeversatz X"); // DWIN + LSTR MSG_HOME_OFFSET_Y = _UxGT("Homeversatz Y"); // DWIN + LSTR MSG_HOME_OFFSET_Z = _UxGT("Homeversatz Z"); // DWIN LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Homeversatz aktiv"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Assistent"); LSTR MSG_SELECT_ORIGIN = _UxGT("Wählen Sie Ursprung"); @@ -328,7 +328,6 @@ namespace LanguageNarrow_de { LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("PID Autotune fehlge.!"); LSTR MSG_BAD_HEATER_ID = _UxGT("ungültiger Extruder."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temperatur zu hoch."); - LSTR MSG_TIMEOUT = _UxGT("Timeout"); LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Autotune fehlge.! Ungültiger Extruder"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune fehlge.! Temperatur zu hoch."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune fehlge.! Timeout."); @@ -591,30 +590,30 @@ namespace LanguageNarrow_de { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Helligkeit"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Falscher Drucker"); - LSTR MSG_COLORS_GET = _UxGT("Farbe"); - LSTR MSG_COLORS_SELECT = _UxGT("Farben auswählen"); - LSTR MSG_COLORS_APPLIED = _UxGT("Farben verwenden"); - LSTR MSG_COLORS_RED = _UxGT("Rot"); - LSTR MSG_COLORS_GREEN = _UxGT("Grün"); - LSTR MSG_COLORS_BLUE = _UxGT("Blau"); - LSTR MSG_COLORS_WHITE = _UxGT("Weiß"); - LSTR MSG_UI_LANGUAGE = _UxGT("UI Sprache"); - LSTR MSG_SOUND_ENABLE = _UxGT("Ton aktivieren"); - LSTR MSG_LOCKSCREEN = _UxGT("Bildschirm sperren"); - LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Drucker ist gesperrt,"); - LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Scrollen zum Entsper."); + LSTR MSG_COLORS_GET = _UxGT("Farbe"); // ProUI + LSTR MSG_COLORS_SELECT = _UxGT("Farben auswählen"); // ProUI + LSTR MSG_COLORS_APPLIED = _UxGT("Farben verwenden"); // ProUI + LSTR MSG_COLORS_RED = _UxGT("Rot"); // ProUI / JyersUI + LSTR MSG_COLORS_GREEN = _UxGT("Grün"); // ProUI / JyersUI + LSTR MSG_COLORS_BLUE = _UxGT("Blau"); // ProUI / JyersUI + LSTR MSG_COLORS_WHITE = _UxGT("Weiß"); // ProUI + LSTR MSG_UI_LANGUAGE = _UxGT("UI Sprache"); // ProUI + LSTR MSG_SOUND_ENABLE = _UxGT("Ton aktivieren"); // ProUI + LSTR MSG_LOCKSCREEN = _UxGT("Bildschirm sperren"); // ProUI + LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Drucker ist gesperrt,"); // ProUI + LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Scrollen zum Entsper."); // ProUI + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Auf Neustart warten"); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Bitte vorheizen"); // ProUI - LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Auf Neustart warten"); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Bitte vorheizen"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Drucke"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Komplette"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Gesamte"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Längste"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Extrud."); - LSTR MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); LSTR MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); LSTR MSG_INFO_PSU = _UxGT("Netzteil"); + LSTR MSG_DRIVE_STRENGTH = _UxGT("Motorleistung"); LSTR MSG_DAC_PERCENT_N = _UxGT("@ Treiber %"); LSTR MSG_ERROR_TMC = _UxGT("TMC Verbindungsfehler"); @@ -626,14 +625,11 @@ namespace LanguageNarrow_de { LSTR MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("FORTS. OPTIONEN:"); LSTR MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Mehr entladen"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Druck weiter"); - LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Löschen o. fortfah.?"); + LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Löschen o. fortfah.?"); // ProUI LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Düse: "); LSTR MSG_RUNOUT_SENSOR = _UxGT("Runout-Sensor"); LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Runout-Weg mm"); - LSTR MSG_RUNOUT_ENABLE = _UxGT("Runout aktivieren"); - LSTR MSG_RUNOUT_ACTIVE = _UxGT("Runout aktiv"); - LSTR MSG_INVERT_EXTRUDER = _UxGT("Invert Extruder"); - LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Extruder Min Temp."); + LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Extruder Min Temp."); // ProUI LSTR MSG_FANCHECK = _UxGT("Lüftergeschw. prüfen"); LSTR MSG_KILL_HOMING_FAILED = _UxGT("Homing gescheitert"); LSTR MSG_LCD_PROBING_FAILED = _UxGT("Probing gescheitert"); @@ -765,10 +761,10 @@ namespace LanguageNarrow_de { namespace LanguageWide_de { using namespace LanguageNarrow_de; #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 - LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Kein Medium eingelegt."); - LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Bitte auf Neustart warten."); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Bitte das Hotend vorheizen."); - LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Druckzähler zurücksetzen"); + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Kein Medium eingelegt."); // ProUI + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Bitte auf Neustart warten."); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Bitte das Hotend vorheizen."); // ProUI + LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Druckzähler zurücksetzen"); // ProUI LSTR MSG_INFO_PRINT_COUNT = _UxGT("Gesamte Drucke"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Komplette Drucke"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Gesamte Druckzeit"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 6ccb76de43..f30b29dd4e 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -109,9 +109,9 @@ namespace LanguageNarrow_en { LSTR MSG_LEVEL_BED_DONE = _UxGT("Leveling Done!"); LSTR MSG_Z_FADE_HEIGHT = _UxGT("Fade Height"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Set Home Offsets"); - 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_X = _UxGT("Home Offset X"); // DWIN + LSTR MSG_HOME_OFFSET_Y = _UxGT("Home Offset Y"); // DWIN + LSTR MSG_HOME_OFFSET_Z = _UxGT("Home Offset Z"); // DWIN LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets Applied"); LSTR MSG_ERR_M428_TOO_FAR = _UxGT("MIN/MAX Too Far"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Wizard"); @@ -155,8 +155,7 @@ namespace LanguageNarrow_en { LSTR MSG_SPINDLE_REVERSE = _UxGT("Spindle Reverse"); LSTR MSG_SWITCH_PS_ON = _UxGT("Switch Power On"); LSTR MSG_SWITCH_PS_OFF = _UxGT("Switch Power Off"); - LSTR PS_ON_EDM_FAIL = _UxGT("PS_ON EDM Fault"); - LSTR PS_ON1_EDM_FAIL = _UxGT("PS_ON1 EDM Fault"); + LSTR MSG_POWER_EDM_FAULT = _UxGT("Power EDM Fault"); LSTR MSG_EXTRUDE = _UxGT("Extrude"); LSTR MSG_RETRACT = _UxGT("Retract"); LSTR MSG_MOVE_AXIS = _UxGT("Move Axis"); @@ -351,19 +350,32 @@ namespace LanguageNarrow_en { LSTR MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); LSTR MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); LSTR MSG_AUTOTEMP = _UxGT("Autotemp"); + LSTR MSG_TIMEOUT = _UxGT("Timeout"); LSTR MSG_LCD_ON = _UxGT("On"); LSTR MSG_LCD_OFF = _UxGT("Off"); + LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("Autotune * PID"); LSTR MSG_PID_CYCLE = _UxGT("PID Cycles"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Autotune failed!"); + + LSTR MSG_PID_FOR_NOZZLE = _UxGT("for Nozzle is running."); + LSTR MSG_PID_FOR_BED = _UxGT("for BED is running."); + LSTR MSG_PID_FOR_CHAMBER = _UxGT("for CHAMBER is running."); + + LSTR MSG_TEMP_NOZZLE = _UxGT("Nozzle Temperature"); + LSTR MSG_TEMP_BED = _UxGT("Bed Temperature"); + LSTR MSG_TEMP_CHAMBER = _UxGT("Chamber Temperature"); + LSTR MSG_BAD_HEATER_ID = _UxGT("Bad extruder."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temperature too high."); - LSTR MSG_TIMEOUT = _UxGT("Timeout"); + LSTR MSG_TEMP_TOO_LOW = _UxGT("Temperature too low"); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Autotune failed! Bad extruder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Autotune failed! Temperature too high."); LSTR MSG_PID_TIMEOUT = _UxGT("Autotune failed! Timeout."); + LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Testing heat loss"); LSTR MSG_MPC_HEATING_PAST_200 = _UxGT("Heating to >200C"); LSTR MSG_MPC_COOLING_TO_AMBIENT = _UxGT("Cooling to ambient"); @@ -379,6 +391,7 @@ namespace LanguageNarrow_en { LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ambient Co. *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN = _UxGT("Fan coeff."); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Fan coeff. *"); + LSTR MSG_SELECT_E = _UxGT("Select *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); @@ -412,12 +425,12 @@ namespace LanguageNarrow_en { LSTR MSG_SHAPING_DISABLE = _UxGT("Disable @ shaping"); LSTR MSG_SHAPING_FREQ = _UxGT("@ frequency"); LSTR MSG_SHAPING_ZETA = _UxGT("@ damping"); - LSTR MSG_SHAPING_A_FREQ = STR_A _UxGT(" frequency"); - LSTR MSG_SHAPING_B_FREQ = STR_B _UxGT(" frequency"); - LSTR MSG_SHAPING_A_ZETA = STR_A _UxGT(" damping "); - LSTR MSG_SHAPING_B_ZETA = STR_B _UxGT(" damping "); - LSTR MSG_SHAPING_X_ENABLE = _UxGT("Enable X shaping"); - LSTR MSG_SHAPING_Y_ENABLE = _UxGT("Enable Y shaping"); + LSTR MSG_SHAPING_A_FREQ = STR_A _UxGT(" frequency"); // ProUI + LSTR MSG_SHAPING_B_FREQ = STR_B _UxGT(" frequency"); // ProUI + LSTR MSG_SHAPING_C_FREQ = STR_C _UxGT(" frequency"); // ProUI + LSTR MSG_SHAPING_A_ZETA = STR_A _UxGT(" damping"); // ProUI + LSTR MSG_SHAPING_B_ZETA = STR_B _UxGT(" damping"); // ProUI + LSTR MSG_SHAPING_C_ZETA = STR_C _UxGT(" damping"); // ProUI LSTR MSG_XY_FREQUENCY_LIMIT = _UxGT("XY Freq Limit"); LSTR MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Min FR Factor"); LSTR MSG_STEPS_PER_MM = _UxGT("Steps/mm"); @@ -666,31 +679,31 @@ namespace LanguageNarrow_en { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Light Brightness"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("INCORRECT PRINTER"); - LSTR MSG_COLORS_GET = _UxGT("Get Color"); - LSTR MSG_COLORS_SELECT = _UxGT("Select Colors"); - LSTR MSG_COLORS_APPLIED = _UxGT("Colors applied"); - LSTR MSG_COLORS_RED = _UxGT("Red"); - LSTR MSG_COLORS_GREEN = _UxGT("Green"); - LSTR MSG_COLORS_BLUE = _UxGT("Blue"); - LSTR MSG_COLORS_WHITE = _UxGT("White"); - LSTR MSG_UI_LANGUAGE = _UxGT("UI Language"); - LSTR MSG_SOUND_ENABLE = _UxGT("Enable sound"); - LSTR MSG_LOCKSCREEN = _UxGT("Lock Screen"); - LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Printer is Locked,"); - LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Scroll to unlock."); - LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Please wait until reboot."); + LSTR MSG_COLORS_GET = _UxGT("Get Color"); // ProUI + LSTR MSG_COLORS_SELECT = _UxGT("Select Colors"); // ProUI + LSTR MSG_COLORS_APPLIED = _UxGT("Colors applied"); // ProUI + LSTR MSG_COLORS_RED = _UxGT("Red"); // ProUI / JyersUI + LSTR MSG_COLORS_GREEN = _UxGT("Green"); // ProUI / JyersUI + LSTR MSG_COLORS_BLUE = _UxGT("Blue"); // ProUI / JyersUI + LSTR MSG_COLORS_WHITE = _UxGT("White"); // ProUI + LSTR MSG_UI_LANGUAGE = _UxGT("UI Language"); // ProUI + LSTR MSG_SOUND_ENABLE = _UxGT("Enable sound"); // ProUI + LSTR MSG_LOCKSCREEN = _UxGT("Lock Screen"); // ProUI + LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Printer is Locked,"); // ProUI + LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Scroll to unlock."); // ProUI + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Please wait for reboot."); // ProUI + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No Media"); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Please Preheat"); // ProUI - LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No Media"); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Please Preheat"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Prints"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Total"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Longest"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Extruded"); - LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completed"); LSTR MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); 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_N = _UxGT("@ Driver %"); LSTR MSG_ERROR_TMC = _UxGT("TMC CONNECTION ERROR"); @@ -702,14 +715,11 @@ namespace LanguageNarrow_en { LSTR MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("RESUME OPTIONS:"); LSTR MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Purge more"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Continue"); - LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Purge or Continue?"); + LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Purge or Continue?"); // ProUI LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozzle: "); LSTR MSG_RUNOUT_SENSOR = _UxGT("Runout Sensor"); LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Runout Dist mm"); - LSTR MSG_RUNOUT_ENABLE = _UxGT("Enable Runout"); - LSTR MSG_RUNOUT_ACTIVE = _UxGT("Runout Active"); - LSTR MSG_INVERT_EXTRUDER = _UxGT("Invert Extruder"); - LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Extruder Min Temp."); + LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Extruder Min Temp."); // ProUI LSTR MSG_FANCHECK = _UxGT("Fan Tacho Check"); LSTR MSG_KILL_HOMING_FAILED = _UxGT("Homing Failed"); LSTR MSG_LCD_PROBING_FAILED = _UxGT("Probing Failed"); @@ -837,7 +847,7 @@ namespace LanguageNarrow_en { LSTR MSG_XATC = _UxGT("X-Twist Wizard"); LSTR MSG_XATC_DONE = _UxGT("X-Twist Wizard Done!"); - LSTR MSG_XATC_UPDATE_Z_OFFSET = _UxGT("Update Probe Z-Offset to "); + LSTR MSG_XATC_UPDATE_Z_OFFSET = _UxGT("Update Z-Offset to "); LSTR MSG_SOUND = _UxGT("Sound"); @@ -877,7 +887,6 @@ namespace LanguageNarrow_en { LSTR DGUS_MSG_NOT_WHILE_PRINTING = _UxGT("Not allowed during print"); LSTR DGUS_MSG_NOT_WHILE_IDLE = _UxGT("Not allowed while idle"); LSTR DGUS_MSG_NO_FILE_SELECTED = _UxGT("No file selected"); - LSTR DGUS_MSG_TEMP_TOO_LOW = _UxGT("Temperature too low"); LSTR DGUS_MSG_EXECUTING_COMMAND = _UxGT("Executing command..."); LSTR DGUS_MSG_BED_PID_DISABLED = _UxGT("Bed PID disabled"); LSTR DGUS_MSG_PID_DISABLED = _UxGT("PID disabled"); @@ -909,9 +918,9 @@ namespace LanguageWide_en { LSTR MSG_MEDIA_MENU = _UxGT("Select from ") MEDIA_TYPE_EN; LSTR MSG_TURN_OFF = _UxGT("Turn off the printer"); LSTR MSG_END_LOOPS = _UxGT("End Repeat Loops"); - LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No media inserted."); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Please preheat the hot end."); - LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Reset Print Count"); + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No media inserted."); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Please preheat the hot end."); // ProUI + LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Reset Print Count"); // ProUI LSTR MSG_INFO_PRINT_COUNT = _UxGT("Print Count"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Print Time"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Longest Job Time"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 0ac8f71d58..029e9744a0 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -69,9 +69,9 @@ namespace LanguageNarrow_fr { LSTR MSG_LEVEL_BED_DONE = _UxGT("Mise à niveau OK!"); LSTR MSG_Z_FADE_HEIGHT = _UxGT("Hauteur lissée"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Régl. décal origine"); - 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_X = _UxGT("Décal. origine X"); // DWIN + LSTR MSG_HOME_OFFSET_Y = _UxGT("Décal. origine Y"); // DWIN + LSTR MSG_HOME_OFFSET_Z = _UxGT("Décal. origine Z"); // DWIN 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 @@ -255,12 +255,16 @@ namespace LanguageNarrow_fr { LSTR MSG_AUTOTEMP = _UxGT("Temp. Auto."); LSTR MSG_LCD_ON = _UxGT("Marche"); LSTR MSG_LCD_OFF = _UxGT("Arrêt"); + LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Tuning PID terminé"); LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Echec Autotune! E incorrect"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Echec Autotune! Temp. trop haute"); LSTR MSG_PID_TIMEOUT = _UxGT("Echec Autotune! Opér. expirée"); + + LSTR MSG_TEMP_TOO_LOW = _UxGT("Temperature trop basse"); + LSTR MSG_SELECT_E = _UxGT("Sélectionner *"); LSTR MSG_ACC = _UxGT("Accélération"); LSTR MSG_JERK = _UxGT("Jerk"); @@ -596,7 +600,6 @@ namespace LanguageNarrow_fr { LSTR DGUS_MSG_NOT_WHILE_PRINTING = _UxGT("Impossible pendant une impression"); LSTR DGUS_MSG_NOT_WHILE_IDLE = _UxGT("Impossible tant que l'imprimante est en attente"); LSTR DGUS_MSG_NO_FILE_SELECTED = _UxGT("Aucun fichier selectionne"); - LSTR DGUS_MSG_TEMP_TOO_LOW = _UxGT("Temperature trop basse"); LSTR DGUS_MSG_EXECUTING_COMMAND = _UxGT("Execution de la commande..."); LSTR DGUS_MSG_BED_PID_DISABLED = _UxGT("Bed PID desactive"); LSTR DGUS_MSG_PID_DISABLED = _UxGT("PID desactive"); diff --git a/Marlin/src/lcd/language/language_fr_na.h b/Marlin/src/lcd/language/language_fr_na.h index 5573755503..8fb7b68026 100644 --- a/Marlin/src/lcd/language/language_fr_na.h +++ b/Marlin/src/lcd/language/language_fr_na.h @@ -69,9 +69,9 @@ namespace LanguageNarrow_fr_na { LSTR MSG_LEVEL_BED_DONE = _UxGT("Mise a niveau OK!"); LSTR MSG_Z_FADE_HEIGHT = _UxGT("Hauteur lissee"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Regl. decal origine"); - LSTR MSG_HOME_OFFSET_X = _UxGT("Decal. origine X"); - LSTR MSG_HOME_OFFSET_Y = _UxGT("Decal. origine Y"); - LSTR MSG_HOME_OFFSET_Z = _UxGT("Decal. origine Z"); + LSTR MSG_HOME_OFFSET_X = _UxGT("Decal. origine X"); // DWIN + LSTR MSG_HOME_OFFSET_Y = _UxGT("Decal. origine Y"); // DWIN + LSTR MSG_HOME_OFFSET_Z = _UxGT("Decal. origine Z"); // DWIN LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Decalages appliques"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Assistant Molettes"); LSTR MSG_SELECT_ORIGIN = _UxGT("Molette du lit"); // Not a selection of the origin @@ -255,12 +255,16 @@ namespace LanguageNarrow_fr_na { LSTR MSG_AUTOTEMP = _UxGT("Temp. Auto."); LSTR MSG_LCD_ON = _UxGT("Marche"); LSTR MSG_LCD_OFF = _UxGT("Arret"); + LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("Tuning PID termine"); LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Echec Autotune! E incorrect"); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Echec Autotune! Temp. trop haute"); LSTR MSG_PID_TIMEOUT = _UxGT("Echec Autotune! Oper. expiree"); + + LSTR MSG_TEMP_TOO_LOW = _UxGT("Temperature trop basse"); + LSTR MSG_SELECT_E = _UxGT("Selectionner *"); LSTR MSG_ACC = _UxGT("Acceleration"); LSTR MSG_JERK = _UxGT("Jerk"); @@ -599,7 +603,6 @@ namespace LanguageNarrow_fr_na { LSTR DGUS_MSG_NOT_WHILE_PRINTING = _UxGT("Impossible pendant une impression"); LSTR DGUS_MSG_NOT_WHILE_IDLE = _UxGT("Impossible tant que l'imprimante est en attente"); LSTR DGUS_MSG_NO_FILE_SELECTED = _UxGT("Aucun fichier selectionne"); - LSTR DGUS_MSG_TEMP_TOO_LOW = _UxGT("Temperature trop basse"); LSTR DGUS_MSG_EXECUTING_COMMAND = _UxGT("Execution de la commande..."); LSTR DGUS_MSG_BED_PID_DISABLED = _UxGT("Bed PID desactive"); LSTR DGUS_MSG_PID_DISABLED = _UxGT("PID desactive"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 9153df7186..f7e98ff8e5 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -76,9 +76,9 @@ namespace LanguageNarrow_hu { LSTR MSG_LEVEL_BED_DONE = _UxGT("Szintezés kész!"); LSTR MSG_Z_FADE_HEIGHT = _UxGT("Szint csökkentés"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Kezdöpont eltolás"); - 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_X = _UxGT("X Kezdö eltol."); // DWIN + LSTR MSG_HOME_OFFSET_Y = _UxGT("Y Kezdö eltol."); // DWIN + LSTR MSG_HOME_OFFSET_Z = _UxGT("Z Kezdö eltol."); // DWIN 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"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index a1c0dda9d9..d9c83ed415 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -65,18 +65,18 @@ namespace LanguageNarrow_it { LSTR MSG_MEDIA_UPDATE = _UxGT("Aggiorna ") MEDIA_TYPE_IT; LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Overflow sottochiamate"); LSTR MSG_LCD_ENDSTOPS = _UxGT("Finecor."); // Max 8 characters - LSTR MSG_LCD_SOFT_ENDSTOPS = _UxGT("Finecorsa Soft"); + LSTR MSG_LCD_SOFT_ENDSTOPS = _UxGT("Finecorsa soft"); LSTR MSG_MAIN_MENU = _UxGT("Menu principale"); LSTR MSG_ADVANCED_SETTINGS = _UxGT("Impostaz. avanzate"); LSTR MSG_CONFIGURATION = _UxGT("Configurazione"); LSTR MSG_RUN_AUTO_FILES = _UxGT("Esegui files auto"); - LSTR MSG_DISABLE_STEPPERS = _UxGT("Disabilita Motori"); + LSTR MSG_DISABLE_STEPPERS = _UxGT("Disabilita motori"); LSTR MSG_DEBUG_MENU = _UxGT("Menu di debug"); LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Test barra avanzam."); - LSTR MSG_ENDSTOP_TEST = _UxGT("Test Finecorsa"); + LSTR MSG_ENDSTOP_TEST = _UxGT("Test finecorsa"); LSTR MSG_Z_PROBE = _UxGT("Sonda Z"); LSTR MSG_HOMING = _UxGT("Azzeramento"); - LSTR MSG_AUTO_HOME = _UxGT("Auto Home"); + LSTR MSG_AUTO_HOME = _UxGT("Auto home"); LSTR MSG_AUTO_HOME_A = _UxGT("Home @"); LSTR MSG_AUTO_HOME_X = _UxGT("Home X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Home Y"); @@ -85,13 +85,13 @@ namespace LanguageNarrow_it { LSTR MSG_FILAMENT_SET = _UxGT("Impostaz.filamento"); LSTR MSG_FILAMENT_MAN = _UxGT("Gestione filamento"); LSTR MSG_MANUAL_LEVELING = _UxGT("Livel.manuale"); - LSTR MSG_TRAM_FL = _UxGT("Davanti Sinistra"); - LSTR MSG_TRAM_FR = _UxGT("Davanti Destra"); + LSTR MSG_TRAM_FL = _UxGT("Davanti sinistra"); + LSTR MSG_TRAM_FR = _UxGT("Davanti destra"); LSTR MSG_TRAM_C = _UxGT("Centro"); - LSTR MSG_TRAM_BL = _UxGT("Dietro Sinistra"); - LSTR MSG_TRAM_BR = _UxGT("Dietro Destra"); - LSTR MSG_MANUAL_MESH = _UxGT("Mesh Manuale"); - LSTR MSG_AUTO_MESH = _UxGT("Generaz.Autom.Mesh"); + LSTR MSG_TRAM_BL = _UxGT("Dietro sinistra"); + LSTR MSG_TRAM_BR = _UxGT("Dietro destra"); + LSTR MSG_MANUAL_MESH = _UxGT("Mesh manuale"); + LSTR MSG_AUTO_MESH = _UxGT("Generaz.autom.mesh"); LSTR MSG_AUTO_Z_ALIGN = _UxGT("Allineam.automat. Z"); LSTR MSG_ITERATION = _UxGT("Iterazione G34: %i"); LSTR MSG_DECREASING_ACCURACY = _UxGT("Precisione in calo!"); @@ -100,11 +100,11 @@ namespace LanguageNarrow_it { LSTR MSG_LEVEL_BED_WAITING = _UxGT("Premi per iniziare"); LSTR MSG_LEVEL_BED_NEXT_POINT = _UxGT("Punto successivo"); LSTR MSG_LEVEL_BED_DONE = _UxGT("Livel. terminato!"); - LSTR MSG_Z_FADE_HEIGHT = _UxGT("Fade Height"); + LSTR MSG_Z_FADE_HEIGHT = _UxGT("Dissolvi altezza"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Imp. offset home"); - 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_X = _UxGT("Offset home X"); // DWIN + LSTR MSG_HOME_OFFSET_Y = _UxGT("Offset home Y"); // DWIN + LSTR MSG_HOME_OFFSET_Z = _UxGT("Offset home Z"); // DWIN LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offset applicato"); LSTR MSG_ERR_M428_TOO_FAR = _UxGT("Err: Troppo lontano!"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Wizard Tramming"); @@ -113,21 +113,21 @@ namespace LanguageNarrow_it { LSTR MSG_PREHEAT_1 = _UxGT("Preriscalda ") PREHEAT_1_LABEL; LSTR MSG_PREHEAT_1_H = _UxGT("Preriscalda ") PREHEAT_1_LABEL " ~"; - LSTR MSG_PREHEAT_1_END = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Ugello"); - LSTR MSG_PREHEAT_1_END_E = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Ugello ~"); - LSTR MSG_PREHEAT_1_ALL = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Tutto"); - LSTR MSG_PREHEAT_1_BEDONLY = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" Piatto"); + LSTR MSG_PREHEAT_1_END = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" ugello"); + LSTR MSG_PREHEAT_1_END_E = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" ugello ~"); + LSTR MSG_PREHEAT_1_ALL = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" tutto"); + LSTR MSG_PREHEAT_1_BEDONLY = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" piatto"); LSTR MSG_PREHEAT_1_SETTINGS = _UxGT("Preris.") PREHEAT_1_LABEL _UxGT(" conf"); LSTR MSG_PREHEAT_M = _UxGT("Preriscalda $"); LSTR MSG_PREHEAT_M_H = _UxGT("Preriscalda $ ~"); - LSTR MSG_PREHEAT_M_END = _UxGT("Preris.$ Ugello"); - LSTR MSG_PREHEAT_M_END_E = _UxGT("Preris.$ Ugello ~"); - LSTR MSG_PREHEAT_M_ALL = _UxGT("Preris.$ Tutto"); - LSTR MSG_PREHEAT_M_BEDONLY = _UxGT("Preris.$ Piatto"); + LSTR MSG_PREHEAT_M_END = _UxGT("Preris.$ ugello"); + LSTR MSG_PREHEAT_M_END_E = _UxGT("Preris.$ ugello ~"); + LSTR MSG_PREHEAT_M_ALL = _UxGT("Preris.$ tutto"); + LSTR MSG_PREHEAT_M_BEDONLY = _UxGT("Preris.$ piatto"); LSTR MSG_PREHEAT_M_SETTINGS = _UxGT("Preris.$ conf"); - LSTR MSG_PREHEAT_HOTEND = _UxGT("Prerisc.Hotend"); + LSTR MSG_PREHEAT_HOTEND = _UxGT("Prerisc.ugello"); LSTR MSG_PREHEAT_CUSTOM = _UxGT("Prerisc.personal."); LSTR MSG_COOLDOWN = _UxGT("Raffredda"); @@ -136,7 +136,7 @@ namespace LanguageNarrow_it { LSTR MSG_SPINDLE_MENU = _UxGT("Controllo mandrino"); LSTR MSG_LASER_POWER = _UxGT("Potenza laser"); LSTR MSG_SPINDLE_POWER = _UxGT("Potenza mandrino"); - LSTR MSG_LASER_TOGGLE = _UxGT("Alterna Laser"); + LSTR MSG_LASER_TOGGLE = _UxGT("Alterna laser"); LSTR MSG_LASER_EVAC_TOGGLE = _UxGT("Alterna soffiatore"); LSTR MSG_LASER_ASSIST_TOGGLE = _UxGT("Alterna aria supp."); LSTR MSG_LASER_PULSE_MS = _UxGT("ms impulso di test"); @@ -150,27 +150,27 @@ namespace LanguageNarrow_it { LSTR MSG_SWITCH_PS_OFF = _UxGT("Spegni aliment."); LSTR MSG_EXTRUDE = _UxGT("Estrudi"); LSTR MSG_RETRACT = _UxGT("Ritrai"); - LSTR MSG_MOVE_AXIS = _UxGT("Muovi Asse"); - LSTR MSG_BED_LEVELING = _UxGT("Livella piano"); - LSTR MSG_LEVEL_BED = _UxGT("Livella piano"); - LSTR MSG_BED_TRAMMING = _UxGT("Tarat.fine piano"); - LSTR MSG_BED_TRAMMING_MANUAL = _UxGT("Tarat.fine Manuale"); - LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Regola la vite finché la sonda non rileva il piano."); - LSTR MSG_BED_TRAMMING_IN_RANGE = _UxGT("Tolleranza raggiunta su tutti gli angoli. Piano livellato!"); + LSTR MSG_MOVE_AXIS = _UxGT("Muovi asse"); + LSTR MSG_BED_LEVELING = _UxGT("Livellamento piatto"); + LSTR MSG_LEVEL_BED = _UxGT("Livella piatto"); + LSTR MSG_BED_TRAMMING = _UxGT("Tarat.fine piatto"); + LSTR MSG_BED_TRAMMING_MANUAL = _UxGT("Tarat.fine manuale"); + LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Regola la vite finché la sonda non rileva il piatto."); + LSTR MSG_BED_TRAMMING_IN_RANGE = _UxGT("Tolleranza raggiunta su tutti gli angoli. Piatto livellato!"); LSTR MSG_BED_TRAMMING_GOOD_POINTS = _UxGT("Punti buoni: "); LSTR MSG_BED_TRAMMING_LAST_Z = _UxGT("Ultimo Z: "); LSTR MSG_NEXT_CORNER = _UxGT("Prossimo punto"); - LSTR MSG_MESH_EDITOR = _UxGT("Editor Mesh"); - LSTR MSG_MESH_VIEWER = _UxGT("Visualiz. Mesh"); - LSTR MSG_EDIT_MESH = _UxGT("Modifica Mesh"); - LSTR MSG_MESH_VIEW = _UxGT("Visualizza Mesh"); - LSTR MSG_EDITING_STOPPED = _UxGT("Modif. Mesh Fermata"); + LSTR MSG_MESH_EDITOR = _UxGT("Editor mesh"); + LSTR MSG_MESH_VIEWER = _UxGT("Visualiz. mesh"); + LSTR MSG_EDIT_MESH = _UxGT("Modifica mesh"); + LSTR MSG_MESH_VIEW = _UxGT("Visualizza mesh"); + LSTR MSG_EDITING_STOPPED = _UxGT("Modif. mesh fermata"); LSTR MSG_NO_VALID_MESH = _UxGT("Mesh non valida"); LSTR MSG_ACTIVATE_MESH = _UxGT("Attiva livellamento"); LSTR MSG_PROBING_POINT = _UxGT("Punto sondato"); LSTR MSG_MESH_X = _UxGT("Indice X"); LSTR MSG_MESH_Y = _UxGT("Indice Y"); - LSTR MSG_MESH_INSET = _UxGT("Mesh Inset"); + LSTR MSG_MESH_INSET = _UxGT("Mesh inset"); LSTR MSG_MESH_MIN_X = _UxGT("Mesh X minimo"); LSTR MSG_MESH_MAX_X = _UxGT("Mesh X massimo"); LSTR MSG_MESH_MIN_Y = _UxGT("Mesh Y minimo"); @@ -186,7 +186,7 @@ namespace LanguageNarrow_it { LSTR MSG_M48_OUT_OF_BOUNDS = _UxGT("Sonda oltre i limiti"); LSTR MSG_M48_DEVIATION = _UxGT("Deviazione"); LSTR MSG_IDEX_MENU = _UxGT("Modo IDEX"); - LSTR MSG_OFFSETS_MENU = _UxGT("Strumenti Offsets"); + LSTR MSG_OFFSETS_MENU = _UxGT("Strumenti offsets"); LSTR MSG_IDEX_MODE_AUTOPARK = _UxGT("Auto-Park"); LSTR MSG_IDEX_MODE_DUPLICATE = _UxGT("Duplicazione"); LSTR MSG_IDEX_MODE_MIRRORED_COPY = _UxGT("Copia speculare"); @@ -197,10 +197,10 @@ namespace LanguageNarrow_it { LSTR MSG_UBL_DOING_G29 = _UxGT("G29 in corso"); LSTR MSG_UBL_TOOLS = _UxGT("Strumenti UBL"); LSTR MSG_LCD_TILTING_MESH = _UxGT("Punto inclinaz."); - LSTR MSG_UBL_TILT_MESH = _UxGT("Inclina Mesh"); + LSTR MSG_UBL_TILT_MESH = _UxGT("Inclina mesh"); LSTR MSG_UBL_TILTING_GRID = _UxGT("Dim.griglia inclin."); LSTR MSG_UBL_MESH_TILTED = _UxGT("Mesh inclinata"); - LSTR MSG_UBL_MANUAL_MESH = _UxGT("Mesh Manuale"); + LSTR MSG_UBL_MANUAL_MESH = _UxGT("Mesh manuale"); LSTR MSG_UBL_MESH_WIZARD = _UxGT("Creaz.guid.mesh UBL"); LSTR MSG_UBL_BC_INSERT = _UxGT("Metti spes. e misura"); LSTR MSG_UBL_BC_INSERT2 = _UxGT("Misura"); @@ -208,57 +208,57 @@ namespace LanguageNarrow_it { LSTR MSG_UBL_MOVING_TO_NEXT = _UxGT("Spostamento succes."); LSTR MSG_UBL_ACTIVATE_MESH = _UxGT("Attiva UBL"); LSTR MSG_UBL_DEACTIVATE_MESH = _UxGT("Disattiva UBL"); - LSTR MSG_UBL_SET_TEMP_BED = _UxGT("Temp. Piatto"); - LSTR MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Temp. Piatto"); - LSTR MSG_UBL_SET_TEMP_HOTEND = _UxGT("Temp. Ugello"); - LSTR MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Temp. Ugello"); - LSTR MSG_UBL_MESH_EDIT = _UxGT("Modifica Mesh"); - LSTR MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Modif.Mesh personal."); - LSTR MSG_UBL_FINE_TUNE_MESH = _UxGT("Ritocca Mesh"); - LSTR MSG_UBL_DONE_EDITING_MESH = _UxGT("Modif.Mesh fatta"); - LSTR MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Crea Mesh personal."); - LSTR MSG_UBL_BUILD_MESH_MENU = _UxGT("Crea Mesh"); - LSTR MSG_UBL_BUILD_MESH_M = _UxGT("Crea Mesh ($)"); - LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("Valida Mesh ($)"); - LSTR MSG_UBL_BUILD_COLD_MESH = _UxGT("Crea Mesh a freddo"); - LSTR MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Aggiusta Alt. Mesh"); + LSTR MSG_UBL_SET_TEMP_BED = _UxGT("Temp. piatto"); + LSTR MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Temp. piatto"); + LSTR MSG_UBL_SET_TEMP_HOTEND = _UxGT("Temp. ugello"); + LSTR MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Temp. ugello"); + LSTR MSG_UBL_MESH_EDIT = _UxGT("Modifica mesh"); + LSTR MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Modif.mesh personal."); + LSTR MSG_UBL_FINE_TUNE_MESH = _UxGT("Ritocca mesh"); + LSTR MSG_UBL_DONE_EDITING_MESH = _UxGT("Modif.mesh fatta"); + LSTR MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Crea mesh personal."); + LSTR MSG_UBL_BUILD_MESH_MENU = _UxGT("Crea mesh"); + LSTR MSG_UBL_BUILD_MESH_M = _UxGT("Crea mesh ($)"); + LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("Valida mesh ($)"); + LSTR MSG_UBL_BUILD_COLD_MESH = _UxGT("Crea mesh a freddo"); + LSTR MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Aggiusta alt. mesh"); LSTR MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Altezza"); - LSTR MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Valida Mesh"); - LSTR MSG_G26_HEATING_BED = _UxGT("G26 riscald.letto"); + LSTR MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Valida mesh"); + LSTR MSG_G26_HEATING_BED = _UxGT("G26 riscald.piatto"); LSTR MSG_G26_HEATING_NOZZLE = _UxGT("G26 riscald.ugello"); LSTR MSG_G26_MANUAL_PRIME = _UxGT("Priming manuale..."); LSTR MSG_G26_FIXED_LENGTH = _UxGT("Prime a lung.fissa"); LSTR MSG_G26_PRIME_DONE = _UxGT("Priming terminato"); - LSTR MSG_G26_CANCELED = _UxGT("G26 Annullato"); + LSTR MSG_G26_CANCELED = _UxGT("G26 annullato"); LSTR MSG_G26_LEAVING = _UxGT("Uscita da G26"); - LSTR MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Valida Mesh pers."); - LSTR MSG_UBL_CONTINUE_MESH = _UxGT("Continua Mesh"); - LSTR MSG_UBL_MESH_LEVELING = _UxGT("Livell. Mesh"); + LSTR MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Valida mesh pers."); + LSTR MSG_UBL_CONTINUE_MESH = _UxGT("Continua mesh"); + LSTR MSG_UBL_MESH_LEVELING = _UxGT("Livell. mesh"); LSTR MSG_UBL_3POINT_MESH_LEVELING = _UxGT("Livell. 3 Punti"); - LSTR MSG_UBL_GRID_MESH_LEVELING = _UxGT("Livell. Griglia Mesh"); - LSTR MSG_UBL_MESH_LEVEL = _UxGT("Livella Mesh"); + LSTR MSG_UBL_GRID_MESH_LEVELING = _UxGT("Livell. griglia mesh"); + LSTR MSG_UBL_MESH_LEVEL = _UxGT("Livella mesh"); LSTR MSG_UBL_SIDE_POINTS = _UxGT("Punti laterali"); - LSTR MSG_UBL_MAP_TYPE = _UxGT("Tipo di Mappa"); - LSTR MSG_UBL_OUTPUT_MAP = _UxGT("Esporta Mappa"); - LSTR MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Esporta per Host"); + LSTR MSG_UBL_MAP_TYPE = _UxGT("Tipo di mappa"); + LSTR MSG_UBL_OUTPUT_MAP = _UxGT("Esporta mappa"); + LSTR MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Esporta per host"); LSTR MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Esporta in CSV"); LSTR MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Backup esterno"); - LSTR MSG_UBL_INFO_UBL = _UxGT("Esporta Info UBL"); + LSTR MSG_UBL_INFO_UBL = _UxGT("Esporta info UBL"); LSTR MSG_UBL_FILLIN_AMOUNT = _UxGT("Riempimento"); - LSTR MSG_UBL_MANUAL_FILLIN = _UxGT("Riempimento Manuale"); - LSTR MSG_UBL_SMART_FILLIN = _UxGT("Riempimento Smart"); - LSTR MSG_UBL_FILLIN_MESH = _UxGT("Riempimento Mesh"); + LSTR MSG_UBL_MANUAL_FILLIN = _UxGT("Riempimento manuale"); + LSTR MSG_UBL_SMART_FILLIN = _UxGT("Riempimento smart"); + LSTR MSG_UBL_FILLIN_MESH = _UxGT("Riempimento mesh"); LSTR MSG_UBL_MESH_FILLED = _UxGT("Pts mancanti riempiti"); LSTR MSG_UBL_MESH_INVALID = _UxGT("Mesh non valida"); - LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Invalida Tutto"); - LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalid.Punto Vicino"); - LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Ritocca Tutto"); - LSTR MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Ritocca Punto Vicino"); - LSTR MSG_UBL_STORAGE_MESH_MENU = _UxGT("Mesh Salvate"); + LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Invalida tutto"); + LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalid.punto vicino"); + LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Ritocca tutto"); + LSTR MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Ritocca punto vicino"); + LSTR MSG_UBL_STORAGE_MESH_MENU = _UxGT("Mesh salvate"); LSTR MSG_UBL_STORAGE_SLOT = _UxGT("Slot di memoria"); - LSTR MSG_UBL_LOAD_MESH = _UxGT("Carica Mesh Piatto"); - LSTR MSG_UBL_SAVE_MESH = _UxGT("Salva Mesh Piatto"); - LSTR MSG_UBL_INVALID_SLOT = _UxGT("Prima selez. uno slot Mesh"); + LSTR MSG_UBL_LOAD_MESH = _UxGT("Carica mesh piatto"); + LSTR MSG_UBL_SAVE_MESH = _UxGT("Salva mesh piatto"); + LSTR MSG_UBL_INVALID_SLOT = _UxGT("Prima selez. uno slot mesh"); LSTR MSG_MESH_LOADED = _UxGT("Mesh %i caricata"); LSTR MSG_MESH_SAVED = _UxGT("Mesh %i salvata"); LSTR MSG_MESH_ACTIVE = _UxGT("Mesh %i attiva"); @@ -266,15 +266,15 @@ namespace LanguageNarrow_it { LSTR MSG_UBL_SAVE_ERROR = _UxGT("Err: Salvataggio UBL"); LSTR MSG_UBL_RESTORE_ERROR = _UxGT("Err: Ripristino UBL"); LSTR MSG_UBL_Z_OFFSET = _UxGT("Z-Offset: "); - LSTR MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Offset Fermato"); + LSTR MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Offset fermato"); LSTR MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL passo passo"); - LSTR MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Crea Mesh a freddo"); - LSTR MSG_UBL_2_SMART_FILLIN = _UxGT("2.Riempimento Smart"); - LSTR MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Valida Mesh"); - LSTR MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Ritocca All"); - LSTR MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Valida Mesh"); - LSTR MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Ritocca All"); - LSTR MSG_UBL_7_SAVE_MESH = _UxGT("7.Salva Mesh Piatto"); + LSTR MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Crea mesh a freddo"); + LSTR MSG_UBL_2_SMART_FILLIN = _UxGT("2.Riempimento smart"); + LSTR MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Valida mesh"); + LSTR MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Ritocca all"); + LSTR MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Valida mesh"); + LSTR MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Ritocca all"); + LSTR MSG_UBL_7_SAVE_MESH = _UxGT("7.Salva mesh piatto"); LSTR MSG_LED_CONTROL = _UxGT("Controllo LED"); LSTR MSG_LEDS = _UxGT("Luci"); @@ -311,7 +311,7 @@ namespace LanguageNarrow_it { LSTR MSG_MOVE_N_MM = _UxGT("Muovi di $mm"); LSTR MSG_MOVE_N_IN = _UxGT("Muovi di $in"); LSTR MSG_MOVE_N_DEG = _UxGT("Muovi di $") LCD_STR_DEGREE; - LSTR MSG_LIVE_MOVE = _UxGT("Modalità Live"); + LSTR MSG_LIVE_MOVE = _UxGT("Modalità live"); LSTR MSG_SPEED = _UxGT("Velocità"); LSTR MSG_MESH_Z_OFFSET = _UxGT("Piatto Z"); LSTR MSG_NOZZLE = _UxGT("Ugello"); @@ -342,6 +342,7 @@ namespace LanguageNarrow_it { LSTR MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); LSTR MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fact"); LSTR MSG_AUTOTEMP = _UxGT("Autotemp"); + LSTR MSG_TIMEOUT = _UxGT("Tempo scaduto"); LSTR MSG_LCD_ON = _UxGT("On"); LSTR MSG_LCD_OFF = _UxGT("Off"); LSTR MSG_PID_AUTOTUNE = _UxGT("Calibrazione PID"); @@ -351,7 +352,6 @@ namespace LanguageNarrow_it { LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Calibr.PID fallito!"); LSTR MSG_BAD_HEATER_ID = _UxGT("Estrusore invalido."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Temp.troppo alta."); - LSTR MSG_TIMEOUT = _UxGT("Tempo scaduto"); LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Calibrazione fallita! Estrusore errato."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Calibrazione fallita! Temperatura troppo alta."); LSTR MSG_PID_TIMEOUT = _UxGT("Calibrazione fallita! Tempo scaduto."); @@ -364,8 +364,8 @@ namespace LanguageNarrow_it { LSTR MSG_MPC_POWER_E = _UxGT("Potenza *"); LSTR MSG_MPC_BLOCK_HEAT_CAPACITY = _UxGT("Capacità riscald."); LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Capac.riscald. *"); - LSTR MSG_SENSOR_RESPONSIVENESS = _UxGT("Reattiv.Sens."); - LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Reattiv.Sens. *"); + LSTR MSG_SENSOR_RESPONSIVENESS = _UxGT("Reattiv.sens."); + LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Reattiv.sens. *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF = _UxGT("Coeff.ambiente"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Coeff.amb. *"); LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN = _UxGT("Coeff.ventola"); @@ -373,42 +373,42 @@ namespace LanguageNarrow_it { LSTR MSG_SELECT_E = _UxGT("Seleziona *"); LSTR MSG_ACC = _UxGT("Accel"); LSTR MSG_JERK = _UxGT("Jerk"); - 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_VN_JERK = _UxGT("Max Jerk @"); - LSTR MSG_VE_JERK = _UxGT("Max Jerk E"); + 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_VN_JERK = _UxGT("Max jerk @"); + LSTR MSG_VE_JERK = _UxGT("Max jerk E"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Deviaz. giunzioni"); LSTR MSG_STEP_SMOOTHING = _UxGT("Leviga passo"); 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_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."); + 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_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."); LSTR MSG_ACCELERATION = _UxGT("Accelerazione"); - 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_N = _UxGT("Acc.Massima @"); - LSTR MSG_AMAX_E = _UxGT("Acc.Massima E"); - LSTR MSG_AMAX_EN = _UxGT("Acc.Massima *"); + 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_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"); - LSTR MSG_INPUT_SHAPING = _UxGT("Input Shaping"); + LSTR MSG_INPUT_SHAPING = _UxGT("Input shaping"); LSTR MSG_SHAPING_ENABLE = _UxGT("Abilita shaping @"); LSTR MSG_SHAPING_DISABLE = _UxGT("Disabil. shaping @"); LSTR MSG_SHAPING_FREQ = _UxGT("Frequenza @"); LSTR MSG_SHAPING_ZETA = _UxGT("Smorzamento @"); - LSTR MSG_SHAPING_A_FREQ = _UxGT("Frequenza ") STR_A; - LSTR MSG_SHAPING_B_FREQ = _UxGT("Frequenza ") STR_B; - LSTR MSG_SHAPING_A_ZETA = _UxGT("Smorzamento ") STR_A _UxGT(" "); - LSTR MSG_SHAPING_B_ZETA = _UxGT("Smorzamento ") STR_B _UxGT(" "); - LSTR MSG_SHAPING_X_ENABLE = _UxGT("Abilita shaping X"); - LSTR MSG_SHAPING_Y_ENABLE = _UxGT("Abilita shaping Y"); + LSTR MSG_SHAPING_A_FREQ = _UxGT("Frequenza ") STR_A; // ProUI + LSTR MSG_SHAPING_B_FREQ = _UxGT("Frequenza ") STR_B; // ProUI + LSTR MSG_SHAPING_C_FREQ = _UxGT("Frequenza ") STR_C; // ProUI + LSTR MSG_SHAPING_A_ZETA = _UxGT("Smorzamento ") STR_A; // ProUI + LSTR MSG_SHAPING_B_ZETA = _UxGT("Smorzamento ") STR_B; // ProUI + LSTR MSG_SHAPING_C_ZETA = _UxGT("Smorzamento ") STR_C; // ProUI LSTR MSG_XY_FREQUENCY_LIMIT = _UxGT("Frequenza max"); LSTR MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Feed min"); LSTR MSG_STEPS_PER_MM = _UxGT("Passi/mm"); @@ -435,13 +435,15 @@ namespace LanguageNarrow_it { LSTR MSG_DRAW_MIN_Y = _UxGT("Min Y area disegno"); LSTR MSG_DRAW_MAX_Y = _UxGT("Max Y area disegno"); LSTR MSG_MAX_BELT_LEN = _UxGT("Lungh.max cinghia"); - LSTR MSG_LINEAR_ADVANCE = _UxGT("Avanzam.Lineare"); + LSTR MSG_LINEAR_ADVANCE = _UxGT("Avanzam.lineare"); LSTR MSG_ADVANCE_K = _UxGT("K Avanzamento"); LSTR MSG_ADVANCE_K_E = _UxGT("K Avanzamento *"); LSTR MSG_CONTRAST = _UxGT("Contrasto LCD"); LSTR MSG_BRIGHTNESS = _UxGT("Luminosità LCD"); LSTR MSG_SCREEN_TIMEOUT = _UxGT("Timeout LCD (m)"); - LSTR MSG_BRIGHTNESS_OFF = _UxGT("Spegni Retroillum."); + LSTR MSG_HOTEND_TEMP_GRAPH = _UxGT("Grafico temp.ugello"); + LSTR MSG_BED_TEMP_GRAPH = _UxGT("Grafico temp.piatto"); + LSTR MSG_BRIGHTNESS_OFF = _UxGT("Spegni retroillum."); LSTR MSG_STORE_EEPROM = _UxGT("Salva impostazioni"); LSTR MSG_LOAD_EEPROM = _UxGT("Carica impostazioni"); LSTR MSG_RESTORE_DEFAULTS = _UxGT("Ripristina imp."); @@ -488,15 +490,16 @@ namespace LanguageNarrow_it { LSTR MSG_BUTTON_PURGE = _UxGT("Spurga"); LSTR MSG_PAUSING = _UxGT("Messa in pausa..."); LSTR MSG_PAUSE_PRINT = _UxGT("Pausa stampa"); - LSTR MSG_ADVANCED_PAUSE = _UxGT("Pausa Avanzata"); + LSTR MSG_ADVANCED_PAUSE = _UxGT("Pausa avanzata"); LSTR MSG_RESUME_PRINT = _UxGT("Riprendi stampa"); - LSTR MSG_HOST_START_PRINT = _UxGT("Host Avvio"); + LSTR MSG_HOST_START_PRINT = _UxGT("Host avvio"); LSTR MSG_STOP_PRINT = _UxGT("Arresta stampa"); LSTR MSG_END_LOOPS = _UxGT("Fine cicli di rip."); - LSTR MSG_PRINTING_OBJECT = _UxGT("Stampa Oggetto"); - LSTR MSG_CANCEL_OBJECT = _UxGT("Cancella Oggetto"); - LSTR MSG_CANCEL_OBJECT_N = _UxGT("Canc. Oggetto {"); - LSTR MSG_OUTAGE_RECOVERY = _UxGT("Ripresa da PowerLoss"); + LSTR MSG_PRINTING_OBJECT = _UxGT("Stampa oggetto"); + LSTR MSG_CANCEL_OBJECT = _UxGT("Cancella oggetto"); + LSTR MSG_CANCEL_OBJECT_N = _UxGT("Canc. oggetto {"); + LSTR MSG_OUTAGE_RECOVERY = _UxGT("Ripresa da interruz."); + LSTR MSG_RESUME_BED_TEMP = _UxGT("Riprendi temp.piatto"); LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Cont.proc.stampa"); LSTR MSG_MEDIA_MENU = _UxGT("Stampa da ") MEDIA_TYPE_IT; LSTR MSG_NO_MEDIA = MEDIA_TYPE_IT _UxGT(" non presente"); @@ -506,22 +509,22 @@ namespace LanguageNarrow_it { LSTR MSG_PRINTING = _UxGT("Stampa..."); LSTR MSG_STOPPING = _UxGT("Fermata..."); LSTR MSG_REMAINING_TIME = _UxGT("Rimanente"); - LSTR MSG_PRINT_ABORTED = _UxGT("Stampa Annullata"); - LSTR MSG_PRINT_DONE = _UxGT("Stampa Eseguita"); + LSTR MSG_PRINT_ABORTED = _UxGT("Stampa annullata"); + LSTR MSG_PRINT_DONE = _UxGT("Stampa eseguita"); LSTR MSG_PRINTER_KILLED = _UxGT("Stampante uccisa!"); LSTR MSG_TURN_OFF = _UxGT("Spegni stampante"); - LSTR MSG_NO_MOVE = _UxGT("Nessun Movimento"); + LSTR MSG_NO_MOVE = _UxGT("Nessun movimento"); LSTR MSG_KILLED = _UxGT("UCCISO. "); LSTR MSG_STOPPED = _UxGT("ARRESTATO. "); LSTR MSG_FWRETRACT = _UxGT("Ritraz.da firmware"); LSTR MSG_CONTROL_RETRACT = _UxGT("Ritrai mm"); - LSTR MSG_CONTROL_RETRACT_SWAP = _UxGT("Scamb. Ritrai mm"); - LSTR MSG_CONTROL_RETRACTF = _UxGT("Ritrai V"); + LSTR MSG_CONTROL_RETRACT_SWAP = _UxGT("Scamb. ritrai mm"); + LSTR MSG_CONTROL_RETRACTF = _UxGT("Ritrai V"); LSTR MSG_CONTROL_RETRACT_ZHOP = _UxGT("Salta mm"); LSTR MSG_CONTROL_RETRACT_RECOVER = _UxGT("Avanza mm"); LSTR MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Scamb. Avanza mm"); LSTR MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Avanza V"); - LSTR MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Scamb. Avanza V"); + LSTR MSG_CONTROL_RETRACT_RECOVER_SWAPF = _UxGT("Scamb. avanza V"); LSTR MSG_AUTORETRACT = _UxGT("AutoRitrai"); LSTR MSG_FILAMENT_SWAP_LENGTH = _UxGT("Lunghezza scambio"); LSTR MSG_FILAMENT_SWAP_EXTRA = _UxGT("Extra scambio"); @@ -574,11 +577,11 @@ namespace LanguageNarrow_it { LSTR MSG_TOUCHMI_ZTEST = _UxGT("Test Z offset"); LSTR MSG_TOUCHMI_SAVE = _UxGT("Memorizzare"); LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Estendi TouchMI"); - LSTR MSG_MANUAL_DEPLOY = _UxGT("Estendi Sonda-Z"); + LSTR MSG_MANUAL_DEPLOY = _UxGT("Estendi sonda-Z"); LSTR MSG_MANUAL_PENUP = _UxGT("Penna su"); LSTR MSG_MANUAL_PENDOWN = _UxGT("Penna giù"); LSTR MSG_BLTOUCH_STOW = _UxGT("Ritrai BLTouch"); - LSTR MSG_MANUAL_STOW = _UxGT("Ritrai Sonda-Z"); + LSTR MSG_MANUAL_STOW = _UxGT("Ritrai sonda-Z"); LSTR MSG_HOME_FIRST = _UxGT("Home %s prima"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Impostazioni sonda"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Offsets sonda"); @@ -588,14 +591,14 @@ namespace LanguageNarrow_it { LSTR MSG_ZPROBE_MARGIN = _UxGT("Margine sonda"); LSTR MSG_Z_FEED_RATE = _UxGT("Velocità Z"); LSTR MSG_ENABLE_HS_MODE = _UxGT("Abilita modo HS"); - LSTR MSG_MOVE_NOZZLE_TO_BED = _UxGT("Muovi ugel.su letto"); + LSTR MSG_MOVE_NOZZLE_TO_BED = _UxGT("Muovi ugel.su piatto"); 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("Totali"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Interrompi se FC"); - LSTR MSG_ERR_HEATING_FAILED = _UxGT("Risc.Fallito"); // Max 12 characters + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Risc.fallito"); // Max 12 characters LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP RIDONDANTE"); LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("TEMP FUORI CONTROLLO"); LSTR MSG_ERR_TEMP_MALFUNCTION = _UxGT("MALFUNZIONAMENTO TEMP"); @@ -610,29 +613,30 @@ namespace LanguageNarrow_it { LSTR MSG_COOLING = _UxGT("Raffreddamento..."); LSTR MSG_BED_HEATING = _UxGT("Risc. piatto..."); LSTR MSG_BED_COOLING = _UxGT("Raffr. piatto..."); + LSTR MSG_BED_ANNEALING = _UxGT("Ricottura..."); LSTR MSG_PROBE_HEATING = _UxGT("Risc. sonda..."); LSTR MSG_PROBE_COOLING = _UxGT("Raffr. sonda..."); LSTR MSG_CHAMBER_HEATING = _UxGT("Risc. camera..."); LSTR MSG_CHAMBER_COOLING = _UxGT("Raffr. camera..."); LSTR MSG_LASER_COOLING = _UxGT("Raffr. laser..."); LSTR MSG_DELTA_CALIBRATE = _UxGT("Calibraz. Delta"); - LSTR MSG_DELTA_CALIBRATION_IN_PROGRESS = _UxGT("Calibrazione Delta in corso"); + LSTR MSG_DELTA_CALIBRATION_IN_PROGRESS = _UxGT("Calibrazione delta in corso"); LSTR MSG_DELTA_CALIBRATE_X = _UxGT("Calibra X"); LSTR MSG_DELTA_CALIBRATE_Y = _UxGT("Calibra Y"); LSTR MSG_DELTA_CALIBRATE_Z = _UxGT("Calibra Z"); LSTR MSG_DELTA_CALIBRATE_CENTER = _UxGT("Calibra centro"); - LSTR MSG_DELTA_SETTINGS = _UxGT("Impostaz. Delta"); + LSTR MSG_DELTA_SETTINGS = _UxGT("Impostaz. delta"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Auto calibrazione"); - LSTR MSG_DELTA_DIAG_ROD = _UxGT("Barra Diagonale"); + LSTR MSG_DELTA_DIAG_ROD = _UxGT("Barra diagonale"); LSTR MSG_DELTA_HEIGHT = _UxGT("Altezza"); LSTR MSG_DELTA_RADIUS = _UxGT("Raggio"); LSTR MSG_INFO_MENU = _UxGT("Info su stampante"); LSTR MSG_INFO_PRINTER_MENU = _UxGT("Info. stampante"); LSTR MSG_3POINT_LEVELING = _UxGT("Livel. a 3 punti"); - LSTR MSG_LINEAR_LEVELING = _UxGT("Livel. Lineare"); - LSTR MSG_BILINEAR_LEVELING = _UxGT("Livel. Bilineare"); + LSTR MSG_LINEAR_LEVELING = _UxGT("Livel. lineare"); + LSTR MSG_BILINEAR_LEVELING = _UxGT("Livel. bilineare"); LSTR MSG_UBL_LEVELING = _UxGT("Livel.piatto unific."); - LSTR MSG_MESH_LEVELING = _UxGT("Livel. Mesh"); + LSTR MSG_MESH_LEVELING = _UxGT("Livel. mesh"); LSTR MSG_MESH_DONE = _UxGT("Sond.mesh eseguito"); LSTR MSG_INFO_STATS_MENU = _UxGT("Statistiche"); LSTR MSG_RESET_STATS = _UxGT("Reset stat.stampa?"); @@ -644,41 +648,41 @@ namespace LanguageNarrow_it { LSTR MSG_INFO_RUNAWAY_OFF = _UxGT("Controllo fuga: OFF"); LSTR MSG_INFO_RUNAWAY_ON = _UxGT("Controllo fuga: ON"); LSTR MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Timeout inatt.ugello"); - LSTR MSG_HOTEND_IDLE_DISABLE = _UxGT("Disabilita Timeout"); + LSTR MSG_HOTEND_IDLE_DISABLE = _UxGT("Disabilita timeout"); LSTR MSG_HOTEND_IDLE_NOZZLE_TARGET = _UxGT("Temp.inatt.ugello"); - LSTR MSG_HOTEND_IDLE_BED_TARGET = _UxGT("Temp.inatt.letto"); + LSTR MSG_HOTEND_IDLE_BED_TARGET = _UxGT("Temp.inatt.piatto"); LSTR MSG_FAN_SPEED_FAULT = _UxGT("Err.vel.della ventola"); - LSTR MSG_CASE_LIGHT = _UxGT("Luci Case"); + LSTR MSG_CASE_LIGHT = _UxGT("Luci case"); LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Luminosità Luci"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("STAMPANTE ERRATA"); - LSTR MSG_COLORS_GET = _UxGT("Ottieni colori"); - LSTR MSG_COLORS_SELECT = _UxGT("Selez.colori"); - LSTR MSG_COLORS_APPLIED = _UxGT("Colori applicati"); - LSTR MSG_COLORS_RED = _UxGT("Rosso"); - LSTR MSG_COLORS_GREEN = _UxGT("Verde"); - LSTR MSG_COLORS_BLUE = _UxGT("Blu"); - LSTR MSG_COLORS_WHITE = _UxGT("Bianco"); - LSTR MSG_UI_LANGUAGE = _UxGT("Lingua UI"); - LSTR MSG_SOUND_ENABLE = _UxGT("Abilita suono"); - LSTR MSG_LOCKSCREEN = _UxGT("Blocca Schermo"); - LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Stamp. bloccata,"); - LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Scroll x sbloccare."); - LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Attendere fino al riavvio."); + LSTR MSG_COLORS_GET = _UxGT("Ottieni colori"); // ProUI + LSTR MSG_COLORS_SELECT = _UxGT("Selez.colori"); // ProUI + LSTR MSG_COLORS_APPLIED = _UxGT("Colori applicati"); // ProUI + LSTR MSG_COLORS_RED = _UxGT("Rosso"); // ProUI / JyersUI + LSTR MSG_COLORS_GREEN = _UxGT("Verde"); // ProUI / JyersUI + LSTR MSG_COLORS_BLUE = _UxGT("Blu"); // ProUI / JyersUI + LSTR MSG_COLORS_WHITE = _UxGT("Bianco"); // ProUI + LSTR MSG_UI_LANGUAGE = _UxGT("Lingua UI"); // ProUI + LSTR MSG_SOUND_ENABLE = _UxGT("Abilita suono"); // ProUI + LSTR MSG_LOCKSCREEN = _UxGT("Blocca schermo"); // ProUI + LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Stamp. bloccata,"); // ProUI + LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Scroll x sbloccare."); // ProUI + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Attendere fino al riavvio."); // ProUI + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No supporto"); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Prerisc. ugello."); // ProUI - LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No Supporto"); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Prerisc. hot end."); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Stampe"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Durata"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Più lungo"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Estruso"); - LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completate"); LSTR MSG_INFO_MIN_TEMP = _UxGT("Temp min"); LSTR MSG_INFO_MAX_TEMP = _UxGT("Temp max"); LSTR MSG_INFO_PSU = _UxGT("Alimentatore"); - LSTR MSG_DRIVE_STRENGTH = _UxGT("Potenza Drive"); + + LSTR MSG_DRIVE_STRENGTH = _UxGT("Potenza drive"); LSTR MSG_DAC_PERCENT_N = _UxGT("Driver @ %"); LSTR MSG_ERROR_TMC = _UxGT("ERR.CONNESSIONE TMC"); LSTR MSG_DAC_EEPROM_WRITE = _UxGT("Scrivi DAC EEPROM"); @@ -689,14 +693,12 @@ namespace LanguageNarrow_it { LSTR MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("OPZIONI RIPRESA:"); LSTR MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Spurga di più"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Riprendi stampa"); - LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Spurga o continua?"); + LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Spurga o continua?"); // ProUI LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Ugello: "); + LSTR MSG_RUNOUT_SENSOR = _UxGT("Sens.filo termin."); // Max 17 characters LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Dist mm filo term."); - LSTR MSG_RUNOUT_ENABLE = _UxGT("Abil.filo termin."); - LSTR MSG_RUNOUT_ACTIVE = _UxGT("Filo termin. attivo"); - LSTR MSG_INVERT_EXTRUDER = _UxGT("Inverti estrusore"); - LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Temp.min estrusore"); + LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Temp.min estrusore"); // ProUI LSTR MSG_FANCHECK = _UxGT("Verif.tacho vent."); // Max 17 characters LSTR MSG_KILL_HOMING_FAILED = _UxGT("Home fallito"); LSTR MSG_LCD_PROBING_FAILED = _UxGT("Sondaggio fallito"); @@ -793,21 +795,21 @@ namespace LanguageNarrow_it { LSTR MSG_FIXED_TIME_MOTION = _UxGT("Movimento a Tempo-Fisso"); LSTR MSG_FTM_MODE = _UxGT("Modo Movimento:"); - LSTR MSG_FTM_ZV = _UxGT("ZV"); - LSTR MSG_FTM_ZVD = _UxGT("ZVD"); - LSTR MSG_FTM_EI = _UxGT("EI"); - LSTR MSG_FTM_2HEI = _UxGT("2HEI"); - LSTR MSG_FTM_3HEI = _UxGT("3HEI"); - LSTR MSG_FTM_MZV = _UxGT("MZV"); - //LSTR MSG_FTM_ULENDO_FBS = _UxGT("Ulendo FBS"); - //LSTR MSG_FTM_DISCTF = _UxGT("DISCTF"); + //LSTR MSG_FTM_ZV = _UxGT("ZV"); + //LSTR MSG_FTM_ZVD = _UxGT("ZVD"); + //LSTR MSG_FTM_ZVDD = _UxGT("ZVDD"); + //LSTR MSG_FTM_ZVDDD = _UxGT("ZVDDD"); + //LSTR MSG_FTM_EI = _UxGT("EI"); + //LSTR MSG_FTM_2HEI = _UxGT("2HEI"); + //LSTR MSG_FTM_3HEI = _UxGT("3HEI"); + //LSTR MSG_FTM_MZV = _UxGT("MZV"); LSTR MSG_FTM_DYN_MODE = _UxGT("Modo DF:"); LSTR MSG_FTM_Z_BASED = _UxGT("Base-Z"); LSTR MSG_FTM_MASS_BASED = _UxGT("Base-Massa"); - LSTR MSG_FTM_BASE_FREQ_N = _UxGT("@ Freq. Base"); - LSTR MSG_FTM_DFREQ_K_N = _UxGT("@ Freq. Dinam."); - LSTR MSG_FTM_ZETA = _UxGT("Smorzamento"); - LSTR MSG_FTM_VTOL = _UxGT("Livello Vib."); + LSTR MSG_FTM_BASE_FREQ_N = _UxGT("@ Freq. base"); + LSTR MSG_FTM_DFREQ_K_N = _UxGT("@ Freq. dinam."); + LSTR MSG_FTM_ZETA_N = _UxGT("Smorzamento @"); + LSTR MSG_FTM_VTOL_N = _UxGT("Livello vib. @"); LSTR MSG_LEVEL_X_AXIS = _UxGT("Livello asse X"); LSTR MSG_AUTO_CALIBRATE = _UxGT("Auto Calibra"); @@ -845,9 +847,8 @@ namespace LanguageNarrow_it { LSTR DGUS_MSG_NOT_WHILE_PRINTING = _UxGT("Non ammesso durante la stampa"); LSTR DGUS_MSG_NOT_WHILE_IDLE = _UxGT("Non ammesso mentre è in riposo"); LSTR DGUS_MSG_NO_FILE_SELECTED = _UxGT("Nessun file selezionato"); - LSTR DGUS_MSG_TEMP_TOO_LOW = _UxGT("Temperatura troppo bassa"); LSTR DGUS_MSG_EXECUTING_COMMAND = _UxGT("Esecuzione del comando..."); - LSTR DGUS_MSG_BED_PID_DISABLED = _UxGT("PID letto disabilitato"); + LSTR DGUS_MSG_BED_PID_DISABLED = _UxGT("PID piatto disabilitato"); LSTR DGUS_MSG_PID_DISABLED = _UxGT("PID disabilitato"); LSTR DGUS_MSG_PID_AUTOTUNING = _UxGT("Calibrazione PID..."); LSTR DGUS_MSG_INVALID_RECOVERY_DATA = _UxGT("Dati di recupero non validi"); @@ -856,7 +857,7 @@ namespace LanguageNarrow_it { LSTR DGUS_MSG_BUSY = _UxGT("Occupato"); LSTR DGUS_MSG_HOMING = _UxGT("Azzeramento..."); LSTR DGUS_MSG_FW_OUTDATED = _UxGT("Richiesto aggiornamento DWIN GUI/OS"); - LSTR DGUS_MSG_ABL_REQUIRED = _UxGT("Richiesto autolivellamento letto"); + LSTR DGUS_MSG_ABL_REQUIRED = _UxGT("Richiesto autolivellamento piatto"); LSTR DGUS_MSG_PROBING_FAILED = _UxGT("Sondaggio fallito"); LSTR DGUS_MSG_PROBING_SUCCESS = _UxGT("Sondaggio effettuato"); LSTR DGUS_MSG_RESET_EEPROM = _UxGT("Reset EEPROM"); @@ -873,17 +874,18 @@ namespace LanguageWide_it { LSTR MSG_PRINTING_OBJECT = _UxGT("Sto stampando l'oggetto"); LSTR MSG_CANCEL_OBJECT = _UxGT("Cancella l'oggetto"); LSTR MSG_CANCEL_OBJECT_N = _UxGT("Cancella l'oggetto {"); - LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Continua il Job di stampa"); + LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Continua il job di stampa"); LSTR MSG_MEDIA_MENU = _UxGT("Selez.da supporto"); LSTR MSG_TURN_OFF = _UxGT("Spegni la stampante"); LSTR MSG_END_LOOPS = _UxGT("Termina i cicli di ripetizione"); - LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nessun supporto inserito."); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Si prega di preriscaldare l'hot end."); - LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Azzera i contatori di stampa"); + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nessun supporto inserito."); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Si prega di preriscaldare l'ugello."); // ProUI + LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Azzera i contatori di stampa"); // ProUI LSTR MSG_INFO_PRINT_COUNT = _UxGT("Contatori di stampa"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Tempo totale"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Lavoro più lungo"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Totale estruso"); + LSTR MSG_TEMP_TOO_LOW = _UxGT("Temperatura troppo bassa"); #endif } diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 2cb9aa2288..c96da22b60 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -467,7 +467,6 @@ namespace LanguageNarrow_pl { LSTR MSG_GAMES = _UxGT("Gry"); - LSTR MSG_EDIT_PASSWORD = _UxGT("Zmień hasło"); LSTR MSG_LOGIN_REQUIRED = _UxGT("Wymagane zalogowanie"); LSTR MSG_PASSWORD_SETTINGS = _UxGT("Ustawienia hasła"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index ffe2fb1ae5..e30b1fb562 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -73,9 +73,6 @@ namespace LanguageNarrow_ru { LSTR MSG_Z_FADE_HEIGHT = _UxGT("Лимит выранивания"); 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_OFFSETS_APPLIED = _UxGT("Смещения применены"); LSTR MSG_SELECT_ORIGIN = _UxGT("Выберите ноль"); @@ -294,6 +291,7 @@ namespace LanguageNarrow_ru { LSTR MSG_MAX = " " LCD_STR_THERMOMETER ", " LCD_STR_DEGREE _UxGT("С макс"); LSTR MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Фактор"); LSTR MSG_AUTOTEMP = _UxGT("Автотемпература"); + LSTR MSG_TIMEOUT = _UxGT("Таймаут."); LSTR MSG_LCD_ON = _UxGT("Вкл"); LSTR MSG_LCD_OFF = _UxGT("Выкл"); @@ -707,7 +705,6 @@ namespace LanguageNarrow_ru { LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Автонастройка PID не удалась!"); LSTR MSG_BAD_HEATER_ID = _UxGT("Неверный экструдер."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Слишком высокая температура."); - LSTR MSG_TIMEOUT = _UxGT("Таймаут."); LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Тест потери тепла"); LSTR MSG_MPC_HEATING_PAST_200 = _UxGT("Нагрев выше >200C"); LSTR MSG_MPC_COOLING_TO_AMBIENT = _UxGT("Охлаждение до окружающей"); @@ -778,30 +775,30 @@ namespace LanguageNarrow_ru { LSTR MSG_DELTA_CALIBRATION_IN_PROGRESS = _UxGT("Делаю дельта-калибровку"); LSTR MSG_RESET_STATS = _UxGT("Сбросить статистику печати?"); LSTR MSG_FAN_SPEED_FAULT = _UxGT("Сбой скорости кулера"); - LSTR MSG_COLORS_GET = _UxGT("Получить цвет"); - LSTR MSG_COLORS_SELECT = _UxGT("Выбрать цвета"); - LSTR MSG_COLORS_APPLIED = _UxGT("Цвета применены"); - LSTR MSG_COLORS_RED = _UxGT("Красный"); - LSTR MSG_COLORS_GREEN = _UxGT("Зелёный"); - LSTR MSG_COLORS_BLUE = _UxGT("Синий"); - LSTR MSG_COLORS_WHITE = _UxGT("Белый"); - LSTR MSG_UI_LANGUAGE = _UxGT("UI Language"); - LSTR MSG_SOUND_ENABLE = _UxGT("Включить звук"); - LSTR MSG_LOCKSCREEN = _UxGT("Блокировать экран"); - LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Принтер заблокирован,"); - LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Крутить для разблокировки."); - LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Ждите перезагрузки."); - LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Нет носителя."); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Нагрейте сопло."); - LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Сбросить счетчик"); - LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Прочистить или продолжить?"); - LSTR MSG_RUNOUT_ENABLE = _UxGT("Включить датч.филамента"); - LSTR MSG_RUNOUT_ACTIVE = _UxGT("Датч.филам. активен"); - LSTR MSG_INVERT_EXTRUDER = _UxGT("Инвертировать экструдер"); - LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Миню темп. экструдера."); + + LSTR MSG_COLORS_GET = _UxGT("Получить цвет"); // ProUI + LSTR MSG_COLORS_SELECT = _UxGT("Выбрать цвета"); // ProUI + LSTR MSG_COLORS_APPLIED = _UxGT("Цвета применены"); // ProUI + LSTR MSG_COLORS_RED = _UxGT("Красный"); // ProUI / JyersUI + LSTR MSG_COLORS_GREEN = _UxGT("Зелёный"); // ProUI / JyersUI + LSTR MSG_COLORS_BLUE = _UxGT("Синий"); // ProUI / JyersUI + LSTR MSG_COLORS_WHITE = _UxGT("Белый"); // ProUI + LSTR MSG_UI_LANGUAGE = _UxGT("UI Language"); // ProUI + LSTR MSG_SOUND_ENABLE = _UxGT("Включить звук"); // ProUI + LSTR MSG_LOCKSCREEN = _UxGT("Блокировать экран"); // ProUI + LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Принтер заблокирован,"); // ProUI + LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Крутить для разблокировки."); // ProUI + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Ждите перезагрузки."); // ProUI + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Нет носителя."); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Нагрейте сопло."); // ProUI + LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Сбросить счетчик"); // ProUI + LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Прочистить или продолжить?"); // ProUI + LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Миню темп. экструдера."); // ProUI + LSTR MSG_FANCHECK = _UxGT("Пров.тахометра кулера"); LSTR MSG_MMU2_REMOVE_AND_CLICK = _UxGT("Уберите и кликните..."); LSTR MSG_REHEATDONE = _UxGT("Нагрето"); + LSTR MSG_XATC = _UxGT("Помощник перекоса X"); LSTR MSG_XATC_DONE = _UxGT("Перекос Х настроен!"); LSTR MSG_XATC_UPDATE_Z_OFFSET = _UxGT("Новое смещение Z-зонда "); @@ -832,9 +829,9 @@ namespace LanguageWide_ru { LSTR MSG_ADVANCED_SETTINGS = _UxGT("Расширенные настройки"); LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Переполнение вызова"); 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_X = _UxGT("Смещение дома X"); // DWIN + LSTR MSG_HOME_OFFSET_Y = _UxGT("Смещение дома Y"); // DWIN + LSTR MSG_HOME_OFFSET_Z = _UxGT("Смещение дома Z"); // DWIN LSTR MSG_LAST_VALUE_SP = _UxGT("Последнее значение "); LSTR MSG_SPINDLE_MENU = _UxGT("Управлен.шпинделем"); LSTR MSG_LASER_TOGGLE = _UxGT("Переключить лазер"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 73bf58d991..9746329015 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -99,9 +99,9 @@ namespace LanguageNarrow_sk { LSTR MSG_LEVEL_BED_DONE = _UxGT("Vyrovnanie hotové!"); LSTR MSG_Z_FADE_HEIGHT = _UxGT("Výška rovnania"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Nastav. dom. ofsety"); - 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_X = _UxGT("X Ofset"); // DWIN + LSTR MSG_HOME_OFFSET_Y = _UxGT("Y Ofset"); // DWIN + LSTR MSG_HOME_OFFSET_Z = _UxGT("Z Ofset"); // DWIN LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofsety nastavené"); LSTR MSG_ERR_M428_TOO_FAR = _UxGT("Chyba: Príliš ďaleko!"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Spriev. vyrovn."); @@ -338,6 +338,7 @@ namespace LanguageNarrow_sk { LSTR MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); LSTR MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Fakt"); LSTR MSG_AUTOTEMP = _UxGT("Auto-teplota"); + LSTR MSG_TIMEOUT = _UxGT("Čas vypršal"); LSTR MSG_LCD_ON = _UxGT("Zap"); LSTR MSG_LCD_OFF = _UxGT("Vyp"); LSTR MSG_PID_AUTOTUNE = _UxGT("Kalibrácia PID"); @@ -347,7 +348,6 @@ namespace LanguageNarrow_sk { LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Kal. PID zlyhala!"); LSTR MSG_BAD_HEATER_ID = _UxGT("Zlý extrudér"); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Príliš vysoká tepl."); - LSTR MSG_TIMEOUT = _UxGT("Čas vypršal"); LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Auto-kal. zlyhala! Zlý extrúder."); LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Auto-kal. zlyhala! Príliš vysoká tepl."); LSTR MSG_PID_TIMEOUT = _UxGT("Auto-kal. zlyhala! Čas vypršal."); @@ -633,31 +633,31 @@ namespace LanguageNarrow_sk { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jas svetla"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Nesprávna tlačiareň"); - LSTR MSG_COLORS_GET = _UxGT("Zvoliť farbu"); - LSTR MSG_COLORS_SELECT = _UxGT("Zvoliť farby"); - LSTR MSG_COLORS_APPLIED = _UxGT("Farby aplikované"); - LSTR MSG_COLORS_RED = _UxGT("Červená"); - LSTR MSG_COLORS_GREEN = _UxGT("Zelená"); - LSTR MSG_COLORS_BLUE = _UxGT("Modrá"); - LSTR MSG_COLORS_WHITE = _UxGT("Biela"); - LSTR MSG_UI_LANGUAGE = _UxGT("Jazyk rozhrania"); - LSTR MSG_SOUND_ENABLE = _UxGT("Povoliť zvuky"); - LSTR MSG_LOCKSCREEN = _UxGT("Uzamknúť obrazovku"); - LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Tlačiareň je uzamknutá,"); - LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("potiahnite pre odomknutie."); - LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Prosím čakajte do reštartu."); + LSTR MSG_COLORS_GET = _UxGT("Zvoliť farbu"); // ProUI + LSTR MSG_COLORS_SELECT = _UxGT("Zvoliť farby"); // ProUI + LSTR MSG_COLORS_APPLIED = _UxGT("Farby aplikované"); // ProUI + LSTR MSG_COLORS_RED = _UxGT("Červená"); // ProUI / JyersUI + LSTR MSG_COLORS_GREEN = _UxGT("Zelená"); // ProUI / JyersUI + LSTR MSG_COLORS_BLUE = _UxGT("Modrá"); // ProUI / JyersUI + LSTR MSG_COLORS_WHITE = _UxGT("Biela"); // ProUI + LSTR MSG_UI_LANGUAGE = _UxGT("Jazyk rozhrania"); // ProUI + LSTR MSG_SOUND_ENABLE = _UxGT("Povoliť zvuky"); // ProUI + LSTR MSG_LOCKSCREEN = _UxGT("Uzamknúť obrazovku"); // ProUI + LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Tlačiareň je uzamknutá,"); // ProUI + LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("potiahnite pre odomknutie."); // ProUI + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Prosím čakajte do reštartu."); // ProUI + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Žiadna karta"); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Prosím zahrejte"); // ProUI - LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Žiadna karta"); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Prosím zahrejte"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Tlače"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Čas"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Najdlhšia"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Vytlačené"); - LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Dokončené"); LSTR MSG_INFO_MIN_TEMP = _UxGT("Teplota min"); 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_N = _UxGT("@ Motor %"); LSTR MSG_ERROR_TMC = _UxGT("CHYBA KOMUNIKÁ. TMC"); @@ -669,14 +669,11 @@ namespace LanguageNarrow_sk { LSTR MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("MOŽNOSTI POKRAČ.:"); LSTR MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Vytlačiť viacej"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Obnoviť tlač"); - LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Vytlač. alebo pokrač.?"); + LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Vytlač. alebo pokrač.?"); // ProUI LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Tryska: "); LSTR MSG_RUNOUT_SENSOR = _UxGT("Senzor filamentu"); LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Vzd. mm fil. senz."); - LSTR MSG_RUNOUT_ENABLE = _UxGT("Zapnúť senzor"); - LSTR MSG_RUNOUT_ACTIVE = _UxGT("Senz. fil. zapn."); - LSTR MSG_INVERT_EXTRUDER = _UxGT("Invert. extrudér"); - LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Min. tepl. extrud."); + LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Min. tepl. extrud."); // ProUI LSTR MSG_FANCHECK = _UxGT("Kontrola rýchl."); LSTR MSG_KILL_HOMING_FAILED = _UxGT("Parkovanie zlyhalo"); LSTR MSG_LCD_PROBING_FAILED = _UxGT("Kalibrácia zlyhala"); @@ -812,9 +809,9 @@ namespace LanguageWide_sk { LSTR MSG_MEDIA_MENU = _UxGT("Vytlačiť z karty"); LSTR MSG_TURN_OFF = _UxGT("Vypnite tlačiareň"); LSTR MSG_END_LOOPS = _UxGT("Ukončiť opak. sluč."); - LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nie je vložená karta."); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Prosím zahrejte hotend."); - LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Vynulovať počítadlo"); + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nie je vložená karta."); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Prosím zahrejte hotend."); // ProUI + LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Vynulovať počítadlo"); // ProUI LSTR MSG_INFO_PRINT_COUNT = _UxGT("Počet tlačí"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Celkový čas"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Najdlhšia tlač"); diff --git a/Marlin/src/lcd/language/language_test.h b/Marlin/src/lcd/language/language_test.h index 657e4e2e48..fa022ef6ee 100644 --- a/Marlin/src/lcd/language/language_test.h +++ b/Marlin/src/lcd/language/language_test.h @@ -44,22 +44,18 @@ // Kanji (an other Japanese symbol set) uses far more than two codepages. So currently I don't see a chance to map the Unicodes. Its not // impossible to have a close to direct mapping but will need giant conversion tables and fonts (we don't want to have in a embedded system). - // Select the better font for full graphic displays. //#define DISPLAY_CHARSET_ISO10646_1 //#define DISPLAY_CHARSET_ISO10646_5 //#define DISPLAY_CHARSET_ISO10646_GREEK //#define DISPLAY_CHARSET_ISO10646_KANA - - // next 5 lines select variants in this file only #define DISPLAYTEST //#define WEST //#define CYRIL //#define KANA - // TESTSTRINGS #define STRG_ASCII_2 _UxGT(" !\"#$%&'()*+,-./") @@ -116,7 +112,7 @@ namespace Language_test { using namespace Language_en; // Inherit undefined strings from English - constexpr uint8_t CHARSIZE = 1; + constexpr uint8_t CHARSIZE = 1; #if ENABLED(DISPLAYTEST) LSTR WELCOME_MSG = _UxGT("Language TEST"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index c3c3b76cec..3f925d04db 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -26,6 +26,14 @@ * * 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 titles: + * + * $ 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) + * @ displays an axis name such as XYZUVW, or E for an extruder */ #define DISPLAY_CHARSET_ISO10646_TR @@ -37,7 +45,7 @@ namespace LanguageNarrow_tr { LSTR LANGUAGE = _UxGT("Turkish"); // These strings should be translated - LSTR WELCOME_MSG = MACHINE_NAME _UxGT(" hazır."); + LSTR WELCOME_MSG = MACHINE_NAME _UxGT(" Hazır."); LSTR MSG_YES = _UxGT("EVET"); LSTR MSG_NO = _UxGT("HAYIR"); LSTR MSG_HIGH = _UxGT("YÜKSEK"); @@ -48,13 +56,15 @@ namespace LanguageNarrow_tr { LSTR MSG_MEDIA_INSERTED = _UxGT("SD K. Yerleştirildi."); LSTR MSG_MEDIA_REMOVED = _UxGT("SD Kart Çıkarıldı."); LSTR MSG_MEDIA_WAITING = _UxGT("SD Kart Bekleniyor"); - LSTR MSG_MEDIA_INIT_FAIL = MEDIA_TYPE_EN _UxGT(" Başlatma Başarısız"); + LSTR MSG_MEDIA_INIT_FAIL = _UxGT("SD K. Başlatma Hatası"); LSTR MSG_MEDIA_READ_ERROR = _UxGT("Kart Okuma Hatası"); LSTR MSG_MEDIA_USB_REMOVED = _UxGT("USB Çıkarıldı"); LSTR MSG_MEDIA_USB_FAILED = _UxGT("USB Başlat. Hatası"); + LSTR MSG_MEDIA_SORT = _UxGT("Medyayı Sırala"); + LSTR MSG_MEDIA_UPDATE = _UxGT("Medyayı Güncelle"); LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Subcall Overflow"); LSTR MSG_LCD_ENDSTOPS = _UxGT("Endstops"); // Max length 8 characters - LSTR MSG_LCD_SOFT_ENDSTOPS = _UxGT("Yazılımsal Endstops"); + LSTR MSG_LCD_SOFT_ENDSTOPS = _UxGT("Soft Endstops"); LSTR MSG_MAIN_MENU = _UxGT("Ana"); LSTR MSG_ADVANCED_SETTINGS = _UxGT("Gelişmiş Ayarlar"); LSTR MSG_CONFIGURATION = _UxGT("Yapılandırma"); @@ -62,12 +72,15 @@ namespace LanguageNarrow_tr { LSTR MSG_DISABLE_STEPPERS = _UxGT("Motorları Durdur"); LSTR MSG_DEBUG_MENU = _UxGT("Hata Ayıklama"); LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Durum Çubuğu Testi"); + LSTR MSG_ENDSTOP_TEST = _UxGT("Endstop Test"); + LSTR MSG_Z_PROBE = _UxGT("Z Probe"); LSTR MSG_HOMING = _UxGT("Sıfırlanıyor"); LSTR MSG_AUTO_HOME = _UxGT("Eksenleri Sıfırla"); LSTR MSG_AUTO_HOME_A = _UxGT("@ Sıfırla"); LSTR MSG_AUTO_HOME_X = _UxGT("X Sıfırla"); LSTR MSG_AUTO_HOME_Y = _UxGT("Y Sıfırla"); LSTR MSG_AUTO_HOME_Z = _UxGT("Z Sıfırla"); + LSTR MSG_Z_AFTER_HOME = _UxGT("Z After Homing"); LSTR MSG_FILAMENT_SET = _UxGT("Filament Ayarları"); LSTR MSG_FILAMENT_MAN = _UxGT("Filament Yönetimi"); LSTR MSG_MANUAL_LEVELING = _UxGT("Manuel Seviyeleme"); @@ -88,31 +101,33 @@ namespace LanguageNarrow_tr { LSTR MSG_LEVEL_BED_DONE = _UxGT("Seviyeleme Tamam!"); LSTR MSG_Z_FADE_HEIGHT = _UxGT("Kaçınma Yüksekliği"); LSTR MSG_SET_HOME_OFFSETS = _UxGT("Ofset Ayarla"); - LSTR MSG_HOME_OFFSET_X = _UxGT("X Ofset Sıfırla"); - LSTR MSG_HOME_OFFSET_Y = _UxGT("Y Ofset Sıfırla"); - LSTR MSG_HOME_OFFSET_Z = _UxGT("Z Ofset Sıfırla"); + LSTR MSG_HOME_OFFSET_X = _UxGT("X Ofset Sıfırla"); // DWIN + LSTR MSG_HOME_OFFSET_Y = _UxGT("Y Ofset Sıfırla"); // DWIN + LSTR MSG_HOME_OFFSET_Z = _UxGT("Z Ofset Sıfırla"); // DWIN LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Ofset Tamam"); + LSTR MSG_ERR_M428_TOO_FAR = _UxGT("MIN/MAX Çok Fazla"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Hizalama Sihirbazı"); LSTR MSG_SELECT_ORIGIN = _UxGT("Başlangıç Seç"); LSTR MSG_LAST_VALUE_SP = _UxGT("Son değer "); - LSTR MSG_PREHEAT_1 = _UxGT("Ön Isınma ") PREHEAT_1_LABEL; - LSTR MSG_PREHEAT_1_H = _UxGT("Ön Isınma ") PREHEAT_1_LABEL " ~"; - LSTR MSG_PREHEAT_1_END = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Nozul"); - LSTR MSG_PREHEAT_1_END_E = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Nozul ~"); - LSTR MSG_PREHEAT_1_ALL = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Tüm"); - LSTR MSG_PREHEAT_1_BEDONLY = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Tabla"); - LSTR MSG_PREHEAT_1_SETTINGS = _UxGT("Ön Isınma ") PREHEAT_1_LABEL _UxGT(" Ayarlar"); + LSTR MSG_PREHEAT_1 = _UxGT("ÖnIsıtma ") PREHEAT_1_LABEL; // Çalışma gerekli Hata + LSTR MSG_PREHEAT_1_H = _UxGT("ÖnIsıtma ") PREHEAT_1_LABEL " ~"; // Çalışma gerekli Hata + LSTR MSG_PREHEAT_1_END = _UxGT("ÖnIsıtma ") PREHEAT_1_LABEL _UxGT(" Nozul"); // Çalışma gerekli Hata + LSTR MSG_PREHEAT_1_END_E = _UxGT("ÖnIsıtma ") PREHEAT_1_LABEL _UxGT(" Nozul ~"); // Çalışma gerekli Hata + LSTR MSG_PREHEAT_1_ALL = _UxGT("ÖnIsıtma ") PREHEAT_1_LABEL _UxGT(" Tüm"); // Çalışma gerekli Hata + LSTR MSG_PREHEAT_1_BEDONLY = _UxGT("ÖnIsıtma ") PREHEAT_1_LABEL _UxGT(" Tabla"); // Çalışma gerekli Hata + LSTR MSG_PREHEAT_1_SETTINGS = _UxGT("ÖnIsıtma ") PREHEAT_1_LABEL _UxGT(" Ayar"); // Çalışma gerekli Hata - LSTR MSG_PREHEAT_M = _UxGT("Ön Isınma $"); - LSTR MSG_PREHEAT_M_H = _UxGT("Ön Isınma $ ~"); - LSTR MSG_PREHEAT_M_END = _UxGT("Ön Isınma $ Nozul"); - LSTR MSG_PREHEAT_M_END_E = _UxGT("Ön Isınma $ Nozul ~"); - LSTR MSG_PREHEAT_M_ALL = _UxGT("Ön Isınma $ Tüm"); - LSTR MSG_PREHEAT_M_BEDONLY = _UxGT("Ön Isınma $ Tabla"); - LSTR MSG_PREHEAT_M_SETTINGS = _UxGT("Ön Isınma $ Ayarlar"); + LSTR MSG_PREHEAT_M = _UxGT("ÖnIsıtma $"); // Çalışma gerekli Hata + LSTR MSG_PREHEAT_M_H = _UxGT("ÖnIsıtma $ ~"); // Çalışma gerekli Hata + LSTR MSG_PREHEAT_M_END = _UxGT("ÖnIsıtma $ Nozul"); // Çalışma gerekli Hata + LSTR MSG_PREHEAT_M_END_E = _UxGT("ÖnIsıtma $ Nozul ~"); // Çalışma gerekli Hata + LSTR MSG_PREHEAT_M_ALL = _UxGT("ÖnIsıtma $ Tüm"); // Çalışma gerekli Hata + LSTR MSG_PREHEAT_M_BEDONLY = _UxGT("ÖnIsıtma $ Tabla"); // Çalışma gerekli Hata + LSTR MSG_PREHEAT_M_SETTINGS = _UxGT("ÖnIsıtma $ Ayar"); // Çalışma gerekli Hata - LSTR MSG_PREHEAT_CUSTOM = _UxGT("Özel Ön Isınma"); + LSTR MSG_PREHEAT_HOTEND = _UxGT("Nozul Ön Isıtma"); + LSTR MSG_PREHEAT_CUSTOM = _UxGT("Özel Ön Isıtma"); LSTR MSG_COOLDOWN = _UxGT("Soğut/(Durdur)"); LSTR MSG_CUTTER_FREQUENCY = _UxGT("Frekans"); @@ -123,8 +138,8 @@ namespace LanguageNarrow_tr { LSTR MSG_LASER_TOGGLE = _UxGT("Lazer Değiştir"); LSTR MSG_LASER_EVAC_TOGGLE = _UxGT("Üfleyici Değiştir"); LSTR MSG_LASER_ASSIST_TOGGLE = _UxGT("Hava Desteği"); - LSTR MSG_LASER_PULSE_MS = _UxGT("Test Pulse ms"); - LSTR MSG_LASER_FIRE_PULSE = _UxGT("Fire Pulse"); + LSTR MSG_LASER_PULSE_MS = _UxGT("Test Darbesi ms"); + LSTR MSG_LASER_FIRE_PULSE = _UxGT("Atış Darbe"); LSTR MSG_FLOWMETER_FAULT = _UxGT("Soğutucu Akış Hatası"); LSTR MSG_SPINDLE_TOGGLE = _UxGT("Spindle Değiştir"); LSTR MSG_SPINDLE_EVAC_TOGGLE = _UxGT("Vakum Değiştir"); @@ -136,7 +151,7 @@ namespace LanguageNarrow_tr { LSTR MSG_RETRACT = _UxGT("Geri Çek"); LSTR MSG_MOVE_AXIS = _UxGT("Eksen Hareketleri"); LSTR MSG_BED_LEVELING = _UxGT("Tabla Seviyeleme"); - LSTR MSG_LEVEL_BED = _UxGT("Tabla Seviyesi"); + LSTR MSG_LEVEL_BED = _UxGT("Tablayı Seviyele"); LSTR MSG_BED_TRAMMING = _UxGT("Tabla Hizalama"); LSTR MSG_BED_TRAMMING_MANUAL = _UxGT("Manuel Hizalama"); LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Prob tetiklenene kadar tablayı ayarlayın."); @@ -163,6 +178,7 @@ namespace LanguageNarrow_tr { LSTR MSG_MESH_CENTER = _UxGT("Merkez Alan"); LSTR MSG_MESH_EDIT_Z = _UxGT("Z Değeri"); LSTR MSG_MESH_CANCEL = _UxGT("Mesh iptal edildi"); + LSTR MSG_MESH_RESET = _UxGT("Mesh reset"); LSTR MSG_CUSTOM_COMMANDS = _UxGT("Özel Komutlar"); LSTR MSG_M48_TEST = _UxGT("M48 Prob Testi"); LSTR MSG_M48_POINT = _UxGT("M48 Nokta"); @@ -189,8 +205,8 @@ namespace LanguageNarrow_tr { LSTR MSG_UBL_BC_INSERT2 = _UxGT("Ölçüm"); LSTR MSG_UBL_BC_REMOVE = _UxGT("Tablayı Kaldır & Ölç"); LSTR MSG_UBL_MOVING_TO_NEXT = _UxGT("Sonrakine Git"); - LSTR MSG_UBL_ACTIVATE_MESH = _UxGT("UBL'yi Etkinleştir"); - LSTR MSG_UBL_DEACTIVATE_MESH = _UxGT("UBL'yi Etkisizleştir"); + LSTR MSG_UBL_ACTIVATE_MESH = _UxGT("UBL'i Aktifleştir"); + LSTR MSG_UBL_DEACTIVATE_MESH = _UxGT("UBL'i Pasifleştir"); LSTR MSG_UBL_SET_TEMP_BED = _UxGT("Tabla Sıcaklığı"); LSTR MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Tabla Sıcaklığı"); LSTR MSG_UBL_SET_TEMP_HOTEND = _UxGT("Nozul Sıcaklığı"); @@ -205,8 +221,8 @@ namespace LanguageNarrow_tr { LSTR MSG_UBL_BUILD_COLD_MESH = _UxGT("Soğuk Mesh Oluştur"); LSTR MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Mesh Yükseklik Ayarı"); LSTR MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Yükseklik miktarı"); - LSTR MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Doğrulama Mesh"); - LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("Doğrulama Mesh ($)"); + LSTR MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Mesh Doğrulama"); + LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("Mesh Doğrulama ($)"); LSTR MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Özel Mesh Doğrulama"); LSTR MSG_G26_HEATING_BED = _UxGT("G26 Isıtma Tablası"); LSTR MSG_G26_HEATING_NOZZLE = _UxGT("G26 Isıtma Memesi"); @@ -222,40 +238,41 @@ namespace LanguageNarrow_tr { LSTR MSG_UBL_MESH_LEVEL = _UxGT("Mesh Seviyesi"); LSTR MSG_UBL_SIDE_POINTS = _UxGT("Yan Noktalar"); LSTR MSG_UBL_MAP_TYPE = _UxGT("Haritalama Türü"); - LSTR MSG_UBL_OUTPUT_MAP = _UxGT("Mesh Çıkış Haritası"); + LSTR MSG_UBL_OUTPUT_MAP = _UxGT("Mesh Çikis Haritası"); // Çalışma gerekli Hata LSTR MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Host için Çıktı"); LSTR MSG_UBL_OUTPUT_MAP_CSV = _UxGT("CSV için Çıktı"); LSTR MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Yedekleme Kapalı"); LSTR MSG_UBL_INFO_UBL = _UxGT("UBL Çıkış Bilgisi"); LSTR MSG_UBL_FILLIN_AMOUNT = _UxGT("Dolgu Miktarı"); LSTR MSG_UBL_MANUAL_FILLIN = _UxGT("Manuel Dolgu"); - LSTR MSG_UBL_SMART_FILLIN = _UxGT("Akıllı Dogu"); + LSTR MSG_UBL_SMART_FILLIN = _UxGT("Akıllı Dolgu"); LSTR MSG_UBL_FILLIN_MESH = _UxGT("Mesh Dolgu"); LSTR MSG_UBL_MESH_FILLED = _UxGT("Eksikler Dolduruldu"); LSTR MSG_UBL_MESH_INVALID = _UxGT("Geçersiz Mesh"); - LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Tümünü Geçersiz Kıl"); - LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Yakını Geçersiz Kıl"); - LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Tümünü İnce Ayarla"); + LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Tumunu Gecersiz Kil"); // Çalışma gerekli Hata + LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Yakini Gecersiz Kil"); // Çalışma gerekli Hata + LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Tumunu İnce Ayarla"); // Çalışma gerekli Hata LSTR MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Yakını İnce Ayarla"); LSTR MSG_UBL_STORAGE_MESH_MENU = _UxGT("Mesh Depolama"); LSTR MSG_UBL_STORAGE_SLOT = _UxGT("Bellek Yuvası"); LSTR MSG_UBL_LOAD_MESH = _UxGT("Tabla Mesh Yükle"); - LSTR MSG_UBL_SAVE_MESH = _UxGT("Tabla Mesh Kayıt Et"); + LSTR MSG_UBL_SAVE_MESH = _UxGT("Tabla Mesh Kaydet"); LSTR MSG_UBL_INVALID_SLOT = _UxGT("Önce Mesh Yuvası Seç"); LSTR MSG_MESH_LOADED = _UxGT("Mesh %i yüklendi"); LSTR MSG_MESH_SAVED = _UxGT("Mesh %i kayıtlandı"); + LSTR MSG_MESH_ACTIVE = _UxGT("%i mesh aktif"); LSTR MSG_UBL_NO_STORAGE = _UxGT("Depolama Yok"); - LSTR MSG_UBL_SAVE_ERROR = _UxGT("Hata: UBL Kayıt"); - LSTR MSG_UBL_RESTORE_ERROR = _UxGT("Hata: UBL Yenileme"); + LSTR MSG_UBL_SAVE_ERROR = _UxGT("UBL Kaydetme Hatası"); + LSTR MSG_UBL_RESTORE_ERROR = _UxGT("UBL Geri Yükleme Hatası"); LSTR MSG_UBL_Z_OFFSET = _UxGT("Z-Ofset: "); LSTR MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Ofset Durduruldu"); LSTR MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Adım Adım UBL"); LSTR MSG_UBL_1_BUILD_COLD_MESH = _UxGT("1.Soğuk Mesh Oluştur"); - LSTR MSG_UBL_2_SMART_FILLIN = _UxGT("2.Akıllı Dogu"); - LSTR MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Doğrulama Mesh"); - LSTR MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Tümünü İnce Ayarla"); - LSTR MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Doğrulama Mesh"); - LSTR MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Tümünü İnce Ayarla"); + LSTR MSG_UBL_2_SMART_FILLIN = _UxGT("2.Akıllı Dolgu"); + LSTR MSG_UBL_3_VALIDATE_MESH_MENU = _UxGT("3.Mesh Dogrulama"); // Çalışma gerekli Hata + LSTR MSG_UBL_4_FINE_TUNE_ALL = _UxGT("4.Tumunu ince Ayarla"); // Çalışma gerekli Hata + LSTR MSG_UBL_5_VALIDATE_MESH_MENU = _UxGT("5.Mesh Dogrulama"); // Çalışma gerekli Hata + LSTR MSG_UBL_6_FINE_TUNE_ALL = _UxGT("6.Tumunu ince Ayarla"); // Çalışma gerekli Hata LSTR MSG_UBL_7_SAVE_MESH = _UxGT("7.Tabla Mesh Kaydet"); LSTR MSG_LED_CONTROL = _UxGT("LED Kontrolü"); @@ -293,8 +310,9 @@ namespace LanguageNarrow_tr { LSTR MSG_MOVE_N_MM = _UxGT("$mm"); LSTR MSG_MOVE_N_IN = _UxGT("$in"); LSTR MSG_MOVE_N_DEG = _UxGT("$") LCD_STR_DEGREE; + LSTR MSG_LIVE_MOVE = _UxGT("Canlı Hareket"); LSTR MSG_SPEED = _UxGT("Hız"); - LSTR MSG_BED_Z = _UxGT("Z Mesafesi"); + LSTR MSG_MESH_Z_OFFSET = _UxGT("Z Mesafesi"); LSTR MSG_NOZZLE = _UxGT("Nozul"); LSTR MSG_NOZZLE_N = _UxGT("Nozul ~"); LSTR MSG_NOZZLE_PARKED = _UxGT("Nozul Park Edildi"); @@ -311,7 +329,7 @@ namespace LanguageNarrow_tr { LSTR MSG_STORED_FAN_N = _UxGT("Depolanan Fan ~"); LSTR MSG_EXTRA_FAN_SPEED = _UxGT("Ekstra Fan Hızı"); LSTR MSG_EXTRA_FAN_SPEED_N = _UxGT("Ekstra Fan Hızı ~"); - LSTR MSG_CONTROLLER_FAN = _UxGT("Kontrolör Fanı"); + LSTR MSG_CONTROLLER_FAN = _UxGT("Sistem Fan Kontrol"); LSTR MSG_CONTROLLER_FAN_IDLE_SPEED = _UxGT("Rölanti Hızı"); LSTR MSG_CONTROLLER_FAN_AUTO_ON = _UxGT("Otomatik Mod"); LSTR MSG_CONTROLLER_FAN_SPEED = _UxGT("Aktif Hız"); @@ -323,61 +341,76 @@ namespace LanguageNarrow_tr { LSTR MSG_MAX = " " LCD_STR_THERMOMETER _UxGT(" Max"); LSTR MSG_FACTOR = " " LCD_STR_THERMOMETER _UxGT(" Çarpan"); LSTR MSG_AUTOTEMP = _UxGT("Oto. Sıcaklık"); + LSTR MSG_TIMEOUT = _UxGT("Zaman aşımı"); LSTR MSG_LCD_ON = _UxGT("Açık"); LSTR MSG_LCD_OFF = _UxGT("Kapalı"); - LSTR MSG_PID_AUTOTUNE = _UxGT("PID Kalibrasyon"); - LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Kalibrasyon *"); + LSTR MSG_PID_AUTOTUNE = _UxGT("PID Kalibrasyonu"); + LSTR MSG_PID_AUTOTUNE_E = _UxGT("* PID Kalibrasyonu"); LSTR MSG_PID_CYCLE = _UxGT("PID Döngüleri"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID ayarı yapıldı"); - LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("PID Autotune başarısız!"); - LSTR MSG_BAD_EXTRUDER_NUM = _UxGT("Kötü ekstruder."); + LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Kalibrasyon başarısız!"); + LSTR MSG_BAD_HEATER_ID = _UxGT("Kötü ekstruder."); LSTR MSG_TEMP_TOO_HIGH = _UxGT("Sıcaklık çok yüksek."); - LSTR MSG_TIMEOUT = _UxGT("Zaman aşımı."); - LSTR MSG_PID_BAD_EXTRUDER_NUM = _UxGT("Otomatik ayar başarısız! Kötü ekstruder."); - LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Otomatik ayar başarısız! Sıcaklık çok yüksek."); - LSTR MSG_PID_TIMEOUT = _UxGT("Otomatik ayar başarısız! Zaman aşımı."); - LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Isı kaybı test ediliyor"); - LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Otomatik Ayarı"); - LSTR MSG_MPC_EDIT = _UxGT("Düzenle * MPC"); - LSTR MSG_MPC_POWER_E = _UxGT("Güç *"); - LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Blok C *"); - LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensör çözünürlüğü *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ortam h *"); - LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Amb. h fan *"); + LSTR MSG_TEMP_TOO_LOW = _UxGT("Sıcaklık çok düşük"); + LSTR MSG_PID_BAD_HEATER_ID = _UxGT("Kalibrasyon başarısız! Kötü ekstruder."); + LSTR MSG_PID_TEMP_TOO_HIGH = _UxGT("Kalibrasyon başarısız! Sıcaklık çok yüksek."); + LSTR MSG_PID_TIMEOUT = _UxGT("Kalibrasyon başarısız! Zaman aşımı."); + LSTR MSG_MPC_MEASURING_AMBIENT = _UxGT("Isı kaybı testi"); + LSTR MSG_MPC_HEATING_PAST_200 = _UxGT(">200C Isıtma"); + LSTR MSG_MPC_COOLING_TO_AMBIENT = _UxGT("Ortam ısısına soğutma"); + LSTR MSG_MPC_AUTOTUNE = _UxGT("MPC Kalibrasyonu"); + LSTR MSG_MPC_EDIT = _UxGT("* MPC Düzenle"); + LSTR MSG_MPC_POWER = _UxGT("Isıtıcı Gücü"); + LSTR MSG_MPC_POWER_E = _UxGT("* Gücü"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY = _UxGT("Isı Kapasitesi"); + LSTR MSG_MPC_BLOCK_HEAT_CAPACITY_E = _UxGT("Isı Kap. *"); + LSTR MSG_SENSOR_RESPONSIVENESS = _UxGT("Sensör Hassasiyeti"); + LSTR MSG_SENSOR_RESPONSIVENESS_E = _UxGT("Sensör Has. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF = _UxGT("Ortam Kats."); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_E = _UxGT("Ortam Ka. *"); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN = _UxGT("Fan kats."); + LSTR MSG_MPC_AMBIENT_XFER_COEFF_FAN_E = _UxGT("Fan kats. *"); LSTR MSG_SELECT_E = _UxGT("Seç *"); LSTR MSG_ACC = _UxGT("İvme"); - LSTR MSG_JERK = _UxGT("Sarsma"); - LSTR MSG_VA_JERK = _UxGT("V") STR_A _UxGT(" Sarsma"); - LSTR MSG_VB_JERK = _UxGT("V") STR_B _UxGT(" Sarsma"); - LSTR MSG_VC_JERK = _UxGT("V") STR_C _UxGT(" Sarsma"); - LSTR MSG_VN_JERK = _UxGT("Max @ Sarsma"); - LSTR MSG_VE_JERK = _UxGT("Max E Sarsma"); + LSTR MSG_JERK = _UxGT("Sarsım"); + LSTR MSG_VA_JERK = _UxGT("Max ") STR_A _UxGT(" Sarsımı"); + LSTR MSG_VB_JERK = _UxGT("Max ") STR_B _UxGT(" Sarsımı"); + LSTR MSG_VC_JERK = _UxGT("Max ") STR_C _UxGT(" Sarsımı"); + LSTR MSG_VN_JERK = _UxGT("Max @ Sarsımı"); + LSTR MSG_VE_JERK = _UxGT("Max E Sarsımı"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Jonksiyon Sapması"); - LSTR MSG_MAX_SPEED = _UxGT("Hız Vektörü"); - LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Hız"); - LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Hız"); - LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Hız"); - LSTR MSG_VMAX_N = _UxGT("Max @ Hız"); - LSTR MSG_VMAX_E = _UxGT("Max E Hız"); - LSTR MSG_VMAX_EN = _UxGT("Max * Hız"); + LSTR MSG_STEP_SMOOTHING = _UxGT("Adım Yumuşatma"); + LSTR MSG_MAX_SPEED = _UxGT("Max Hız (mm/s)"); + LSTR MSG_VMAX_A = _UxGT("Max ") STR_A _UxGT(" Hızı"); + LSTR MSG_VMAX_B = _UxGT("Max ") STR_B _UxGT(" Hızı"); + LSTR MSG_VMAX_C = _UxGT("Max ") STR_C _UxGT(" Hızı"); + LSTR MSG_VMAX_N = _UxGT("Max @ Hızı"); + LSTR MSG_VMAX_E = _UxGT("Max E Hızı"); + LSTR MSG_VMAX_EN = _UxGT("Max * Hızı"); LSTR MSG_VMIN = _UxGT("Min Hız"); LSTR MSG_VTRAV_MIN = _UxGT("Min Gezme Hızı"); - LSTR MSG_ACCELERATION = _UxGT("Ivme"); - LSTR MSG_AMAX_A = _UxGT("Max ") STR_A _UxGT(" İvme"); - LSTR MSG_AMAX_B = _UxGT("Max ") STR_B _UxGT(" İvme"); - LSTR MSG_AMAX_C = _UxGT("Max ") STR_C _UxGT(" İvme"); - LSTR MSG_AMAX_N = _UxGT("Max @ İvme"); - LSTR MSG_AMAX_E = _UxGT("Max E İvme"); - LSTR MSG_AMAX_EN = _UxGT("Max * İvme"); + LSTR MSG_ACCELERATION = _UxGT("İvme"); + LSTR MSG_AMAX_A = _UxGT("Max ") STR_A _UxGT(" İvmesi"); + LSTR MSG_AMAX_B = _UxGT("Max ") STR_B _UxGT(" İvmesi"); + LSTR MSG_AMAX_C = _UxGT("Max ") STR_C _UxGT(" İvmesi"); + LSTR MSG_AMAX_N = _UxGT("Max @ İvmesi"); + LSTR MSG_AMAX_E = _UxGT("Max E İvmesi"); + LSTR MSG_AMAX_EN = _UxGT("Max * İvmesi"); LSTR MSG_A_RETRACT = _UxGT("G.Çekme Hızı"); LSTR MSG_A_TRAVEL = _UxGT("Gezinme Hızı"); - LSTR MSG_INPUT_SHAPING = _UxGT("Girdi Şekillendirme"); - LSTR MSG_SHAPING_ENABLE = _UxGT("Biçimleme @ aktif"); - LSTR MSG_SHAPING_DISABLE = _UxGT("Biçimleme @ pasif"); + LSTR MSG_INPUT_SHAPING = _UxGT("Input Shaping"); + LSTR MSG_SHAPING_ENABLE = _UxGT("@ Biçimlemeyi Aç"); + LSTR MSG_SHAPING_DISABLE = _UxGT("@ Biçimlemeyi Kapat"); LSTR MSG_SHAPING_FREQ = _UxGT("@ frekans"); LSTR MSG_SHAPING_ZETA = _UxGT("@ sönümleme"); + LSTR MSG_SHAPING_A_FREQ = STR_A _UxGT(" frekansı"); // ProUI + LSTR MSG_SHAPING_B_FREQ = STR_B _UxGT(" frekansı"); // ProUI + LSTR MSG_SHAPING_C_FREQ = STR_C _UxGT(" frekansı"); // ProUI + LSTR MSG_SHAPING_A_ZETA = STR_A _UxGT(" sönümleme"); // ProUI + LSTR MSG_SHAPING_B_ZETA = STR_B _UxGT(" sönümleme"); // ProUI + LSTR MSG_SHAPING_C_ZETA = STR_C _UxGT(" sönümleme"); // ProUI LSTR MSG_XY_FREQUENCY_LIMIT = _UxGT("XY Frek. Sınırı"); - LSTR MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Min FR Factor"); + LSTR MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Min FR Factörü"); LSTR MSG_STEPS_PER_MM = _UxGT("Adım/mm"); LSTR MSG_A_STEPS = STR_A _UxGT(" adım/mm"); LSTR MSG_B_STEPS = STR_B _UxGT(" adım/mm"); @@ -388,6 +421,7 @@ namespace LanguageNarrow_tr { LSTR MSG_TEMPERATURE = _UxGT("Sıcaklık"); LSTR MSG_MOTION = _UxGT("Hareket"); LSTR MSG_FILAMENT = _UxGT("Filaman"); + LSTR MSG_FILAMENT_EN = _UxGT("Filaman *"); LSTR MSG_VOLUMETRIC_ENABLED = _UxGT("Ekstrüzyon/mm") SUPERSCRIPT_THREE; LSTR MSG_VOLUMETRIC_LIMIT = _UxGT("E Limit in mm") SUPERSCRIPT_THREE; LSTR MSG_VOLUMETRIC_LIMIT_E = _UxGT("E Limit *"); @@ -396,16 +430,19 @@ namespace LanguageNarrow_tr { LSTR MSG_FILAMENT_UNLOAD = _UxGT("Çıkart mm"); LSTR MSG_FILAMENT_LOAD = _UxGT("Yükle mm"); LSTR MSG_SEGMENTS_PER_SECOND = _UxGT("Segment/Sn"); - LSTR MSG_DRAW_MIN_X = _UxGT("Draw Min X"); - LSTR MSG_DRAW_MAX_X = _UxGT("Draw Max X"); - LSTR MSG_DRAW_MIN_Y = _UxGT("Draw Min Y"); - LSTR MSG_DRAW_MAX_Y = _UxGT("Draw Max Y"); + LSTR MSG_DRAW_MIN_X = _UxGT("Min X Çiz"); + LSTR MSG_DRAW_MAX_X = _UxGT("Max X Çiz"); + LSTR MSG_DRAW_MIN_Y = _UxGT("Min Y Çİz"); + LSTR MSG_DRAW_MAX_Y = _UxGT("Max Y Çiz"); LSTR MSG_MAX_BELT_LEN = _UxGT("Max Kayış Boyu"); - LSTR MSG_ADVANCE_K = _UxGT("K İlerlet"); - LSTR MSG_ADVANCE_K_E = _UxGT("K İlerlet *"); + LSTR MSG_LINEAR_ADVANCE = _UxGT("Doğrusal İlerleme"); + LSTR MSG_ADVANCE_K = _UxGT("K. Değeri"); + LSTR MSG_ADVANCE_K_E = _UxGT("K. Değeri *"); LSTR MSG_CONTRAST = _UxGT("LCD Kontrast"); LSTR MSG_BRIGHTNESS = _UxGT("LCD Parlaklığı"); LSTR MSG_SCREEN_TIMEOUT = _UxGT("LCD Zaman Aşımı (m)"); + LSTR MSG_HOTEND_TEMP_GRAPH = _UxGT("Nozul Isı Grafiği"); + LSTR MSG_BED_TEMP_GRAPH = _UxGT("Tablo Isı Grafiği"); LSTR MSG_BRIGHTNESS_OFF = _UxGT("Arka Işık Kapalı"); LSTR MSG_STORE_EEPROM = _UxGT("Hafızaya Al"); LSTR MSG_LOAD_EEPROM = _UxGT("Hafızadan Yükle"); @@ -414,8 +451,9 @@ namespace LanguageNarrow_tr { LSTR MSG_ERR_EEPROM_CRC = _UxGT("Hata: EEPROM CRC"); LSTR MSG_ERR_EEPROM_SIZE = _UxGT("Hata: EEPROM Boyutu"); LSTR MSG_ERR_EEPROM_VERSION = _UxGT("Hata: EEPROM Sürümü"); + LSTR MSG_ERR_EEPROM_CORRUPT = _UxGT("Hata: EEPROM Bozuk"); LSTR MSG_SETTINGS_STORED = _UxGT("Ayarlar Kaydedildi"); - LSTR MSG_MEDIA_UPDATE = _UxGT("SD Güncellemesi"); + LSTR MSG_HAS_PREVIEW = _UxGT("Önizleme var"); LSTR MSG_RESET_PRINTER = _UxGT("Yazıcıyı Resetle"); LSTR MSG_REFRESH = LCD_STR_REFRESH _UxGT("Yenile"); LSTR MSG_INFO_SCREEN = _UxGT("Bilgi Ekranı"); @@ -429,7 +467,7 @@ namespace LanguageNarrow_tr { LSTR MSG_CURRENT = _UxGT("Akım"); LSTR MSG_VOLTAGE = _UxGT("Voltaj"); LSTR MSG_POWER = _UxGT("Güç"); - LSTR MSG_START_PRINT = _UxGT("Yaz. Başlat"); + LSTR MSG_START_PRINT = _UxGT("Yazdırmayı Başlat"); LSTR MSG_BUTTON_NEXT = _UxGT("İleri"); LSTR MSG_BUTTON_INIT = _UxGT("Başlat"); LSTR MSG_BUTTON_STOP = _UxGT("Durdur"); @@ -456,16 +494,15 @@ namespace LanguageNarrow_tr { LSTR MSG_RESUME_PRINT = _UxGT("Baskıyı Sürdür"); LSTR MSG_STOP_PRINT = _UxGT("Baskıyı Durdur"); LSTR MSG_OUTAGE_RECOVERY = _UxGT("Kesinti Kurtarma"); - - LSTR MSG_HOST_START_PRINT = _UxGT("Host Başlatma"); + LSTR MSG_RESUME_BED_TEMP = _UxGT("Tabla Isıtmayı Sürdür"); + LSTR MSG_HOST_START_PRINT = _UxGT("Host Başlat"); LSTR MSG_PRINTING_OBJECT = _UxGT("Nesneyi Yazdır"); LSTR MSG_CANCEL_OBJECT = _UxGT("Nesneyi İptal Et"); LSTR MSG_CANCEL_OBJECT_N = _UxGT("Nesneyi İptal Et {"); LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("İşe Devam Et"); - LSTR MSG_MEDIA_MENU = MEDIA_TYPE_EN _UxGT(" Yazdır"); + LSTR MSG_MEDIA_MENU = _UxGT("Medyayı Yazdır"); LSTR MSG_TURN_OFF = _UxGT("Şimdi kapat"); LSTR MSG_END_LOOPS = _UxGT("Son Döngüler"); - LSTR MSG_NO_MEDIA = _UxGT("SD Kart Yok!"); LSTR MSG_DWELL = _UxGT("Uyku..."); LSTR MSG_USERWAIT = _UxGT("Devam için tıkla..."); @@ -481,7 +518,7 @@ namespace LanguageNarrow_tr { LSTR MSG_STOPPED = _UxGT("DURDURULDU. "); LSTR MSG_FWRETRACT = _UxGT("Yazılım Geri Çekme"); LSTR MSG_CONTROL_RETRACT = _UxGT("Geri Çek mm"); - LSTR MSG_CONTROL_RETRACT_SWAP = _UxGT("Swap Re.mm"); + LSTR MSG_CONTROL_RETRACT_SWAP = _UxGT("GÇ. Değiş mm"); LSTR MSG_CONTROL_RETRACTF = _UxGT("Geri Çekme V"); LSTR MSG_CONTROL_RETRACT_ZHOP = _UxGT("Atlama mm"); LSTR MSG_CONTROL_RETRACT_RECOVER = _UxGT("Geri Çek. mm"); @@ -498,6 +535,7 @@ namespace LanguageNarrow_tr { LSTR MSG_SINGLENOZZLE_WIPE_RETRACT = _UxGT("Geri Çekme Sil"); LSTR MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Geri Çekme Hızı"); LSTR MSG_FILAMENT_PARK_ENABLED = _UxGT("Kafa Park"); + LSTR MSG_PARK_FAILED = _UxGT("Kafa park edilemiyor"); LSTR MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Kurtarma Hızı"); LSTR MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Fan Hızı"); LSTR MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Fan Süresi"); @@ -514,9 +552,11 @@ namespace LanguageNarrow_tr { LSTR MSG_FILAMENTUNLOAD = _UxGT("Filaman Çıkart"); LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Filaman Çıkart *"); LSTR MSG_FILAMENTUNLOAD_ALL = _UxGT("Tümünü Çıkart"); - LSTR MSG_ATTACH_MEDIA = _UxGT("Ekle ") MEDIA_TYPE_EN; - LSTR MSG_CHANGE_MEDIA = _UxGT("Değiştir ") MEDIA_TYPE_EN; - LSTR MSG_RELEASE_MEDIA = _UxGT("Çıkart ") MEDIA_TYPE_EN; + LSTR MSG_ATTACH_MEDIA = _UxGT("Medyayı Ekle"); + LSTR MSG_ATTACH_SD_MEDIA = _UxGT("SD Kartı takın"); + LSTR MSG_ATTACH_USB_MEDIA = _UxGT("USB Sürücüyü takın"); + LSTR MSG_CHANGE_MEDIA = _UxGT("Medyayı Değiştir"); + LSTR MSG_RELEASE_MEDIA = _UxGT("Medyayı Çıkart"); LSTR MSG_ZPROBE_OUT = _UxGT("Z Prob Tablayı Geçti"); LSTR MSG_SKEW_FACTOR = _UxGT("Çarpıklık Faktörü"); LSTR MSG_BLTOUCH = _UxGT("BLTouch"); @@ -539,13 +579,15 @@ namespace LanguageNarrow_tr { LSTR MSG_TOUCHMI_SAVE = _UxGT("Kaydet"); LSTR MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("TouchMI Aç"); LSTR MSG_MANUAL_DEPLOY = _UxGT("Z-Probe Aç"); + LSTR MSG_MANUAL_PENUP = _UxGT("Kalem yukarı"); + LSTR MSG_MANUAL_PENDOWN = _UxGT("Kalem aşağı"); LSTR MSG_MANUAL_STOW = _UxGT("Z-Probe Kapat"); - LSTR MSG_HOME_FIRST = _UxGT("Önce %s%s%s Sıfırla"); + LSTR MSG_HOME_FIRST = _UxGT("Önce %s Sıfırla"); LSTR MSG_ZPROBE_SETTINGS = _UxGT("Prob Ayarları"); LSTR MSG_ZPROBE_OFFSETS = _UxGT("Prob Ofsetleri"); - LSTR MSG_ZPROBE_XOFFSET = _UxGT("X Prob Ofset"); - LSTR MSG_ZPROBE_YOFFSET = _UxGT("Y Prob Ofset"); - LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Z Prob Ofset"); + LSTR MSG_ZPROBE_XOFFSET = _UxGT("X Prob Ofseti"); + LSTR MSG_ZPROBE_YOFFSET = _UxGT("Y Prob Ofseti"); + LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Z Prob Ofseti"); LSTR MSG_ZPROBE_MARGIN = _UxGT("Prob Payı"); LSTR MSG_Z_FEED_RATE = _UxGT("Z İlerleme Hızı"); LSTR MSG_ENABLE_HS_MODE = _UxGT("HS modunu aç"); @@ -561,8 +603,8 @@ namespace LanguageNarrow_tr { LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("ISI SORUNU"); LSTR MSG_ERR_TEMP_MALFUNCTION = _UxGT("SICAKLIK ARIZASI"); LSTR MSG_ERR_COOLING_FAILED = _UxGT("Soğutma Başarısız"); - LSTR MSG_ERR_MAXTEMP = _UxGT("Hata: MAX.SICAKLIK"); - LSTR MSG_ERR_MINTEMP = _UxGT("Hata: MIN.SICAKLIK"); + LSTR MSG_ERR_MAXTEMP = _UxGT("HATA:MAX.SICAK."); + LSTR MSG_ERR_MINTEMP = _UxGT("HATA:MIN.SICAK."); LSTR MSG_HALTED = _UxGT("YAZICI DURDURULDU"); LSTR MSG_PLEASE_WAIT = _UxGT("Lütfen bekleyin..."); LSTR MSG_PLEASE_RESET = _UxGT("Lütfen Resetleyin"); @@ -571,12 +613,14 @@ namespace LanguageNarrow_tr { LSTR MSG_COOLING = _UxGT("Soğuyor..."); LSTR MSG_BED_HEATING = _UxGT("Tabla Isınıyor..."); LSTR MSG_BED_COOLING = _UxGT("Tabla Soğuyor..."); + LSTR MSG_BED_ANNEALING = _UxGT("Tavlama..."); LSTR MSG_PROBE_HEATING = _UxGT("Prob ısınıyor..."); LSTR MSG_PROBE_COOLING = _UxGT("Prob Soğuyor..."); LSTR MSG_CHAMBER_HEATING = _UxGT("Kabin Isınıyor..."); LSTR MSG_CHAMBER_COOLING = _UxGT("Kabin Soğuyor..."); LSTR MSG_LASER_COOLING = _UxGT("Lazer Soğuyor..."); LSTR MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibrasyonu"); + LSTR MSG_DELTA_CALIBRATION_IN_PROGRESS = _UxGT("Delta Kalibrasyonu sürüyor"); LSTR MSG_DELTA_CALIBRATE_X = _UxGT("Ayarla X"); LSTR MSG_DELTA_CALIBRATE_Y = _UxGT("Ayarla Y"); LSTR MSG_DELTA_CALIBRATE_Z = _UxGT("Ayarla Z"); @@ -595,6 +639,7 @@ namespace LanguageNarrow_tr { LSTR MSG_MESH_LEVELING = _UxGT("Mesh Seviyeleme"); LSTR MSG_MESH_DONE = _UxGT("Mesh sondalama tamam"); LSTR MSG_INFO_STATS_MENU = _UxGT("İstatistikler"); + LSTR MSG_RESET_STATS = _UxGT("Yazdırma istatistik Sıfırla?"); LSTR MSG_INFO_BOARD_MENU = _UxGT("Kontrolcü Bilgisi"); LSTR MSG_INFO_THERMISTOR_MENU = _UxGT("Termistörler"); LSTR MSG_INFO_EXTRUDERS = _UxGT("Ekstruderler"); @@ -603,37 +648,40 @@ namespace LanguageNarrow_tr { LSTR MSG_INFO_RUNAWAY_OFF = _UxGT("Kaçak İzleme: KAPALI"); LSTR MSG_INFO_RUNAWAY_ON = _UxGT("Kaçak İzleme: AÇIK"); LSTR MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Hotend Boşta Zamn Aş"); + LSTR MSG_HOTEND_IDLE_DISABLE = _UxGT("Zaman Aşımı Pasif"); + LSTR MSG_HOTEND_IDLE_NOZZLE_TARGET = _UxGT("Meme Boşta Isısı"); + LSTR MSG_HOTEND_IDLE_BED_TARGET = _UxGT("Tabla Boşta Isısı"); LSTR MSG_FAN_SPEED_FAULT = _UxGT("Fan hızı hatası"); - LSTR MSG_CASE_LIGHT = _UxGT("Aydınlatmayı Aç"); + LSTR MSG_CASE_LIGHT = _UxGT("Aydınlatma"); LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Işık Parlaklğı"); - LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Yanlış Yazıcı"); + LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("HATALI YAZICI"); - LSTR MSG_COLORS_GET = _UxGT("Renk Al"); - LSTR MSG_COLORS_SELECT = _UxGT("Renkleri Seç"); - LSTR MSG_COLORS_APPLIED = _UxGT("Uygulanan renkler"); - LSTR MSG_COLORS_RED = _UxGT("Kırmızı"); - LSTR MSG_COLORS_GREEN = _UxGT("Yeşil"); - LSTR MSG_COLORS_BLUE = _UxGT("Mavi"); - LSTR MSG_COLORS_WHITE = _UxGT("Beyaz"); - LSTR MSG_UI_LANGUAGE = _UxGT("UI Dili"); - LSTR MSG_SOUND_ENABLE = _UxGT("Sesi etkinleştir"); - LSTR MSG_LOCKSCREEN = _UxGT("Kilit Ekranı"); - LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Yazıcı Kilitlendi,"); - LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Açmak için kaydırın."); - LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Y.Başlatma bekleyin."); + LSTR MSG_COLORS_GET = _UxGT("Renk Al"); // ProUI + LSTR MSG_COLORS_SELECT = _UxGT("Renkleri Seç"); // ProUI + LSTR MSG_COLORS_APPLIED = _UxGT("Uygulanan renkler"); // ProUI + LSTR MSG_COLORS_RED = _UxGT("Kırmızı"); // ProUI / JyersUI + LSTR MSG_COLORS_GREEN = _UxGT("Yeşil"); // ProUI / JyersUI + LSTR MSG_COLORS_BLUE = _UxGT("Mavi"); // ProUI / JyersUI + LSTR MSG_COLORS_WHITE = _UxGT("Beyaz"); // ProUI + LSTR MSG_UI_LANGUAGE = _UxGT("UI Dili"); // ProUI + LSTR MSG_SOUND_ENABLE = _UxGT("Sesi etkinleştir"); // ProUI + LSTR MSG_LOCKSCREEN = _UxGT("Kilit Ekranı"); // ProUI + LSTR MSG_LOCKSCREEN_LOCKED = _UxGT("Yazıcı Kilitlendi,"); // ProUI + LSTR MSG_LOCKSCREEN_UNLOCK = _UxGT("Açmak için kaydırın."); // ProUI + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Y.Başlatma bekleyin."); // ProUI + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Medya Yok"); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Ön Isıtma Lütfen"); // ProUI - LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Medya Yok"); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Ön Isıtma Lütfen"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Baskı"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Süre"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("En Uzun"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Filaman"); - LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Tamamlanan"); LSTR MSG_INFO_MIN_TEMP = _UxGT("Min Sıc."); 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_N = _UxGT("@ Sürücü %"); LSTR MSG_ERROR_TMC = _UxGT("TMC BAĞLANTI HATASI"); @@ -643,16 +691,13 @@ namespace LanguageNarrow_tr { LSTR MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("FILAMAN YüKLE"); LSTR MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("FILAMAN ÇIKART"); LSTR MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("Seçenekler:"); - LSTR MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Daha Fazla Tasviye"); + LSTR MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Daha Fazla Temizle"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Baskıyı sürdür"); - LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Temizle veya Devam?"); + LSTR MSG_FILAMENT_CHANGE_PURGE_CONTINUE = _UxGT("Temizle veya Devam?"); // ProUI LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Nozul: "); - LSTR MSG_RUNOUT_SENSOR = _UxGT("Runout Sensörü"); + LSTR MSG_RUNOUT_SENSOR = _UxGT("Fil. Sensörü"); LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Aşınma Farkı mm"); - LSTR MSG_RUNOUT_ENABLE = _UxGT("Fil. Sens. Aç"); - LSTR MSG_RUNOUT_ACTIVE = _UxGT("Fil. Sens. Aktif"); - LSTR MSG_INVERT_EXTRUDER = _UxGT("Ekstruder Ters Çevir"); - LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Ekstruder Min Isı"); + LSTR MSG_EXTRUDER_MIN_TEMP = _UxGT("Ekstruder Min Isı"); // ProUI LSTR MSG_FANCHECK = _UxGT("Fan Takosu Kontrolü"); LSTR MSG_KILL_HOMING_FAILED = _UxGT("Sıfırlama Başarısız"); LSTR MSG_LCD_PROBING_FAILED = _UxGT("Probing Başarısız"); @@ -669,14 +714,15 @@ namespace LanguageNarrow_tr { LSTR MSG_MMU2_EJECT_FILAMENT = _UxGT("Filaman Çıkart"); LSTR MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Filaman Çıkart ~"); LSTR MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Filamenti Boşalt"); - LSTR MSG_MMU2_LOADING_FILAMENT = _UxGT("Fil. Yükleniyor %i..."); - LSTR MSG_MMU2_EJECTING_FILAMENT = _UxGT("Fil Çıkartılıyor. ..."); - LSTR MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Fil. Boşaltılıyor...."); + LSTR MSG_MMU2_LOADING_FILAMENT = _UxGT("%i Filaman Yükle..."); + LSTR MSG_MMU2_EJECTING_FILAMENT = _UxGT("Filaman Çek..."); + LSTR MSG_MMU2_UNLOADING_FILAMENT = _UxGT("Filaman Boşalt...."); LSTR MSG_MMU2_ALL = _UxGT("Tümü"); LSTR MSG_MMU2_FILAMENT_N = _UxGT("Filaman ~"); LSTR MSG_MMU2_RESET = _UxGT("MMU Resetle"); - LSTR MSG_MMU2_RESETTING = _UxGT("MMU Resetleniyot..."); - LSTR MSG_MMU2_EJECT_RECOVER = _UxGT("Kaldır, tıkla"); + LSTR MSG_MMU2_RESETTING = _UxGT("MMU Resetleniyor..."); + LSTR MSG_MMU2_EJECT_RECOVER = _UxGT("MMU2 Eject Recover"); + LSTR MSG_MMU2_REMOVE_AND_CLICK = _UxGT("Kaldır ve tıkla..."); LSTR MSG_MIX = _UxGT("Karışım"); LSTR MSG_MIX_COMPONENT_N = _UxGT("Bileşen {"); @@ -717,9 +763,7 @@ namespace LanguageNarrow_tr { LSTR MSG_REMINDER_SAVE_SETTINGS = _UxGT("Kaydetmeyi Unutma!"); LSTR MSG_PASSWORD_REMOVED = _UxGT("Şifre Kaldırıldı"); - // // Filament Değişim ekranları 3 satırlı ekranda 2 satıra kadar - // LSTR MSG_ADVANCED_PAUSE_WAITING = _UxGT(MSG_1_LINE("Sürdürmek İçin Tıkla")); LSTR MSG_PAUSE_PRINT_PARKING = _UxGT(MSG_1_LINE("Park Ediliyor...")); LSTR MSG_FILAMENT_CHANGE_INIT = _UxGT(MSG_1_LINE("Lütfen bekleyiniz...")); @@ -731,9 +775,12 @@ namespace LanguageNarrow_tr { LSTR MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Temizleniyor...")); LSTR MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Bitirmek için Tıkla")); LSTR MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Sürdürülüyor...")); - LSTR MSG_TMC_DRIVERS = _UxGT("TMC Sürücüleri"); LSTR MSG_TMC_CURRENT = _UxGT("Sürücü Akımı"); + LSTR MSG_TMC_ACURRENT = STR_A _UxGT("Sürücü Akımı"); + LSTR MSG_TMC_BCURRENT = STR_B _UxGT("Sürücü Akımı"); + LSTR MSG_TMC_CCURRENT = STR_C _UxGT("Sürücü Akımı"); + LSTR MSG_TMC_ECURRENT = _UxGT("E Sürücü Akımı"); LSTR MSG_TMC_HYBRID_THRS = _UxGT("Hibrit Eşiği"); LSTR MSG_TMC_HOMING_THRS = _UxGT("Sensörsüz Sıfırlama"); LSTR MSG_TMC_STEPPING_MODE = _UxGT("Adım Modu"); @@ -744,6 +791,26 @@ namespace LanguageNarrow_tr { LSTR MSG_BACKLASH_CORRECTION = _UxGT("Düzeltme"); LSTR MSG_BACKLASH_SMOOTHING = _UxGT("Yumuşatma"); + LSTR MSG_FIXED_TIME_MOTION = _UxGT("Sabit Zamanlı Hareket"); + LSTR MSG_FTM_MODE = _UxGT("Hareket Modu:"); + LSTR MSG_FTM_ZV = _UxGT("ZV"); + LSTR MSG_FTM_ZVD = _UxGT("ZVD"); + LSTR MSG_FTM_ZVDD = _UxGT("ZVDD"); + LSTR MSG_FTM_ZVDDD = _UxGT("ZVDDD"); + LSTR MSG_FTM_EI = _UxGT("EI"); + LSTR MSG_FTM_2HEI = _UxGT("2HEI"); + LSTR MSG_FTM_3HEI = _UxGT("3HEI"); + LSTR MSG_FTM_MZV = _UxGT("MZV"); + //LSTR MSG_FTM_ULENDO_FBS = _UxGT("Ulendo FBS"); + //LSTR MSG_FTM_DISCTF = _UxGT("DISCTF"); + LSTR MSG_FTM_DYN_MODE = _UxGT("DF Modu:"); + LSTR MSG_FTM_Z_BASED = _UxGT("Z-based"); + LSTR MSG_FTM_MASS_BASED = _UxGT("Mass-based"); + LSTR MSG_FTM_BASE_FREQ_N = _UxGT("@ Base Freq."); + LSTR MSG_FTM_DFREQ_K_N = _UxGT("@ Dyn. Freq."); + LSTR MSG_FTM_ZETA_N = _UxGT("@ Damping"); + LSTR MSG_FTM_VTOL_N = _UxGT("@ Vib. Level"); + LSTR MSG_LEVEL_X_AXIS = _UxGT("Seviye X Ekseni"); LSTR MSG_AUTO_CALIBRATE = _UxGT("Otomatik Kalibre Et"); LSTR MSG_FTDI_HEATER_TIMEOUT = _UxGT("Boşta kalma zaman aşımı, sıcaklık düştü. Yeniden ısıtmak ve tekrar devam etmek için için Tamam'a basın."); @@ -779,11 +846,48 @@ namespace LanguageNarrow_tr { LSTR MSG_SHORT_DAY = _UxGT("g"); // One character only LSTR MSG_SHORT_HOUR = _UxGT("s"); // One character only LSTR MSG_SHORT_MINUTE = _UxGT("d"); // One character only + + // These strings can be the same in all languages + LSTR MSG_MARLIN = _UxGT("Marlin"); + LSTR MSG_PID_P = _UxGT("PID-P"); + LSTR MSG_PID_P_E = _UxGT("PID-P *"); + LSTR MSG_PID_I = _UxGT("PID-I"); + LSTR MSG_PID_I_E = _UxGT("PID-I *"); + LSTR MSG_PID_D = _UxGT("PID-D"); + LSTR MSG_PID_D_E = _UxGT("PID-D *"); + LSTR MSG_PID_C = _UxGT("PID-C"); + 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_N = _UxGT("@"); + + // DGUS-Specific message strings, not used elsewhere + LSTR DGUS_MSG_NOT_WHILE_PRINTING = _UxGT("Yazdırma sırasında izin verilmez"); + LSTR DGUS_MSG_NOT_WHILE_IDLE = _UxGT("Boştayken izin verilmez"); + LSTR DGUS_MSG_NO_FILE_SELECTED = _UxGT("Seçili dosya yok"); + LSTR DGUS_MSG_EXECUTING_COMMAND = _UxGT("Komut yürütülüyor..."); + LSTR DGUS_MSG_BED_PID_DISABLED = _UxGT("Tabla PID pasif"); + LSTR DGUS_MSG_PID_DISABLED = _UxGT("PID devre dışı"); + LSTR DGUS_MSG_PID_AUTOTUNING = _UxGT("PID otomatik ayarlama..."); + LSTR DGUS_MSG_INVALID_RECOVERY_DATA = _UxGT("Geçersiz kurtarma verileri"); + + LSTR DGUS_MSG_HOMING_REQUIRED = _UxGT("Eve dönüş gerekli"); + LSTR DGUS_MSG_BUSY = _UxGT("Meşgul"); + LSTR DGUS_MSG_HOMING = _UxGT("Eve dönüş..."); + LSTR DGUS_MSG_FW_OUTDATED = _UxGT("DWIN GUI/OS güncelleme gerekli"); + LSTR DGUS_MSG_ABL_REQUIRED = _UxGT("Oto tabla seviyeleme gerekli"); + LSTR DGUS_MSG_PROBING_FAILED = _UxGT("Sondalama başarısız"); + LSTR DGUS_MSG_PROBING_SUCCESS = _UxGT("Sondalama başarılı"); + LSTR DGUS_MSG_RESET_EEPROM = _UxGT("EEPROM sıfırla"); + LSTR DGUS_MSG_WRITE_EEPROM_FAILED = _UxGT("EEPROM yazımı başarısız"); + LSTR DGUS_MSG_READ_EEPROM_FAILED = _UxGT("EEPROM okuma başarısız"); + LSTR DGUS_MSG_FILAMENT_RUNOUT = _UxGT("E%d Filaman Tükenme"); } namespace LanguageWide_tr { using namespace LanguageNarrow_tr; #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 + LSTR MSG_LIVE_MOVE = _UxGT("Canlı Hareket"); LSTR MSG_HOST_START_PRINT = _UxGT("Host Baskıyı başlat"); LSTR MSG_PRINTING_OBJECT = _UxGT("Yazdırma Nesnesi"); LSTR MSG_CANCEL_OBJECT = _UxGT("Nesneyi İptal Et"); @@ -792,9 +896,9 @@ namespace LanguageWide_tr { LSTR MSG_MEDIA_MENU = _UxGT("SD Karttan Yazdır"); LSTR MSG_TURN_OFF = _UxGT("Yazıcıyı kapat"); LSTR MSG_END_LOOPS = _UxGT("Tekrr Döngüler Bitir"); - LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Ortam yerleştirilmedi."); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Lütfen önce hotend'i ısıtın."); - LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Baskı Sayısını Sıfırla"); + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Ortam yerleştirilmedi."); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Lütfen önce hotend'i ısıtın."); // ProUI + LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Baskı Sayısını Sıfırla"); // ProUI LSTR MSG_INFO_PRINT_COUNT = _UxGT("Baskı Sayısı"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Toplam Baskı Süresi"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("En Uzun Baskı Süresi"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index cc20c8955f..5010aff703 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -73,9 +73,6 @@ namespace LanguageNarrow_uk { LSTR MSG_LEVEL_BED_DONE = _UxGT("Завершено!"); LSTR MSG_Z_FADE_HEIGHT = _UxGT("Висота спаду"); 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_OFFSETS_APPLIED = _UxGT("Зміщення прийняті"); LSTR MSG_SELECT_ORIGIN = _UxGT("Оберіть нуль"); LSTR MSG_LAST_VALUE_SP = _UxGT("Останнє знач. "); @@ -539,28 +536,31 @@ namespace LanguageNarrow_uk { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Яскравість світла"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("НЕ ТОЙ ПРИНТЕР"); - LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Завершено"); - LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Екструдовано"); - LSTR MSG_PLEASE_PREHEAT = _UxGT("Нагрійте хотенд"); - LSTR MSG_COLORS_GET = _UxGT("Отримати колір"); - LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Немає носія"); - LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Перезавантаж..."); + LSTR MSG_COLORS_GET = _UxGT("Отримати колір"); // ProUI + LSTR MSG_COLORS_SELECT = _UxGT("Кольори"); // ProUI + LSTR MSG_COLORS_APPLIED = _UxGT("Кольори застос."); // ProUI + LSTR MSG_COLORS_RED = _UxGT("Червоний"); // ProUI / JyersUI + LSTR MSG_COLORS_GREEN = _UxGT("Зелений"); // ProUI / JyersUI + LSTR MSG_COLORS_BLUE = _UxGT("Синій"); // ProUI / JyersUI + LSTR MSG_COLORS_WHITE = _UxGT("Білий"); // ProUI + LSTR MSG_UI_LANGUAGE = _UxGT("Мова"); // ProUI + LSTR MSG_SOUND_ENABLE = _UxGT("Дозволити звук"); // ProUI + LSTR MSG_LOCKSCREEN = _UxGT("Блокувати екран"); // ProUI + //MSG_LOCKSCREEN_LOCKED + //MSG_LOCKSCREEN_UNLOCK + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Перезавантаж..."); // ProUI + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Немає носія"); // ProUI + LSTR MSG_PLEASE_PREHEAT = _UxGT("Нагрійте хотенд"); // ProUI + LSTR MSG_INFO_PRINT_COUNT = _UxGT("Друків"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Загалом"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Найдовше"); - LSTR MSG_COLORS_SELECT = _UxGT("Кольори"); - LSTR MSG_COLORS_APPLIED = _UxGT("Кольори застос."); - LSTR MSG_COLORS_RED = _UxGT("Червоний"); - LSTR MSG_COLORS_GREEN = _UxGT("Зелений"); - LSTR MSG_COLORS_BLUE = _UxGT("Синій"); - LSTR MSG_COLORS_WHITE = _UxGT("Білий"); - LSTR MSG_UI_LANGUAGE = _UxGT("Мова"); - LSTR MSG_SOUND_ENABLE = _UxGT("Дозволити звук"); - LSTR MSG_LOCKSCREEN = _UxGT("Блокувати екран"); - + LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Екструдовано"); + LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Завершено"); LSTR MSG_INFO_MIN_TEMP = _UxGT("Мін. ") LCD_STR_THERMOMETER; LSTR MSG_INFO_MAX_TEMP = _UxGT("Макс. ") LCD_STR_THERMOMETER; LSTR MSG_INFO_PSU = _UxGT("Блок жив-ня"); + LSTR MSG_DRIVE_STRENGTH = _UxGT("Сила мотору"); LSTR MSG_DAC_PERCENT_N = _UxGT("Драйвер @, %"); LSTR MSG_ERROR_TMC = _UxGT("ЗБІЙ ЗВ'ЯЗКУ З TMC"); @@ -638,7 +638,6 @@ namespace LanguageNarrow_uk { LSTR MSG_REMINDER_SAVE_SETTINGS = _UxGT("Не забудь зберегти!"); LSTR MSG_PASSWORD_REMOVED = _UxGT("Пароль видалений"); - // // Filament Change screens show up to 2 lines on a 3-line display // @@ -704,9 +703,9 @@ namespace LanguageWide_uk { LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Переповнення виклику"); LSTR MSG_LCD_SOFT_ENDSTOPS = _UxGT("Програмні кінцевики"); 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_X = _UxGT("Зміщення дому X"); // DWIN + LSTR MSG_HOME_OFFSET_Y = _UxGT("Зміщення дому Y"); // DWIN + LSTR MSG_HOME_OFFSET_Z = _UxGT("Зміщення дому Z"); // DWIN LSTR MSG_LAST_VALUE_SP = _UxGT("Останнє значення "); LSTR MSG_LASER_POWER = _UxGT("Потужність лазера"); LSTR MSG_SPINDLE_TOGGLE = _UxGT("Перемкн. шпіндель"); diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index ea833f53a1..475664f45a 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -114,7 +114,7 @@ lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t in * Return the number of characters emitted */ 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*/) { - char estr[maxlen + 2]; + char estr[maxlen * LANG_CHARSIZE + 2]; const lcd_uint_t outlen = expand_u8str_P(estr, ptpl, ind, cstr, fstr, maxlen); lcd_put_u8str_max(estr, maxlen * (MENU_FONT_WIDTH)); return outlen; diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index 87032201fb..a93e3adc6b 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -38,11 +38,6 @@ #include "e3v2/marlinui/marlinui_dwin.h" - #define LCD_PIXEL_WIDTH DWIN_WIDTH - #define LCD_PIXEL_HEIGHT DWIN_HEIGHT - #define LCD_WIDTH ((LCD_PIXEL_WIDTH) / (MENU_FONT_WIDTH)) - #define LCD_HEIGHT ((LCD_PIXEL_HEIGHT) / (MENU_LINE_HEIGHT)) - // The DWIN lcd_moveto function uses row / column, not pixels #define LCD_COL_X(col) (col) #define LCD_ROW_Y(row) (row) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index dfb2a8d47c..5b83f0c6bf 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -23,6 +23,7 @@ #include "../inc/MarlinConfig.h" #include "../MarlinCore.h" // for printingIsPaused +#include "../gcode/parser.h" // for axis_is_rotational, using_inch_units #if LED_POWEROFF_TIMEOUT > 0 || ALL(HAS_WIRED_LCD, PRINTER_EVENT_LEDS) || (HAS_BACKLIGHT_TIMEOUT && defined(NEOPIXEL_BKGD_INDEX_FIRST)) #include "../feature/leds/leds.h" @@ -47,8 +48,6 @@ MarlinUI ui; #if ENABLED(DWIN_CREALITY_LCD) #include "e3v2/creality/dwin.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "e3v2/proui/dwin.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "e3v2/jyersui/dwin.h" #endif @@ -68,7 +67,7 @@ MarlinUI ui; constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #if HAS_STATUS_MESSAGE - #if ENABLED(STATUS_MESSAGE_SCROLLING) && ANY(HAS_WIRED_LCD, DWIN_LCD_PROUI) + #if ENABLED(STATUS_MESSAGE_SCROLLING) uint8_t MarlinUI::status_scroll_offset; // = 0 #endif MString MarlinUI::status_message; @@ -214,14 +213,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; millis_t MarlinUI::screen_timeout_ms = 0; void MarlinUI::refresh_screen_timeout() { - screen_timeout_ms = sleep_timeout_minutes ? millis() + sleep_timeout_minutes * 60UL * 1000UL : 0; - sleep_display(false); + screen_timeout_ms = sleep_timeout_minutes ? millis() + MIN_TO_MS(sleep_timeout_minutes) : 0; + wake_display(); } - #if !HAS_TOUCH_SLEEP && !HAS_MARLINUI_U8GLIB // without DOGM (COLOR_UI) - void MarlinUI::sleep_display(const bool sleep) {} // if unimplemented - #endif - #endif void MarlinUI::init() { @@ -232,34 +227,32 @@ void MarlinUI::init() { init_lcd(); - #if HAS_DIGITAL_BUTTONS - #if BUTTON_EXISTS(EN1) - SET_INPUT_PULLUP(BTN_EN1); - #endif - #if BUTTON_EXISTS(EN2) - SET_INPUT_PULLUP(BTN_EN2); - #endif - #if BUTTON_EXISTS(ENC) - SET_INPUT_PULLUP(BTN_ENC); - #endif - #if BUTTON_EXISTS(ENC_EN) - SET_INPUT_PULLUP(BTN_ENC_EN); - #endif - #if BUTTON_EXISTS(BACK) - SET_INPUT_PULLUP(BTN_BACK); - #endif - #if BUTTON_EXISTS(UP) - SET_INPUT(BTN_UP); - #endif - #if BUTTON_EXISTS(DOWN) - SET_INPUT(BTN_DOWN); - #endif - #if BUTTON_EXISTS(LFT) - SET_INPUT(BTN_LEFT); - #endif - #if BUTTON_EXISTS(RT) - SET_INPUT(BTN_RIGHT); - #endif + #if BUTTON_EXISTS(EN1) + SET_INPUT_PULLUP(BTN_EN1); + #endif + #if BUTTON_EXISTS(EN2) + SET_INPUT_PULLUP(BTN_EN2); + #endif + #if BUTTON_EXISTS(ENC) + SET_INPUT_PULLUP(BTN_ENC); + #endif + #if BUTTON_EXISTS(ENC_EN) + SET_INPUT_PULLUP(BTN_ENC_EN); + #endif + #if BUTTON_EXISTS(BACK) + SET_INPUT_PULLUP(BTN_BACK); + #endif + #if BUTTON_EXISTS(UP) + SET_INPUT(BTN_UP); + #endif + #if BUTTON_EXISTS(DOWN) + SET_INPUT(BTN_DOWN); + #endif + #if BUTTON_EXISTS(LFT) + SET_INPUT(BTN_LEFT); + #endif + #if BUTTON_EXISTS(RT) + SET_INPUT(BTN_RIGHT); #endif #if HAS_SHIFT_ENCODER @@ -402,12 +395,7 @@ void MarlinUI::init() { bool MarlinUI::screen_changed; #if ENABLED(ENCODER_RATE_MULTIPLIER) - bool MarlinUI::encoderRateMultiplierEnabled; - millis_t MarlinUI::lastEncoderMovementMillis = 0; - void MarlinUI::enable_encoder_multiplier(const bool onoff) { - encoderRateMultiplierEnabled = onoff; - lastEncoderMovementMillis = 0; - } + bool MarlinUI::encoder_multiplier_enabled; #endif #if ANY(REVERSE_MENU_DIRECTION, REVERSE_SELECT_DIRECTION) @@ -618,8 +606,6 @@ void MarlinUI::init() { void MarlinUI::status_screen() { - TERN_(HAS_MARLINUI_MENU, ENCODER_RATE_MULTIPLY(false)); - #if BASIC_PROGRESS_BAR // @@ -700,7 +686,7 @@ void MarlinUI::init() { else new_frm = old_frm; } - else if ((old_frm < 100 && new_frm > 100) || (old_frm > 100 && new_frm < 100)) + else if ((old_frm < 100) == (new_frm > 100)) // Crossing 100? Stick at 100. new_frm = 100; LIMIT(new_frm, SPEED_EDIT_MIN, SPEED_EDIT_MAX); @@ -720,14 +706,38 @@ void MarlinUI::init() { #endif } - #endif // ULTIPANEL_FEEDMULTIPLY + #elif ENABLED(ULTIPANEL_FLOWPERCENT) + + const int16_t old_fp = planner.flow_percentage[active_extruder]; + int16_t new_fp = old_fp + int16_t(encoderPosition); + + // Dead zone at 100% flow percentage + if (old_fp == 100) { + if (int16_t(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) + new_fp -= ENCODER_FEEDRATE_DEADZONE; + else if (int16_t(encoderPosition) < -(ENCODER_FEEDRATE_DEADZONE)) + new_fp += ENCODER_FEEDRATE_DEADZONE; + else + new_fp = old_fp; + } + else if ((old_fp < 100) == (new_fp > 100)) // Crossing 100? Stick at 100. + new_fp = 100; + + LIMIT(new_fp, FLOW_EDIT_MIN, FLOW_EDIT_MAX); + + if (old_fp != new_fp) { + planner.set_flow(active_extruder, new_fp); + encoderPosition = 0; + } + + #endif // ULTIPANEL_FLOWPERCENT draw_status_screen(); } void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) { init(); - status_printf(1, F(S_FMT ": " S_FMT), FTOP(lcd_error), FTOP(lcd_component)); + status_printf(1, F(S_FMT ": " S_FMT), lcd_error, lcd_component); TERN_(HAS_MARLINUI_MENU, return_to_status()); // RED ALERT. RED ALERT. @@ -742,25 +752,9 @@ void MarlinUI::init() { draw_kill_screen(); } - #if HAS_TOUCH_SLEEP - #if HAS_TOUCH_BUTTONS - #include "touch/touch_buttons.h" - #else - #include "tft/touch.h" - #endif - // Wake up a sleeping TFT - void MarlinUI::wakeup_screen() { - TERN(HAS_TOUCH_BUTTONS, touchBt.wakeUp(), touch.wakeUp()); - } - #if HAS_DISPLAY_SLEEP && !HAS_MARLINUI_U8GLIB // without DOGM (COLOR_UI) - void MarlinUI::sleep_display(const bool sleep) { - if (!sleep) wakeup_screen(); // relay extra wake up events - } - #endif - #endif - void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { - TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); // Wake up the TFT with most buttons + wake_display(); // Wake the screen for any click sound + TERN_(HAS_MARLINUI_MENU, refresh()); #if HAS_ENCODER_ACTION @@ -823,52 +817,58 @@ void MarlinUI::init() { if (processing) return; // Prevent re-entry from idle() calls // Add a manual move to the queue? - if (axis != NO_AXIS_ENUM && ELAPSED(millis(), start_time) && !planner.is_full()) { + if (axis == NO_AXIS_ENUM || PENDING(millis(), start_time) || planner.is_full()) return; - const feedRate_t fr_mm_s = (axis < LOGICAL_AXES) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S; + const feedRate_t fr_mm_s = (axis < LOGICAL_AXES) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S; - #if IS_KINEMATIC + /** + * For a rotational axis apply the "inch" to "mm" conversion factor. This mimics behaviour of the G-code G1 + * (see get_destination_from_command). For moves involving only rotational axes, the planner will convert + * back to the feedrate in degrees-per-time unit. + */ + const feedRate_t fr = parser.axis_is_rotational(axis) && parser.using_inch_units() ? IN_TO_MM(fr_mm_s) : fr_mm_s; - #if HAS_MULTI_EXTRUDER - REMEMBER(ae, active_extruder); - #if MULTI_E_MANUAL - if (axis == E_AXIS) active_extruder = e_index; - #endif + #if IS_KINEMATIC + + #if HAS_MULTI_EXTRUDER + REMEMBER(ae, active_extruder); + #if MULTI_E_MANUAL + if (axis == E_AXIS) active_extruder = e_index; #endif - - // Apply a linear offset to a single axis - if (axis == ALL_AXES_ENUM) - destination = all_axes_destination; - else if (axis <= LOGICAL_AXES) { - destination = current_position; - destination[axis] += offset; - } - - // Reset for the next move - offset = 0; - axis = NO_AXIS_ENUM; - - // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to - // move_to_destination. This will cause idle() to be called, which can then call this function while the - // previous invocation is being blocked. Modifications to offset shouldn't be made while - // processing is true or the planner will get out of sync. - processing = true; - prepare_internal_move_to_destination(fr_mm_s); // will set current_position from destination - processing = false; - - #else - - // For Cartesian / Core motion simply move to the current_position - planner.buffer_line(current_position, fr_mm_s, - TERN_(MULTI_E_MANUAL, axis == E_AXIS ? e_index :) active_extruder - ); - - //SERIAL_ECHOLNPGM("Add planner.move with Axis ", C(AXIS_CHAR(axis)), " at FR ", fr_mm_s); - - axis = NO_AXIS_ENUM; - #endif - } + + // Apply a linear offset to a single axis + if (axis == ALL_AXES_ENUM) + destination = all_axes_destination; + else if (axis <= LOGICAL_AXES) { + destination = current_position; + destination[axis] += offset; + } + + // Reset for the next move + offset = 0; + axis = NO_AXIS_ENUM; + + // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to + // move_to_destination. This will cause idle() to be called, which can then call this function while the + // previous invocation is being blocked. Modifications to offset shouldn't be made while + // processing is true or the planner will get out of sync. + processing = true; + prepare_internal_move_to_destination(fr); // will set current_position from destination + processing = false; + + #else + + // For Cartesian / Core motion simply move to the current_position + planner.buffer_line(current_position, fr, + TERN_(MULTI_E_MANUAL, axis == E_AXIS ? e_index :) active_extruder + ); + + //SERIAL_ECHOLNPGM("Add planner.move with Axis ", C(AXIS_CHAR(axis)), " at FR ", fr_mm_s); + + axis = NO_AXIS_ENUM; + + #endif } // @@ -1024,71 +1024,56 @@ void MarlinUI::init() { if (TERN0(IS_RRW_KEYPAD, handle_keypad())) reset_status_timeout(ms); - uint8_t abs_diff = ABS(encoderDiff); - - #if ENCODER_PULSES_PER_STEP > 1 - // When reversing the encoder direction, a movement step can be missed because - // encoderDiff has a non-zero residual value, making the controller unresponsive. - // The fix clears the residual value when the encoder is idle. - // Also check if past half the threshold to compensate for missed single steps. - static int8_t lastEncoderDiff; - - // Timeout? No decoder change since last check. 10 or 20 times per second. - if (encoderDiff == lastEncoderDiff && abs_diff <= epps / 2) // Same direction & size but not over a half-step? - encoderDiff = 0; // Clear residual pulses. - else if (WITHIN(abs_diff, epps / 2 + 1, epps - 1)) { // Past half of threshold? - abs_diff = epps; // Treat as a full step size - encoderDiff = (encoderDiff < 0 ? -1 : 1) * abs_diff; // ...in the spin direction. - } - TERN_(HAS_TOUCH_SLEEP, if (lastEncoderDiff != encoderDiff) wakeup_screen()); - lastEncoderDiff = encoderDiff; - #endif + static int8_t lastEncoderDiff; + if (lastEncoderDiff != encoderDiff) wake_display(); + lastEncoderDiff = encoderDiff; + const uint8_t abs_diff = ABS(encoderDiff); const bool encoderPastThreshold = (abs_diff >= epps); - if (encoderPastThreshold || lcd_clicked) { - if (encoderPastThreshold && TERN1(IS_TFTGLCD_PANEL, !external_control)) { + if (encoderPastThreshold && TERN1(IS_TFTGLCD_PANEL, !external_control)) { - #if ALL(HAS_MARLINUI_MENU, ENCODER_RATE_MULTIPLIER) + int32_t encoder_multiplier = 1; - int32_t encoderMultiplier = 1; + #if ALL(HAS_MARLINUI_MENU, ENCODER_RATE_MULTIPLIER) - if (encoderRateMultiplierEnabled) { - const float encoderMovementSteps = float(abs_diff) / epps; + if (encoder_multiplier_enabled) { + // Note that the rate is always calculated between two passes through the + // loop and that the abs of the encoderDiff value is tracked. + static millis_t encoder_mult_prev_ms = 0; + const float encoderStepRate = ((float(abs_diff) / float(epps)) * 1000.0f) / float(ms - encoder_mult_prev_ms); + encoder_mult_prev_ms = ms; - if (lastEncoderMovementMillis) { - // Note that the rate is always calculated between two passes through the - // loop and that the abs of the encoderDiff value is tracked. - const float encoderStepRate = encoderMovementSteps / float(ms - lastEncoderMovementMillis) * 1000; + if (ENCODER_100X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) + encoder_multiplier = 100; + else if (ENCODER_10X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) + encoder_multiplier = 10; + else if (ENCODER_5X_STEPS_PER_SEC > 0 && encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) + encoder_multiplier = 5; - if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; - else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; + // Enable to output the encoder steps per second value + //#define ENCODER_RATE_MULTIPLIER_DEBUG + #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG) + SERIAL_ECHO_MSG( + "Enc Step Rate: ", encoderStepRate, + " Mult: ", encoder_multiplier, + " 5X Steps: ", ENCODER_5X_STEPS_PER_SEC, + " 10X Steps: ", ENCODER_10X_STEPS_PER_SEC, + " 100X Steps: ", ENCODER_100X_STEPS_PER_SEC + ); + #endif + } - // Enable to output the encoder steps per second value - //#define ENCODER_RATE_MULTIPLIER_DEBUG - #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG) - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("Enc Step Rate: ", encoderStepRate); - SERIAL_ECHOPGM(" Multiplier: ", encoderMultiplier); - SERIAL_ECHOPGM(" ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC); - SERIAL_ECHOPGM(" ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC); - SERIAL_EOL(); - #endif - } + #endif // ENCODER_RATE_MULTIPLIER - lastEncoderMovementMillis = ms; - } // encoderRateMultiplierEnabled - - #else - - constexpr int32_t encoderMultiplier = 1; - - #endif // ENCODER_RATE_MULTIPLIER - - if (can_encode()) encoderPosition += (encoderDiff * encoderMultiplier) / epps; - - encoderDiff = 0; + const int8_t fullSteps = encoderDiff / epps; + if (fullSteps != 0) { + encoderDiff -= fullSteps * epps; + if (can_encode() && !lcd_clicked) + encoderPosition += (fullSteps * encoder_multiplier); } + } + if (encoderPastThreshold || lcd_clicked) { reset_status_timeout(ms); #if HAS_BACKLIGHT_TIMEOUT @@ -1309,131 +1294,163 @@ void MarlinUI::init() { */ void MarlinUI::update_buttons() { const millis_t now = millis(); - if (ELAPSED(now, next_button_update_ms)) { - #if HAS_DIGITAL_BUTTONS + #if HAS_MARLINUI_ENCODER - #if ANY_BUTTON(EN1, EN2, ENC, BACK) - - uint8_t newbutton = 0; - if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; - if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; - if (can_encode() && BUTTON_PRESSED(ENC)) newbutton |= EN_C; - if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; - - #else - - constexpr uint8_t newbutton = 0; - - #endif - - // - // Directional buttons - // - #if ANY_BUTTON(UP, DOWN, LEFT, RIGHT) - - const int8_t pulses = epps * encoderDirection; - - if (BUTTON_PRESSED(UP)) { - encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * pulses; - next_button_update_ms = now + 300; - } - else if (BUTTON_PRESSED(DOWN)) { - encoderDiff = -(ENCODER_STEPS_PER_MENU_ITEM) * pulses; - next_button_update_ms = now + 300; - } - else if (BUTTON_PRESSED(LEFT)) { - encoderDiff = -pulses; - next_button_update_ms = now + 300; - } - else if (BUTTON_PRESSED(RIGHT)) { - encoderDiff = pulses; - next_button_update_ms = now + 300; - } - - #endif // UP || DOWN || LEFT || RIGHT - - buttons = (newbutton | TERN0(HAS_SLOW_BUTTONS, slow_buttons) - #if ALL(HAS_TOUCH_BUTTONS, HAS_ENCODER_ACTION) - | (touch_buttons & TERN(HAS_ENCODER_WHEEL, ~(EN_A | EN_B), 0xFF)) - #endif - ); - - #elif HAS_ADC_BUTTONS - - buttons = 0; - - #endif - - #if HAS_ADC_BUTTONS - if (keypad_buttons == 0) { - const uint8_t b = get_ADC_keyValue(); - if (WITHIN(b, 1, 8)) keypad_buttons = _BV(b - 1); - } - #endif - - #if HAS_SHIFT_ENCODER - /** - * Set up Rotary Encoder bit values (for two pin encoders to indicate movement). - * These values are independent of which pins are used for EN_A / EN_B indications. - * The rotary encoder part is also independent of the LCD chipset. - */ - uint8_t val = 0; - WRITE(SHIFT_LD_PIN, LOW); - WRITE(SHIFT_LD_PIN, HIGH); - for (uint8_t i = 0; i < 8; ++i) { - val >>= 1; - if (READ(SHIFT_OUT_PIN)) SBI(val, 7); - WRITE(SHIFT_CLK_PIN, HIGH); - WRITE(SHIFT_CLK_PIN, LOW); - } - TERN(REPRAPWORLD_KEYPAD, keypad_buttons, buttons) = ~val; - #endif - - #if IS_TFTGLCD_PANEL - next_button_update_ms = now + (LCD_UPDATE_INTERVAL / 2); - buttons = slow_buttons; - TERN_(AUTO_BED_LEVELING_UBL, external_encoder()); - #endif - - } // next_button_update_ms - - #if HAS_ENCODER_WHEEL - static uint8_t lastEncoderBits; - - // Manage encoder rotation - #define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: encoderDiff += encoderDirection; break; case _E2: encoderDiff -= encoderDirection; } - - uint8_t enc = 0; - if (buttons & EN_A) enc |= B01; - if (buttons & EN_B) enc |= B10; - if (enc != lastEncoderBits) { - switch (enc) { - case 0: ENCODER_SPIN(1, 2); break; - case 2: ENCODER_SPIN(0, 3); break; - case 3: ENCODER_SPIN(2, 1); break; - case 1: ENCODER_SPIN(3, 0); break; - } + const int8_t delta = get_encoder_delta(now); + if (delta) { + encoderDiff += delta * encoderDirection; #if ALL(HAS_MARLINUI_MENU, AUTO_BED_LEVELING_UBL) external_encoder(); #endif - lastEncoderBits = enc; } - #endif // HAS_ENCODER_WHEEL - } + #endif + + if (PENDING(now, next_button_update_ms)) return; + + #if HAS_DIGITAL_BUTTONS + + uint8_t newbuttons = 0; + #if ANY_BUTTON(ENC, BACK) + if (can_encode() && BUTTON_PRESSED(ENC)) newbuttons |= EN_C; + if (BUTTON_PRESSED(BACK)) newbuttons |= EN_D; + #endif + + // + // Directional buttons + // + #if ANY_BUTTON(UP, DOWN, LEFT, RIGHT) + + const int8_t pulses = epps * encoderDirection; + + if (BUTTON_PRESSED(UP)) { + encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * pulses; + next_button_update_ms = now + 300; + } + else if (BUTTON_PRESSED(DOWN)) { + encoderDiff = -(ENCODER_STEPS_PER_MENU_ITEM) * pulses; + next_button_update_ms = now + 300; + } + else if (BUTTON_PRESSED(LEFT)) { + encoderDiff = -pulses; + next_button_update_ms = now + 300; + } + else if (BUTTON_PRESSED(RIGHT)) { + encoderDiff = pulses; + next_button_update_ms = now + 300; + } + + #endif // UP || DOWN || LEFT || RIGHT + + buttons = (newbuttons | TERN0(HAS_SLOW_BUTTONS, slow_buttons) + #if ALL(HAS_TOUCH_BUTTONS, HAS_ENCODER_ACTION) + | (touch_buttons & TERN(HAS_MARLINUI_ENCODER, ~(EN_A | EN_B), 0xFF)) + #endif + ); + + #elif HAS_ADC_BUTTONS + + buttons = 0; + + #endif + + #if HAS_ADC_BUTTONS + if (keypad_buttons == 0) { + const uint8_t b = get_ADC_keyValue(); + if (WITHIN(b, 1, 8)) keypad_buttons = _BV(b - 1); + } + #endif + + #if HAS_SHIFT_ENCODER + /** + * Set up Rotary Encoder bit values (for two pin encoders to indicate movement). + * These values are independent of which pins are used for EN_A / EN_B indications. + * The rotary encoder part is also independent of the LCD chipset. + */ + uint8_t val = 0; + WRITE(SHIFT_LD_PIN, LOW); + WRITE(SHIFT_LD_PIN, HIGH); + for (uint8_t i = 0; i < 8; ++i) { + val >>= 1; + if (READ(SHIFT_OUT_PIN)) SBI(val, 7); + WRITE(SHIFT_CLK_PIN, HIGH); + WRITE(SHIFT_CLK_PIN, LOW); + } + TERN(REPRAPWORLD_KEYPAD, keypad_buttons, buttons) = ~val; + #endif + + #if IS_TFTGLCD_PANEL + next_button_update_ms = now + (LCD_UPDATE_INTERVAL / 2); + buttons = slow_buttons; + TERN_(AUTO_BED_LEVELING_UBL, external_encoder()); + #endif + + } // update_buttons #endif // HAS_ENCODER_ACTION - #if HAS_SOUND - void MarlinUI::completion_feedback(const bool good/*=true*/) { - TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); // Wake up on rotary encoder click... - if (good) OKAY_BUZZ(); else ERR_BUZZ(); - } - #endif - #endif // HAS_WIRED_LCD +#if MARLINUI_ENCODER_DELTA + + #define ENCODER_DEBOUNCE_MS 2 + + /** + * Get the encoder delta (-2 -1 0 +1 +2) since the last call, reading the live encoder state. + * Pins may be debounced to filter noise. + */ + int8_t MarlinUI::get_encoder_delta(const millis_t &now/*=millis()*/) { + + typedef struct { bool a:1, b:1; } enc_t; + + const enc_t live_enc = { BUTTON_PRESSED(EN1), BUTTON_PRESSED(EN2) }; + + #if ENCODER_DEBOUNCE_MS + + static enc_t enc; + static enc_t old_live; + + static millis_t en_A_bounce_ms; + if (old_live.a != live_enc.a) en_A_bounce_ms = now + (ENCODER_DEBOUNCE_MS); + else if (ELAPSED(now, en_A_bounce_ms)) enc.a = live_enc.a; + + static millis_t en_B_bounce_ms; + if (old_live.b != live_enc.b) en_B_bounce_ms = now + (ENCODER_DEBOUNCE_MS); + else if (ELAPSED(now, en_B_bounce_ms)) enc.b = live_enc.b; + + old_live = live_enc; + + #else + + const enc_t &enc = live_enc; + + #endif + + static uint8_t old_pos; + const uint8_t pos = (enc.a ^ enc.b) | (enc.a << 1); // 0:00 1:10 2:11 3:01 + int8_t delta = 0; + if (pos != old_pos) { + delta = (pos - old_pos + 4 + 1) % 4 - 1; + old_pos = pos; + + static int8_t last_dir; + if (delta == 2) delta = last_dir * 2; + else last_dir = delta; + } + return delta; + + } // get_encoder_delta + +#endif // MARLINUI_ENCODER_DELTA + +void MarlinUI::completion_feedback(const bool good/*=true*/) { + wake_display(); // Wake the screen for all audio feedback + #if HAS_SOUND + if (good) OKAY_BUZZ(); else ERR_BUZZ(); + #endif +} + void MarlinUI::host_notify_P(PGM_P const pstr) { TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify_P(pstr)); } @@ -1485,8 +1502,8 @@ void MarlinUI::host_notify(const char * const cstr) { else if (!no_welcome) msg = GET_TEXT_F(WELCOME_MSG); - else if (ENABLED(DWIN_LCD_PROUI)) - msg = F(""); + else if (ENABLED(STATUS_DO_CLEAR_EMPTY)) + msg = F(""); else return; @@ -1551,7 +1568,7 @@ void MarlinUI::host_notify(const char * const cstr) { */ void MarlinUI::_set_alert(const char * const ustr, const int8_t level, const bool pgm) { pgm ? set_status_and_level_P(ustr, level) : set_status_and_level(ustr, level); - TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); + wake_display(); TERN_(HAS_MARLINUI_MENU, return_to_status()); } @@ -1560,12 +1577,12 @@ void MarlinUI::host_notify(const char * const cstr) { * * @param pfmt A constant format P-string */ - void MarlinUI::status_printf_P(int8_t level, PGM_P const fmt, ...) { + void MarlinUI::status_printf_P(int8_t level, PGM_P const pfmt, ...) { if (set_alert_level(level)) return; va_list args; - va_start(args, fmt); - vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, fmt, args); + va_start(args, pfmt); + vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, pfmt, args); va_end(args); host_notify(status_message); @@ -1600,13 +1617,10 @@ void MarlinUI::host_notify(const char * const cstr) { #endif - #if ENABLED(STATUS_MESSAGE_SCROLLING) && ANY(HAS_WIRED_LCD, DWIN_LCD_PROUI) - status_scroll_offset = 0; - #endif + TERN_(STATUS_MESSAGE_SCROLLING, reset_status_scroll()); TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged(status_message)); TERN_(DWIN_CREALITY_LCD, dwinStatusChanged(status_message)); - TERN_(DWIN_LCD_PROUI, dwinCheckStatusMessage()); TERN_(DWIN_CREALITY_LCD_JYERSUI, jyersDWIN.updateStatus(status_message)); } @@ -1617,7 +1631,7 @@ void MarlinUI::host_notify(const char * const cstr) { if (status_scroll_offset < status_message.glyphs()) while (!START_OF_UTF8_CHAR(status_message[++status_scroll_offset])); else - status_scroll_offset = 0; + reset_status_scroll(); } char* MarlinUI::status_and_len(uint8_t &len) { @@ -1633,21 +1647,21 @@ void MarlinUI::host_notify(const char * const cstr) { // // Send the status line as a host notification // - void MarlinUI::_set_status(const char * const cstr, const bool, const bool pgm) { - host_notify(cstr); + void MarlinUI::_set_status(const char * const ustr, const bool, const bool pgm) { + host_notify(ustr); } - void MarlinUI::_set_alert(const char * const cstr, const int8_t, const bool pgm) { - host_notify(cstr); + void MarlinUI::_set_alert(const char * const ustr, const int8_t, const bool pgm) { + host_notify(ustr); } void MarlinUI::_set_status_and_level(const char * const ustr, const int8_t=0, const bool pgm) { pgm ? host_notify_P(ustr) : host_notify(ustr); } - void MarlinUI::status_printf_P(int8_t level, PGM_P const fmt, ...) { + void MarlinUI::status_printf_P(int8_t level, PGM_P const pfmt, ...) { MString<30> msg; va_list args; - va_start(args, fmt); - vsnprintf_P(&msg, 30, fmt, args); + va_start(args, pfmt); + vsnprintf_P(&msg, 30, pfmt, args); va_end(args); host_notify(msg); @@ -1664,7 +1678,10 @@ void MarlinUI::host_notify(const char * const cstr) { void MarlinUI::abort_print() { #if HAS_MEDIA wait_for_heatup = wait_for_user = false; - card.abortFilePrintSoon(); + if (IS_SD_PRINTING()) + card.abortFilePrintSoon(); + else if (card.isMounted()) + card.closefile(); #endif #ifdef ACTION_ON_CANCEL hostui.cancel(); @@ -1693,13 +1710,24 @@ void MarlinUI::host_notify(const char * const cstr) { } #endif + /** + * - Synchronize and put up a wait screen + * - Wake the display + * - Tell the host to present a "Resume" option + * - Print "Paused" on the display + * - One of three possibilities follow: + * - If Parking, Print a message, send M125 P (which parks and waits), then M24 which will resume SD printing. + * - If media exists call M25 to pause the SD print. + * - For a host-only printer tell the host to pause the print in progress. + */ void MarlinUI::pause_print() { #if HAS_MARLINUI_MENU synchronize(GET_TEXT_F(MSG_PAUSING)); defer_status_screen(); #endif - TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); + wake_display(); + TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_PAUSE_RESUME, F("UI Pause"), F("Resume"))); LCD_MESSAGE(MSG_PRINT_PAUSED); @@ -1807,7 +1835,7 @@ void MarlinUI::host_notify(const char * const cstr) { if (status) { if (old_status < 2) { #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMediaInserted(); + ExtUI::onMediaMounted(); #elif ENABLED(BROWSE_MEDIA_ON_INSERT) clear_menu_history(); quick_feedback(); @@ -1871,36 +1899,6 @@ void MarlinUI::host_notify(const char * const cstr) { #endif -#if ALL(EXTENSIBLE_UI, ADVANCED_PAUSE_FEATURE) - - void MarlinUI::pause_show_message( - const PauseMessage message, - const PauseMode mode/*=PAUSE_MODE_SAME*/, - const uint8_t extruder/*=active_extruder*/ - ) { - pause_mode = mode; - ExtUI::pauseModeStatus = message; - switch (message) { - case PAUSE_MESSAGE_PARKING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; - case PAUSE_MESSAGE_CHANGING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; - case PAUSE_MESSAGE_UNLOAD: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; - case PAUSE_MESSAGE_WAITING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING)); break; - case PAUSE_MESSAGE_INSERT: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; - case PAUSE_MESSAGE_LOAD: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; - case PAUSE_MESSAGE_PURGE: - ExtUI::onUserConfirmRequired(GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE))); - break; - case PAUSE_MESSAGE_RESUME: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break; - case PAUSE_MESSAGE_HEAT: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); break; - case PAUSE_MESSAGE_HEATING: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break; - case PAUSE_MESSAGE_OPTION: ExtUI::onUserConfirmRequired(GET_TEXT_F(MSG_FILAMENT_CHANGE_OPTION_HEADER)); break; - case PAUSE_MESSAGE_STATUS: break; - default: break; - } - } - -#endif - #if ENABLED(EEPROM_SETTINGS) #if HAS_MARLINUI_MENU diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index c661e635cc..835102546d 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -53,6 +53,10 @@ #include "e3v2/proui/dwin.h" #endif +#if ALL(HAS_STATUS_MESSAGE, IS_DWIN_MARLINUI) + #include "e3v2/marlinui/marlinui_dwin.h" // for LCD_WIDTH +#endif + typedef bool (*statusResetFunc_t)(); #if HAS_WIRED_LCD @@ -101,7 +105,8 @@ typedef bool (*statusResetFunc_t)(); enum HD44780CharSet : uint8_t { CHARSET_MENU, CHARSET_INFO, - CHARSET_BOOT + CHARSET_BOOT, + CHARSET_BOOT_CUSTOM }; #endif @@ -177,7 +182,7 @@ typedef bool (*statusResetFunc_t)(); static bool constexpr processing = false; #endif static void task(); - static void soon(const AxisEnum axis OPTARG(MULTI_E_MANUAL, const int8_t eindex=active_extruder)); + static void soon(const AxisEnum move_axis OPTARG(MULTI_E_MANUAL, const int8_t eindex=active_extruder)); }; void lcd_move_axis(const AxisEnum); @@ -250,6 +255,11 @@ public: } #endif + #if (HAS_WIRED_LCD && HAS_ENCODER_ACTION && HAS_MARLINUI_ENCODER) || HAS_DWIN_E3V2 || HAS_TFT_LVGL_UI + #define MARLINUI_ENCODER_DELTA 1 + static int8_t get_encoder_delta(const millis_t &now=millis()); + #endif + #if HAS_MEDIA #define MEDIA_MENU_GATEWAY TERN(PASSWORD_ON_SD_PRINT_MENU, password.media_gatekeeper, menu_media) static void media_changed(const uint8_t old_stat, const uint8_t stat); @@ -292,16 +302,10 @@ public: static constexpr uint8_t sleep_timeout_max = 99; static millis_t screen_timeout_ms; static void refresh_screen_timeout(); - static void sleep_display(const bool sleep=true); #endif - #if HAS_DWIN_E3V2_BASIC - static void refresh(); - #else - FORCE_INLINE static void refresh() { - TERN_(HAS_WIRED_LCD, refresh(LCDVIEW_CLEAR_CALL_REDRAW)); - } - #endif + static void sleep_display(const bool=true) IF_DISABLED(HAS_DISPLAY_SLEEP, {}); + static void wake_display() { sleep_display(false); } #if HAS_PRINT_PROGRESS_PERMYRIAD typedef uint16_t progress_t; @@ -366,7 +370,7 @@ public: static constexpr uint8_t get_progress_percent() { return 0; } #endif - static void host_notify_P(PGM_P const fstr); + static void host_notify_P(PGM_P const pstr); static void host_notify(FSTR_P const fstr) { host_notify_P(FTOP(fstr)); } static void host_notify(const char * const cstr); @@ -391,6 +395,7 @@ public: #if ENABLED(STATUS_MESSAGE_SCROLLING) static uint8_t status_scroll_offset; + static void reset_status_scroll() { status_scroll_offset = 0; } static void advance_status_scroll(); static char* status_and_len(uint8_t &len); #endif @@ -465,7 +470,7 @@ public: * @param fstr A constant F-string to set as the status. * @param level Alert level. Negative to ignore and reset the level. Non-zero never expires. */ - static void set_status_and_level(const char * const cstr, const int8_t level) { _set_status_and_level(cstr, level, false); } + static void set_status_and_level(const char * const cstr, const int8_t level=0) { _set_status_and_level(cstr, level, false); } /** * @brief Set Status with a P-string and alert level. @@ -473,7 +478,7 @@ public: * @param ustr A C- or P-string, according to pgm. * @param level Alert level. Negative to ignore and reset the level. Non-zero never expires. */ - static void set_status_and_level_P(PGM_P const pstr, const int8_t level) { _set_status_and_level(pstr, level, true); } + static void set_status_and_level_P(PGM_P const pstr, const int8_t level=0) { _set_status_and_level(pstr, level, true); } /** * @brief Set Status with a fixed string and alert level. @@ -481,7 +486,7 @@ public: * @param fstr A constant F-string to set as the status. * @param level Alert level. Negative to ignore and reset the level. Non-zero never expires. */ - static void set_status_and_level(FSTR_P const fstr, const int8_t level) { set_status_and_level_P(FTOP(fstr), level); } + static void set_status_and_level(FSTR_P const fstr, const int8_t level=0) { set_status_and_level_P(FTOP(fstr), level); } static void set_max_status(FSTR_P const fstr) { set_status_and_level(fstr, 127); } static void set_min_status(FSTR_P const fstr) { set_status_and_level(fstr, -1); } @@ -508,6 +513,11 @@ public: // Periodic or as-needed display update static void update() IF_DISABLED(HAS_UI_UPDATE, {}); + // Tell the screen to redraw on the next call + FORCE_INLINE static void refresh() { + TERN_(HAS_WIRED_LCD, refresh(LCDVIEW_CLEAR_CALL_REDRAW)); + } + #if HAS_DISPLAY static void abort_print(); @@ -582,16 +592,7 @@ public: static void pause_filament_display(const millis_t ms=millis()) { next_filament_display = ms + 5000UL; } #endif - #if HAS_TOUCH_SLEEP - static void wakeup_screen(); - #endif - static void quick_feedback(const bool clear_buttons=true); - #if HAS_SOUND - static void completion_feedback(const bool good=true); - #else - static void completion_feedback(const bool=true) { TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); } - #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) static void draw_hotend_status(const uint8_t row, const uint8_t extruder); @@ -604,7 +605,7 @@ public: static void status_screen(); - #endif + #endif // HAS_WIRED_LCD #if HAS_MARLINUI_U8GLIB static bool drawing_screen, first_page; @@ -635,9 +636,10 @@ public: #if !HAS_WIRED_LCD static void quick_feedback(const bool=true) {} - static void completion_feedback(const bool=true) {} #endif + static void completion_feedback(const bool good=true); + #if HAS_MEDIA #if ALL(SCROLL_LONG_FILENAMES, HAS_MARLINUI_MENU) #define MARLINUI_SCROLL_NAME 1 @@ -664,6 +666,13 @@ public: TERN(HAS_SCREEN_TIMEOUT, return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS, UNUSED(ms)); } + #if ALL(HAS_MARLINUI_MENU, ENCODER_RATE_MULTIPLIER) + static bool encoder_multiplier_enabled; + static void enable_encoder_multiplier(const bool onoff) { encoder_multiplier_enabled = onoff; } + #else + static void enable_encoder_multiplier(const bool) {} + #endif + #if HAS_MARLINUI_MENU #if HAS_TOUCH_BUTTONS @@ -673,15 +682,6 @@ public: static constexpr uint8_t touch_buttons = 0; #endif - #if ENABLED(ENCODER_RATE_MULTIPLIER) - static bool encoderRateMultiplierEnabled; - static millis_t lastEncoderMovementMillis; - static void enable_encoder_multiplier(const bool onoff); - #define ENCODER_RATE_MULTIPLY(F) (ui.encoderRateMultiplierEnabled = F) - #else - #define ENCODER_RATE_MULTIPLY(F) NOOP - #endif - // Manual Movement static ManualMove manual_move; static bool can_show_slider() { return !external_control && currentScreen != manual_move.screen_ptr; } @@ -763,7 +763,7 @@ public: static bool use_click() { return false; } #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) + #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI) static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder); #else static void _pause_show_message() {} diff --git a/Marlin/src/lcd/menu/game/invaders.cpp b/Marlin/src/lcd/menu/game/invaders.cpp index 1cb3e5bf3f..588523854f 100644 --- a/Marlin/src/lcd/menu/game/invaders.cpp +++ b/Marlin/src/lcd/menu/game/invaders.cpp @@ -193,7 +193,6 @@ inline void reset_invaders() { reset_bullets(); } - inline void spawn_ufo() { idat.ufov = random(0, 2) ? 1 : -1; idat.ufox = idat.ufov > 0 ? -(UFO_W) : LCD_PIXEL_WIDTH - 1; diff --git a/Marlin/src/lcd/menu/game/invaders.h b/Marlin/src/lcd/menu/game/invaders.h index c99e6c16ae..a3ae6ffaed 100644 --- a/Marlin/src/lcd/menu/game/invaders.h +++ b/Marlin/src/lcd/menu/game/invaders.h @@ -53,8 +53,8 @@ typedef struct { uint8_t bugs[INVADER_ROWS], shooters[(INVADER_ROWS) * (INVADER_COLS)]; int8_t ufox, ufov; bool game_blink; - int8_t laser_col() { return ((laser.x - pos.x) / (INVADER_COL_W)); }; - int8_t laser_row() { return ((laser.y - pos.y + 2) / (INVADER_ROW_H)); }; + int8_t laser_col() { return ((laser.x - pos.x) / (INVADER_COL_W)); } + int8_t laser_row() { return ((laser.y - pos.y + 2) / (INVADER_ROW_H)); } } invaders_data_t; class InvadersGame : MarlinGame { public: static void enter_game(), game_screen(); }; diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 1c77d9a092..892af5dbab 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -168,6 +168,9 @@ void MenuEditItemBase::goto_edit_screen( */ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) { if (currentScreen != screen) { + + wake_display(); + thermalManager.set_menu_cold_override(false); TERN_(IS_DWIN_MARLINUI, did_first_redraw = false); @@ -219,6 +222,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co TERN_(HAS_MARLINUI_U8GLIB, drawing_screen = false); TERN_(HAS_MARLINUI_MENU, encoder_direction_normal()); + enable_encoder_multiplier(false); set_selection(false); } @@ -252,7 +256,6 @@ void MarlinUI::synchronize(FSTR_P const fmsg/*=nullptr*/) { */ void scroll_screen(const uint8_t limit, const bool is_menu) { ui.encoder_direction_menus(); - ENCODER_RATE_MULTIPLY(false); if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = 0; if (ui.first_page) { encoderLine = ui.encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM); diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index de9e4d5086..47ddc00bf4 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -146,6 +146,7 @@ typedef union { uint32_t uint32; celsius_t celsius; } chimera_t; + extern chimera_t editable; // Base class for Menu Edit Items diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 840b658d09..b7825949c0 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -91,7 +91,7 @@ void menu_backlash(); #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) EDIT_CURRENT_PWM(STR_C, 1); #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) + #if HAS_MOTOR_CURRENT_PWM_E EDIT_CURRENT_PWM(STR_E, 2); #endif END_MENU(); @@ -559,28 +559,20 @@ void menu_backlash(); BACK_ITEM(MSG_ADVANCED_SETTINGS); // M593 F Frequency and D Damping ratio - #if ENABLED(INPUT_SHAPING_X) - editable.decimal = stepper.get_shaping_frequency(X_AXIS); - if (editable.decimal) { - ACTION_ITEM_N(X_AXIS, MSG_SHAPING_DISABLE, []{ stepper.set_shaping_frequency(X_AXIS, 0.0f); ui.refresh(LCDVIEW_CLEAR_CALL_REDRAW); }); - EDIT_ITEM_FAST_N(float41, X_AXIS, MSG_SHAPING_FREQ, &editable.decimal, min_frequency, 200.0f, []{ stepper.set_shaping_frequency(X_AXIS, editable.decimal); }); - editable.decimal = stepper.get_shaping_damping_ratio(X_AXIS); - EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_SHAPING_ZETA, &editable.decimal, 0.0f, 1.0f, []{ stepper.set_shaping_damping_ratio(X_AXIS, editable.decimal); }); - } - else - ACTION_ITEM_N(X_AXIS, MSG_SHAPING_ENABLE, []{ stepper.set_shaping_frequency(X_AXIS, (SHAPING_FREQ_X) ?: (SHAPING_MIN_FREQ)); ui.refresh(LCDVIEW_CLEAR_CALL_REDRAW); }); - #endif - #if ENABLED(INPUT_SHAPING_Y) - editable.decimal = stepper.get_shaping_frequency(Y_AXIS); - if (editable.decimal) { - ACTION_ITEM_N(Y_AXIS, MSG_SHAPING_DISABLE, []{ stepper.set_shaping_frequency(Y_AXIS, 0.0f); ui.refresh(LCDVIEW_CLEAR_CALL_REDRAW); }); - EDIT_ITEM_FAST_N(float41, Y_AXIS, MSG_SHAPING_FREQ, &editable.decimal, min_frequency, 200.0f, []{ stepper.set_shaping_frequency(Y_AXIS, editable.decimal); }); - editable.decimal = stepper.get_shaping_damping_ratio(Y_AXIS); - EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_SHAPING_ZETA, &editable.decimal, 0.0f, 1.0f, []{ stepper.set_shaping_damping_ratio(Y_AXIS, editable.decimal); }); - } - else - ACTION_ITEM_N(Y_AXIS, MSG_SHAPING_ENABLE, []{ stepper.set_shaping_frequency(Y_AXIS, (SHAPING_FREQ_Y) ?: (SHAPING_MIN_FREQ)); ui.refresh(LCDVIEW_CLEAR_CALL_REDRAW); }); - #endif + #define SHAPING_MENU_FOR_AXIS(AXIS) \ + editable.decimal = stepper.get_shaping_frequency(AXIS); \ + if (editable.decimal) { \ + ACTION_ITEM_N(AXIS, MSG_SHAPING_DISABLE, []{ stepper.set_shaping_frequency(AXIS, 0.0f); ui.refresh(); }); \ + EDIT_ITEM_FAST_N(float41, AXIS, MSG_SHAPING_FREQ, &editable.decimal, min_frequency, 200.0f, []{ stepper.set_shaping_frequency(AXIS, editable.decimal); }); \ + editable.decimal = stepper.get_shaping_damping_ratio(AXIS); \ + EDIT_ITEM_FAST_N(float42_52, AXIS, MSG_SHAPING_ZETA, &editable.decimal, 0.0f, 1.0f, []{ stepper.set_shaping_damping_ratio(AXIS, editable.decimal); }); \ + } \ + else \ + ACTION_ITEM_N(AXIS, MSG_SHAPING_ENABLE, []{ stepper.set_shaping_frequency(AXIS, (SHAPING_FREQ_X) ?: (SHAPING_MIN_FREQ)); ui.refresh(); }); + + TERN_(INPUT_SHAPING_X, SHAPING_MENU_FOR_AXIS(X_AXIS)) + TERN_(INPUT_SHAPING_Y, SHAPING_MENU_FOR_AXIS(Y_AXIS)) + TERN_(INPUT_SHAPING_Z, SHAPING_MENU_FOR_AXIS(Z_AXIS)) END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_bed_tramming.cpp b/Marlin/src/lcd/menu/menu_bed_tramming.cpp index b6b3e72124..d749763808 100644 --- a/Marlin/src/lcd/menu/menu_bed_tramming.cpp +++ b/Marlin/src/lcd/menu/menu_bed_tramming.cpp @@ -36,13 +36,6 @@ #include "../../feature/bedlevel/bedlevel.h" #endif -#ifndef BED_TRAMMING_Z_HOP - #define BED_TRAMMING_Z_HOP 4.0 -#endif -#ifndef BED_TRAMMING_HEIGHT - #define BED_TRAMMING_HEIGHT 0.0 -#endif - #if ALL(HAS_STOWABLE_PROBE, BED_TRAMMING_USE_PROBE) && DISABLED(BLTOUCH) #define NEEDS_PROBE_DEPLOY 1 #endif @@ -151,7 +144,7 @@ static void _lcd_goto_next_corner() { } } - float z = BED_TRAMMING_Z_HOP; + float z = current_position.z + (BED_TRAMMING_Z_HOP); #if ALL(BED_TRAMMING_USE_PROBE, BLTOUCH) z += bltouch.z_extra_clearance(); #endif @@ -183,6 +176,9 @@ static void _lcd_goto_next_corner() { uint8_t cy = TERN(TFT_COLOR_UI, 3, LCD_HEIGHT - 1), y = LCD_ROW_Y(cy); + // Enable font background for DWIN + TERN_(IS_DWIN_MARLINUI, dwin_font.solid = true); + // Display # of good points found vs total needed if (PAGE_CONTAINS(y - (MENU_FONT_HEIGHT), y)) { SETCURSOR(TERN(TFT_COLOR_UI, 2, 0), cy); @@ -235,7 +231,7 @@ static void _lcd_goto_next_corner() { } bool _lcd_bed_tramming_probe(const bool verify=false) { - if (verify) line_to_z(BED_TRAMMING_Z_HOP); // do clearance if needed + if (verify) line_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 - 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 @@ -253,7 +249,7 @@ static void _lcd_goto_next_corner() { // Raise the probe after the last point to give clearance for stow if (TERN0(NEEDS_PROBE_DEPLOY, good_points == nr_edge_points - 1)) - line_to_z(BED_TRAMMING_Z_HOP); + do_z_clearance(BED_TRAMMING_Z_HOP); return true; // probe triggered } @@ -281,7 +277,7 @@ static void _lcd_goto_next_corner() { } void _lcd_test_corners() { - bed_corner = TERN(BED_TRAMMING_INCLUDE_CENTER, center_index, 0); + bed_corner = TERN0(BED_TRAMMING_INCLUDE_CENTER, center_index); last_z = BED_TRAMMING_HEIGHT; endstops.enable_z_probe(true); good_points = 0; diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 44021ce35a..bd5ed492a1 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -31,6 +31,7 @@ #include "menu_item.h" #include "../../MarlinCore.h" +#include "../../module/temperature.h" #if ENABLED(LCD_ENDSTOP_TEST) #include "../../module/endstops.h" @@ -264,7 +265,9 @@ void menu_advanced_settings(); EDIT_ITEM(int3, MSG_TIMEOUT, &c.timeout, 0, 999); EDIT_ITEM(int3, MSG_TEMPERATURE, &c.trigger, 0, thermalManager.hotend_max_target(0)); EDIT_ITEM(int3, MSG_HOTEND_IDLE_NOZZLE_TARGET, &c.nozzle_target, 0, thermalManager.hotend_max_target(0)); - EDIT_ITEM(int3, MSG_HOTEND_IDLE_BED_TARGET, &c.bed_target, 0, BED_MAX_TARGET); + #if HAS_HEATED_BED + EDIT_ITEM(int3, MSG_HOTEND_IDLE_BED_TARGET, &c.bed_target, 0, BED_MAX_TARGET); + #endif END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index 874b7dbd59..9015a9fe6d 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -116,6 +116,7 @@ void menu_info_thermistors() { #if TEMP_SENSOR_1 != 0 #define THERMISTOR_ID TEMP_SENSOR_1 #include "../thermistornames.h" + #undef THERMISTOR_ID THERM_ITEMS(STR_E1, HEATER_1, WATCH_HOTENDS); #endif @@ -162,9 +163,9 @@ void menu_info_thermistors() { #endif #if HAS_HEATED_BED - #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_BED #include "../thermistornames.h" + #undef THERMISTOR_ID THERM_ITEMS("BED", BED, WATCH_BED); #endif diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 823d2a4a25..47cd7d5cf3 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -287,8 +287,8 @@ class MenuItem_bool : public MenuEditItemBase { #define _MENU_INNER_F(TYPE, USE_MULTIPLIER, FLABEL, V...) do { \ FSTR_P const flabel = FLABEL; \ if (CLICKED()) { \ - _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \ MenuItem_##TYPE::action(flabel, ##V); \ + _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \ if (ui.screen_changed) return; \ } \ if (ui.should_draw()) \ diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 3daeb285a1..460305f5d4 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -237,17 +237,16 @@ void menu_configuration(); #endif void menu_main() { - const bool busy = printingIsActive() - #if HAS_MEDIA - , card_detected = card.isMounted() - , card_open = card_detected && card.isFileOpen() - #endif - ; + const bool busy = printingIsActive(); + #if HAS_MEDIA + const bool card_detected = card.isMounted(), + card_open = card_detected && card.isFileOpen(); + #endif START_MENU(); BACK_ITEM(MSG_INFO_SCREEN); - #if HAS_MEDIA && !defined(MEDIA_MENU_AT_TOP) && !HAS_ENCODER_WHEEL + #if HAS_MEDIA && !defined(MEDIA_MENU_AT_TOP) && !HAS_MARLINUI_ENCODER #define MEDIA_MENU_AT_TOP #endif @@ -279,12 +278,12 @@ void menu_main() { else { #if ALL(HAS_MEDIA, MEDIA_MENU_AT_TOP) // BEGIN MEDIA MENU - #if ENABLED(MENU_ADDAUTOSTART) - ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files - #endif - if (card_detected) { if (!card_open) { + #if ENABLED(MENU_ADDAUTOSTART) + ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files + #endif + #if HAS_SD_DETECT GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21" TERN_(MULTI_VOLUME, "S"))); // M21 Change Media #if ENABLED(MULTI_VOLUME) @@ -296,7 +295,7 @@ void menu_main() { #if ENABLED(TFT_COLOR_UI) // Menu display issue on item removal with multi language selection menu if (encoderTopLine > 0) encoderTopLine--; - ui.refresh(LCDVIEW_CLEAR_CALL_REDRAW); + ui.refresh(); #endif }); #endif @@ -332,14 +331,14 @@ void menu_main() { SUBMENU(MSG_MOTION, menu_motion); } - #if ALL(ADVANCED_PAUSE_FEATURE, DISABLE_ENCODER) - FILAMENT_CHANGE_ITEM(); - #endif - #if HAS_CUTTER SUBMENU(MSG_CUTTER(MENU), STICKY_SCREEN(menu_spindle_laser)); #endif + #if ENABLED(ADVANCED_PAUSE_FEATURE) + FILAMENT_CHANGE_ITEM(); + #endif + #if HAS_TEMPERATURE SUBMENU(MSG_TEMPERATURE, menu_temperature); #endif @@ -396,12 +395,12 @@ void menu_main() { #if HAS_MEDIA && DISABLED(MEDIA_MENU_AT_TOP) // BEGIN MEDIA MENU - #if ENABLED(MENU_ADDAUTOSTART) - ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files - #endif - if (card_detected) { if (!card_open) { + #if ENABLED(MENU_ADDAUTOSTART) + ACTION_ITEM(MSG_RUN_AUTO_FILES, card.autofile_begin); // Run Auto Files + #endif + #if HAS_SD_DETECT GCODES_ITEM(MSG_CHANGE_MEDIA, F("M21" TERN_(MULTI_VOLUME, "S"))); // M21 Change Media #if ENABLED(MULTI_VOLUME) @@ -413,7 +412,7 @@ void menu_main() { #if ENABLED(TFT_COLOR_UI) // Menu display issue on item removal with multi language selection menu if (encoderTopLine > 0) encoderTopLine--; - ui.refresh(LCDVIEW_CLEAR_CALL_REDRAW); + ui.refresh(); #endif }); #endif @@ -503,10 +502,6 @@ void menu_main() { }); #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) && DISABLED(DISABLE_ENCODER) - FILAMENT_CHANGE_ITEM(); - #endif - END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index daa396601f..42ff2b1f26 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -48,7 +48,6 @@ void lcd_sd_updir() { goto_screen(menu_media, sd_encoder_position, sd_top_line, sd_items); sd_encoder_position = 0xFFFF; defer_status_screen(); - TERN_(HAS_TOUCH_SLEEP, ui.wakeup_screen()); } #endif diff --git a/Marlin/src/lcd/menu/menu_mixer.cpp b/Marlin/src/lcd/menu/menu_mixer.cpp index 21c18c8209..917164c0db 100644 --- a/Marlin/src/lcd/menu/menu_mixer.cpp +++ b/Marlin/src/lcd/menu/menu_mixer.cpp @@ -43,7 +43,7 @@ void _lcd_mixer_gradient_z_edit(const bool isend) { ui.defer_status_screen(); - ENCODER_RATE_MULTIPLY(true); + ui.enable_encoder_multiplier(true); float &zvar = isend ? mixer.gradient.end_z : mixer.gradient.start_z; diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 239d03d977..f65eb96719 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -63,7 +63,7 @@ void lcd_move_axis(const AxisEnum axis) { // This assumes the center is 0,0 #if ENABLED(DELTA) if (axis != Z_AXIS) { - max = SQRT(sq(float(PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis + max = SQRT(FLOAT_SQ(PRINTABLE_RADIUS) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis min = -max; } #endif @@ -78,8 +78,8 @@ void lcd_move_axis(const AxisEnum axis) { if (ui.should_draw()) { MenuEditItemBase::itemIndex = axis; const float pos = ui.manual_move.axis_value(axis); - if (parser.using_inch_units()) { - const float imp_pos = LINEAR_UNIT(pos); + if (parser.using_inch_units() && !parser.axis_is_rotational(axis)) { + const float imp_pos = parser.per_axis_value(axis, pos); MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_MOVE_N), ftostr63(imp_pos)); } else diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 701d2ae97a..2d28d44991 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -144,7 +144,7 @@ void _lcd_ubl_custom_mesh() { * UBL Adjust Mesh Height Command */ void _lcd_ubl_adjust_height_cmd() { - char ubl_lcd_gcode[13]; + char ubl_lcd_gcode[14]; const int ind = ubl_height_amount > 0 ? 6 : 7; strcpy_P(ubl_lcd_gcode, PSTR("G29P6C-")); sprintf_P(&ubl_lcd_gcode[ind], PSTR(".%i"), ABS(ubl_height_amount)); @@ -446,7 +446,7 @@ void ubl_map_screen() { do { // Now, keep the encoder position within range if (int32_t(ui.encoderPosition) < 0) ui.encoderPosition = GRID_MAX_POINTS + TERN(TOUCH_SCREEN, ui.encoderPosition, -1); - if (int32_t(ui.encoderPosition) > GRID_MAX_POINTS - 1) ui.encoderPosition = TERN(TOUCH_SCREEN, ui.encoderPosition - GRID_MAX_POINTS, 0); + if (int32_t(ui.encoderPosition) > GRID_MAX_POINTS - 1) ui.encoderPosition = TERN0(TOUCH_SCREEN, ui.encoderPosition - GRID_MAX_POINTS); // Draw the grid point based on the encoder x = ui.encoderPosition % (GRID_MAX_POINTS_X); diff --git a/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp b/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp index 40012d7501..1c2c7fd21a 100644 --- a/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp +++ b/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp @@ -45,7 +45,6 @@ extern const uint8_t Helvetica_Symbols_19[45] = { 8,7,7,9,0,11,60,102,195,195,195,102,60, }; - // Helvetica, capital 'A' height: 19px extern const uint8_t Helvetica_19[7298] = { 129,19,32,0,255,0,24,251, // unifont_t diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/LICENSE-OFL-1.1 b/Marlin/src/lcd/tft/fontdata/Unifont/LICENSE-OFL-1.1 index 84a393463d..6f3809cc48 100644 --- a/Marlin/src/lcd/tft/fontdata/Unifont/LICENSE-OFL-1.1 +++ b/Marlin/src/lcd/tft/fontdata/Unifont/LICENSE-OFL-1.1 @@ -1,7 +1,6 @@ The SIL Open Font License version 1.1 is copied below, and is also available with a FAQ at http://scripts.sil.org/OFL. - ----------------------------------------------------------- SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ----------------------------------------------------------- diff --git a/Marlin/src/lcd/tft/images/time_elapsed_32x32x4.cpp b/Marlin/src/lcd/tft/images/time_elapsed_32x32x4.cpp index 74947f9ce5..9976870032 100644 --- a/Marlin/src/lcd/tft/images/time_elapsed_32x32x4.cpp +++ b/Marlin/src/lcd/tft/images/time_elapsed_32x32x4.cpp @@ -17,7 +17,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - **/ + * + */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/tft/images/time_remaining_32x32x4.cpp b/Marlin/src/lcd/tft/images/time_remaining_32x32x4.cpp index aa3db49164..60930bc2af 100644 --- a/Marlin/src/lcd/tft/images/time_remaining_32x32x4.cpp +++ b/Marlin/src/lcd/tft/images/time_remaining_32x32x4.cpp @@ -17,7 +17,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - **/ + * + */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/tft/tft_color.h b/Marlin/src/lcd/tft/tft_color.h index cd03224615..ef0d2fa5b5 100644 --- a/Marlin/src/lcd/tft/tft_color.h +++ b/Marlin/src/lcd/tft/tft_color.h @@ -30,7 +30,7 @@ #define COLOR(color) RGB(((color >> 16) & 0xFF), ((color >> 8) & 0xFF), (color & 0xFF)) #define HALF(color) RGB(RED(color) >> 1, GREEN(color) >> 1, BLUE(color) >> 1) -// RGB565 color picker: https://embeddednotepad.com/page/rgb565-color-picker +// RGB565 color picker: https://rgbcolorpicker.com/565 // Hex code to color name: https://www.color-name.com/ #define COLOR_BLACK 0x0000 // #000000 diff --git a/Marlin/src/lcd/tft/tft_string.cpp b/Marlin/src/lcd/tft/tft_string.cpp index ad1a53c455..edf326cb97 100644 --- a/Marlin/src/lcd/tft/tft_string.cpp +++ b/Marlin/src/lcd/tft/tft_string.cpp @@ -40,7 +40,6 @@ unifont_t *TFT_String::font_header; uint16_t TFT_String::extra_count; #endif - uint16_t TFT_String::data[]; uint16_t TFT_String::span; uint8_t TFT_String::length; diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index d325355002..7fc5f2fa21 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -38,6 +38,8 @@ #include "tft.h" +Touch touch; + bool Touch::enabled = true; int16_t Touch::x, Touch::y; touch_control_t Touch::controls[]; @@ -48,7 +50,7 @@ millis_t Touch::next_touch_ms = 0, Touch::repeat_delay, Touch::touch_time; TouchControlType Touch::touch_control_type = NONE; -#if HAS_TOUCH_SLEEP +#if HAS_DISPLAY_SLEEP millis_t Touch::next_sleep_ms; // = 0 #endif #if HAS_RESUME_CONTINUE @@ -59,7 +61,7 @@ void Touch::init() { TERN_(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration_reset()); reset(); io.init(); - TERN_(HAS_TOUCH_SLEEP, wakeUp()); + TERN_(HAS_DISPLAY_SLEEP, wakeUp()); enable(); } @@ -215,7 +217,7 @@ void Touch::touch(touch_control_t *control) { static uint8_t fan, fan_speed; fan = 0; fan_speed = thermalManager.fan_speed[fan]; - MenuItem_percent::action(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); TERN_(LASER_SYNCHRONOUS_M106_M107, planner.buffer_sync_block(BLOCK_BIT_SYNC_FANS));}); break; case FEEDRATE: ui.clear_lcd(); @@ -278,7 +280,7 @@ bool Touch::get_point(int16_t * const x, int16_t * const y) { #endif #endif - #if HAS_TOUCH_SLEEP + #if HAS_DISPLAY_SLEEP if (is_touched) wakeUp(); else if (!isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen()) @@ -288,7 +290,7 @@ bool Touch::get_point(int16_t * const x, int16_t * const y) { return is_touched; } -#if HAS_TOUCH_SLEEP +#if HAS_DISPLAY_SLEEP void Touch::sleepTimeout() { #if HAS_LCD_BRIGHTNESS @@ -308,12 +310,14 @@ bool Touch::get_point(int16_t * const x, int16_t * const y) { next_touch_ms = millis() + 100; safe_delay(20); } - next_sleep_ms = millis() + MIN_TO_MS(ui.sleep_timeout_minutes); + next_sleep_ms = ui.sleep_timeout_minutes ? millis() + MIN_TO_MS(ui.sleep_timeout_minutes) : 0; } -#endif // HAS_TOUCH_SLEEP + void MarlinUI::sleep_display(const bool sleep/*=true*/) { + if (!sleep) touch.wakeUp(); + } -Touch touch; +#endif // HAS_DISPLAY_SLEEP bool MarlinUI::touch_pressed() { return touch.is_clicked(); diff --git a/Marlin/src/lcd/tft/touch.h b/Marlin/src/lcd/tft/touch.h index 93f9327a15..efbd427c31 100644 --- a/Marlin/src/lcd/tft/touch.h +++ b/Marlin/src/lcd/tft/touch.h @@ -71,7 +71,6 @@ typedef struct __attribute__((__packed__)) { #define UBL_REPEAT_DELAY 125 #define FREE_MOVE_RANGE 32 -#define TSLP_PREINIT 0 #define TSLP_SLEEPING 1 class Touch { @@ -105,7 +104,7 @@ class Touch { } static void disable() { enabled = false; } static void enable() { enabled = true; } - #if HAS_TOUCH_SLEEP + #if HAS_DISPLAY_SLEEP static millis_t next_sleep_ms; static bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; } static void sleepTimeout(); diff --git a/Marlin/src/lcd/tft/ui_color_ui.cpp b/Marlin/src/lcd/tft/ui_color_ui.cpp index d6f3d2eff7..279ea9715a 100644 --- a/Marlin/src/lcd/tft/ui_color_ui.cpp +++ b/Marlin/src/lcd/tft/ui_color_ui.cpp @@ -47,7 +47,7 @@ void MarlinUI::tft_idle() { #if ENABLED(TOUCH_SCREEN) - if (TERN0(HAS_TOUCH_SLEEP, lcd_sleep_task())) return; + if (TERN0(HAS_DISPLAY_SLEEP, lcd_sleep_task())) return; if (draw_menu_navigation) { add_control(NAVIGATION_PAGE_UP_X, NAVIGATION_PAGE_UP_Y, PAGE_UP, imgPageUp, encoderTopLine > 0); add_control(NAVIGATION_PAGE_DOWN_X, NAVIGATION_PAGE_DOWN_Y, PAGE_DOWN, imgPageDown, encoderTopLine + LCD_HEIGHT < screen_items); @@ -279,7 +279,6 @@ void MarlinUI::draw_status_screen() { tft.add_text(Z_VALUE_X - offset, Z_VALUE_Y, nhz ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string); #endif - #if ENABLED(LCD_SHOW_E_TOTAL) && defined(E_MARK_X) && defined(E_MARK_Y) && defined(E_VALUE_X) && defined(E_VALUE_Y) tft.add_text(E_MARK_X, E_MARK_Y, COLOR_AXIS_HOMED, "E"); if (printingIsActive()) { diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index 13c8d60d1c..23f276349b 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -71,12 +71,16 @@ void moveAxis(const AxisEnum axis, const int8_t direction) { } #endif - const float diff = motionAxisState.currentStepSize * direction; + float diff = motionAxisState.currentStepSize * direction; #if HAS_BED_PROBE if (axis == Z_AXIS && motionAxisState.z_selection == Z_SELECTION_Z_PROBE) { + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + + diff = 0; + const int16_t babystep_increment = direction * BABYSTEP_SIZE_Z; const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0; const float bsDiff = planner.mm_per_step[Z_AXIS] * babystep_increment, @@ -92,12 +96,12 @@ void moveAxis(const AxisEnum axis, const int8_t direction) { else TERN(BABYSTEP_HOTEND_Z_OFFSET, hotend_offset[active_extruder].z = new_offs, NOOP); drawMessage_P(NUL_STR); // Clear the error - drawAxisValue(axis); } else drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); - #else + #else // !BABYSTEP_ZPROBE_OFFSET + // Only change probe.offset.z probe.offset.z += diff; if (direction < 0 && current_position.z < PROBE_OFFSET_ZMIN) { @@ -111,13 +115,12 @@ void moveAxis(const AxisEnum axis, const int8_t direction) { else drawMessage_P(NUL_STR); // Clear the error - drawAxisValue(axis); - #endif + #endif // !BABYSTEP_ZPROBE_OFFSET } #endif // HAS_BED_PROBE - if (!ui.manual_move.processing) { + if (diff && !ui.manual_move.processing) { // Get motion limit from software endstops, if any float min, max; soft_endstop.get_manual_axis_limits(axis, min, max); @@ -126,7 +129,7 @@ void moveAxis(const AxisEnum axis, const int8_t direction) { // This assumes the center is 0,0 #if ENABLED(DELTA) if (axis != Z_AXIS && TERN1(HAS_EXTRUDERS, axis != E_AXIS)) { - max = SQRT(sq(float(PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis + max = SQRT(FLOAT_SQ(PRINTABLE_RADIUS) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis min = -max; } #endif @@ -188,7 +191,7 @@ void moveAxis(const AxisEnum axis, const int8_t direction) { #endif -#if HAS_TOUCH_SLEEP +#if ALL(TOUCH_SCREEN, HAS_DISPLAY_SLEEP) bool lcd_sleep_task() { static bool sleepCleared; @@ -207,7 +210,7 @@ void moveAxis(const AxisEnum axis, const int8_t direction) { return false; } -#endif // HAS_TOUCH_SLEEP +#endif void text_line(const uint16_t y, uint16_t color) { tft.canvas(0, y, TFT_WIDTH, MENU_ITEM_HEIGHT); @@ -265,7 +268,6 @@ void drawBtn(const int x, const int y, const char *label, intptr_t data, const M TERN_(TOUCH_SCREEN, if (enabled) touch.add_control(BUTTON, x, y, width, height, data)); } - // // lcdprint.h functions // diff --git a/Marlin/src/lcd/tft/ui_common.h b/Marlin/src/lcd/tft/ui_common.h index 8229ab36ab..3a67768f35 100644 --- a/Marlin/src/lcd/tft/ui_common.h +++ b/Marlin/src/lcd/tft/ui_common.h @@ -104,9 +104,9 @@ void disable_steppers(); #if HAS_EXTRUDERS void e_select(); #endif -#endif -#if HAS_TOUCH_SLEEP - bool lcd_sleep_task(); + #if HAS_DISPLAY_SLEEP + bool lcd_sleep_task(); + #endif #endif void draw_heater_status(uint16_t x, uint16_t y, const int8_t heater); diff --git a/Marlin/src/lcd/tft_io/ili9328.h b/Marlin/src/lcd/tft_io/ili9328.h index 823835f448..591a4ec2ed 100644 --- a/Marlin/src/lcd/tft_io/ili9328.h +++ b/Marlin/src/lcd/tft_io/ili9328.h @@ -65,7 +65,6 @@ #define ILI9328_ETMOD_DATA (ILI9328_ETMOD_ORIENTATION) | (ILI9328_ETMOD_COLOR) - #define ILI9328_RDDID 0x00 // ID code - 0x9328 #define ILI9328_DRVCTL 0x01 // Driver Output Control #define ILI9328_LCDCTL 0x02 // LCD Driving Wave Control @@ -128,7 +127,6 @@ #define ILI9328_RDOTP 0xA2 // OTP VCM Status and Enable #define ILI9328_OTPPKEY 0xA5 // OTP Programming ID Key - static const uint16_t ili9328_init[] = { DATASIZE_16BIT, ESC_REG(ILI9328_DRVCTL), ILI9328_DRVCTL_DATA, diff --git a/Marlin/src/lcd/tft_io/ili9341.h b/Marlin/src/lcd/tft_io/ili9341.h index 4488287430..d3a3483e9c 100644 --- a/Marlin/src/lcd/tft_io/ili9341.h +++ b/Marlin/src/lcd/tft_io/ili9341.h @@ -136,7 +136,6 @@ #define ILI9341_IFCTL 0xF6 // Interface Control #define ILI9341_PUMPRCTL 0xF7 // Pump ratio control - static const uint16_t ili9341_init[] = { DATASIZE_8BIT, ESC_REG(ILI9341_SWRESET), ESC_DELAY(100), diff --git a/Marlin/src/lcd/tft_io/r65105.h b/Marlin/src/lcd/tft_io/r65105.h index 4cc8c99942..70443a0e04 100644 --- a/Marlin/src/lcd/tft_io/r65105.h +++ b/Marlin/src/lcd/tft_io/r65105.h @@ -67,7 +67,6 @@ #define R61505_ETMOD_DATA (R61505_ETMOD_ORIENTATION) | (R61505_ETMOD_COLOR) - #define R61505_RDDID 0x00 // ID code - 0x1505 #define R61505_DRVCTL 0x01 // Driver Output Control #define R61505_LCDCTL 0x02 // LCD Driving Wave Control @@ -129,7 +128,6 @@ #define R61505_OSC_CTRL 0xA4 // Oscillation Control - static const uint16_t r61505_init[] = { DATASIZE_16BIT, ESC_REG(R61505_DRVCTL), R61505_DRVCTL_DATA, diff --git a/Marlin/src/lcd/thermistornames.h b/Marlin/src/lcd/thermistornames.h index 71f48775bd..0454b48fce 100644 --- a/Marlin/src/lcd/thermistornames.h +++ b/Marlin/src/lcd/thermistornames.h @@ -104,6 +104,10 @@ #define THERMISTOR_NAME "100k Dagoma NTC" #elif THERMISTOR_ID == 18 #define THERMISTOR_NAME "ATC Semitec 204GT-2" +#elif THERMISTOR_ID == 22 + #define THERMISTOR_NAME "GTM32 Pro vB (hotend)" +#elif THERMISTOR_ID == 23 + #define THERMISTOR_NAME "GTM32 Pro vB (bed)" #elif THERMISTOR_ID == 60 #define THERMISTOR_NAME "Makers Tool" #elif THERMISTOR_ID == 70 @@ -156,6 +160,8 @@ #define THERMISTOR_NAME "Dyze / TL 4.7M" #elif THERMISTOR_ID == 67 #define THERMISTOR_NAME "SliceEng 450°C" +#elif THERMISTOR_ID == 68 + #define THERMISTOR_NAME "PT-100 + Dyze amp" // Dummies for dev testing #elif THERMISTOR_ID == 998 diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index 652a043714..f6f4c66e77 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -37,7 +37,7 @@ #error "Unknown Touch Screen Type." #endif -#if HAS_TOUCH_SLEEP +#if HAS_DISPLAY_SLEEP millis_t TouchButtons::next_sleep_ms; #endif @@ -58,7 +58,9 @@ TouchButtons touchBt; void TouchButtons::init() { touchIO.init(); - TERN_(HAS_TOUCH_SLEEP, next_sleep_ms = millis() + SEC_TO_MS(ui.sleep_timeout_minutes * 60)); + #if HAS_DISPLAY_SLEEP + next_sleep_ms = ui.sleep_timeout_minutes ? millis() + MIN_TO_MS(ui.sleep_timeout_minutes) : 0; + #endif } uint8_t TouchButtons::read_buttons() { @@ -70,10 +72,10 @@ uint8_t TouchButtons::read_buttons() { const bool is_touched = TOUCH_PORTRAIT == _TOUCH_ORIENTATION ? touchIO.getRawPoint(&y, &x) : touchIO.getRawPoint(&x, &y); - #if HAS_TOUCH_SLEEP + #if HAS_DISPLAY_SLEEP if (is_touched) wakeUp(); - else if (!isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen()) + else if (next_sleep_ms && !isSleeping() && ELAPSED(millis(), next_sleep_ms) && ui.on_status_screen()) sleepTimeout(); #endif @@ -129,7 +131,7 @@ uint8_t TouchButtons::read_buttons() { return 0; } -#if HAS_TOUCH_SLEEP +#if HAS_DISPLAY_SLEEP void TouchButtons::sleepTimeout() { #if HAS_LCD_BRIGHTNESS @@ -139,6 +141,7 @@ uint8_t TouchButtons::read_buttons() { #endif next_sleep_ms = TSLP_SLEEPING; } + void TouchButtons::wakeUp() { if (isSleeping()) { #if HAS_LCD_BRIGHTNESS @@ -147,9 +150,13 @@ uint8_t TouchButtons::read_buttons() { WRITE(TFT_BACKLIGHT_PIN, HIGH); #endif } - next_sleep_ms = millis() + MIN_TO_MS(ui.sleep_timeout_minutes); + next_sleep_ms = ui.sleep_timeout_minutes ? millis() + MIN_TO_MS(ui.sleep_timeout_minutes) : 0; } -#endif // HAS_TOUCH_SLEEP + void MarlinUI::sleep_display(const bool sleep/*=true*/) { + if (!sleep) touchBt.wakeUp(); + } + +#endif // HAS_DISPLAY_SLEEP #endif // HAS_TOUCH_BUTTONS diff --git a/Marlin/src/lcd/touch/touch_buttons.h b/Marlin/src/lcd/touch/touch_buttons.h index 39768f2594..bfb86c6b6f 100644 --- a/Marlin/src/lcd/touch/touch_buttons.h +++ b/Marlin/src/lcd/touch/touch_buttons.h @@ -53,14 +53,13 @@ #define BUTTON_Y_HI (TFT_HEIGHT) - BUTTON_SPACING #define BUTTON_Y_LO BUTTON_Y_HI - BUTTON_HEIGHT -#define TSLP_PREINIT 0 #define TSLP_SLEEPING 1 class TouchButtons { public: static void init(); static uint8_t read_buttons(); - #if HAS_TOUCH_SLEEP + #if HAS_DISPLAY_SLEEP static millis_t next_sleep_ms; static bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; } static void sleepTimeout(); diff --git a/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp b/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp index 073a7ed0b6..3d4d3fcd3f 100644 --- a/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp +++ b/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp @@ -142,7 +142,6 @@ HSD_sink_res heatshrink_decoder_sink(heatshrink_decoder *hsd, return HSDR_SINK_OK; } - /***************** * Decompression * *****************/ diff --git a/Marlin/src/libs/hex_print.cpp b/Marlin/src/libs/hex_print.cpp index 1958084abb..9a354011e8 100644 --- a/Marlin/src/libs/hex_print.cpp +++ b/Marlin/src/libs/hex_print.cpp @@ -20,69 +20,53 @@ * */ -#include "../inc/MarlinConfigPre.h" +#include "../inc/MarlinConfig.h" #if NEED_HEX_PRINT #include "hex_print.h" #include "../core/serial.h" -#ifdef CPU_32_BIT - constexpr int byte_start = 4; - static char _hex[] = "0x00000000"; -#else - constexpr int byte_start = 0; - static char _hex[] = "0x0000"; -#endif +static char _hex[] = "0x00000000"; // 0:adr32 2:long 4:adr16 6:word 8:byte -char* hex_byte(const uint8_t b) { - _hex[byte_start + 4] = hex_nybble(b >> 4); - _hex[byte_start + 5] = hex_nybble(b); - return &_hex[byte_start + 4]; +inline void __hex_byte(const uint8_t b, const uint8_t o=8) { + _hex[o + 0] = hex_nybble(b >> 4); + _hex[o + 1] = hex_nybble(b); +} +inline void __hex_word(const uint16_t w, const uint8_t o=6) { + __hex_byte(w >> 8, o + 0); + __hex_byte(w , o + 2); +} +inline void __hex_long(const uint32_t w) { + __hex_word(w >> 16, 2); + __hex_word(w , 6); } -inline void _hex_word(const uint16_t w) { - _hex[byte_start + 2] = hex_nybble(w >> 12); - _hex[byte_start + 3] = hex_nybble(w >> 8); - _hex[byte_start + 4] = hex_nybble(w >> 4); - _hex[byte_start + 5] = hex_nybble(w); -} +char* hex_byte(const uint8_t b) { __hex_byte(b); return &_hex[8]; } +char* _hex_word(const uint16_t w) { __hex_word(w); return &_hex[6]; } +char* _hex_long(const uint32_t l) { __hex_long(l); return &_hex[2]; } -char* hex_word(const uint16_t w) { - _hex_word(w); - return &_hex[byte_start + 2]; -} - -#ifdef CPU_32_BIT - char* hex_long(const uintptr_t l) { - _hex[2] = hex_nybble(l >> 28); - _hex[3] = hex_nybble(l >> 24); - _hex[4] = hex_nybble(l >> 20); - _hex[5] = hex_nybble(l >> 16); - _hex_word((uint16_t)(l & 0xFFFF)); - return &_hex[2]; - } -#endif - -char* hex_address(const void * const w) { +char* hex_address(const void * const a) { #ifdef CPU_32_BIT - (void)hex_long((uintptr_t)w); + (void)_hex_long((uintptr_t)a); + return _hex; #else - (void)hex_word((uintptr_t)w); + _hex[4] = '0'; _hex[5] = 'x'; + (void)_hex_word((uintptr_t)a); + return &_hex[4]; #endif - return _hex; } void print_hex_nybble(const uint8_t n) { SERIAL_CHAR(hex_nybble(n)); } void print_hex_byte(const uint8_t b) { SERIAL_ECHO(hex_byte(b)); } -void print_hex_word(const uint16_t w) { SERIAL_ECHO(hex_word(w)); } +void print_hex_word(const uint16_t w) { SERIAL_ECHO(_hex_word(w)); } void print_hex_address(const void * const w) { SERIAL_ECHO(hex_address(w)); } -void print_hex_long(const uint32_t w, const char delimiter) { - SERIAL_ECHOPGM("0x"); +void print_hex_long(const uint32_t w, const char delimiter/*='\0'*/, const bool prefix/*=false*/) { + if (prefix) SERIAL_ECHOPGM("0x"); for (int B = 24; B >= 8; B -= 8) { print_hex_byte(w >> B); - SERIAL_CHAR(delimiter); + if (delimiter) SERIAL_CHAR(delimiter); } print_hex_byte(w); } diff --git a/Marlin/src/libs/hex_print.h b/Marlin/src/libs/hex_print.h index 0baae15bd3..bd1f7ce24d 100644 --- a/Marlin/src/libs/hex_print.h +++ b/Marlin/src/libs/hex_print.h @@ -30,12 +30,17 @@ constexpr char hex_nybble(const uint8_t n) { return (n & 0xF) + ((n & 0xF) < 10 ? '0' : 'A' - 10); } +char* _hex_word(const uint16_t w); +char* _hex_long(const uint32_t l); + char* hex_byte(const uint8_t b); -char* hex_word(const uint16_t w); +template char* hex_word(T w) { return _hex_word((uint16_t)w); } +template char* hex_long(T w) { return _hex_long((uint32_t)w); } + char* hex_address(const void * const w); void print_hex_nybble(const uint8_t n); void print_hex_byte(const uint8_t b); void print_hex_word(const uint16_t w); void print_hex_address(const void * const w); -void print_hex_long(const uint32_t w, const char delimiter); +void print_hex_long(const uint32_t w, const char delimiter='\0', const bool prefix=false); diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index 18eff415a3..cfa134860b 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -242,7 +242,7 @@ void home_delta() { #endif // Move all carriages together linearly until an endstop is hit. - current_position.z = DIFF_TERN(USE_PROBE_FOR_Z_HOMING, delta_height + 10, probe.offset.z); + current_position.z = DIFF_TERN(HAS_BED_PROBE, delta_height + 10, probe.offset.z); line_to_current_position(homing_feedrate(Z_AXIS)); planner.synchronize(); TERN_(HAS_DELTA_SENSORLESS_PROBING, endstops.report_states()); diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 9c6a3c011c..d0ad234a7f 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -50,6 +50,10 @@ #include "../feature/joystick.h" #endif +#if ENABLED(FT_MOTION) + #include "ft_motion.h" +#endif + #if HAS_BED_PROBE #include "probe.h" #endif @@ -351,7 +355,7 @@ void Endstops::event_handler() { TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT GANG_N_1(NUM_AXES, " %c") " %c"), - GET_TEXT(MSG_LCD_ENDSTOPS), + GET_TEXT_F(MSG_LCD_ENDSTOPS), NUM_AXIS_LIST_(chrX, chrY, chrZ, chrI, chrJ, chrK, chrU, chrV, chrW) chrP ) ); @@ -782,13 +786,14 @@ void Endstops::update() { #define PROCESS_ENDSTOP_Z(MINMAX) PROCESS_DUAL_ENDSTOP(Z, MINMAX) #endif + #if ENABLED(G38_PROBE_TARGET) // For G38 moves check the probe's pin for ALL movement if (G38_move && TEST_ENDSTOP(Z_MIN_PROBE) == TERN1(G38_PROBE_AWAY, (G38_move < 4))) { G38_did_trigger = true; #define _G38_SET(Q) | (stepper.axis_is_moving(_AXIS(Q)) << _AXIS(Q)) #define _G38_RESP(Q) if (moving[_AXIS(Q)]) { _ENDSTOP_HIT(Q, ENDSTOP); planner.endstop_triggered(_AXIS(Q)); } - const Flags moving = { value_t(NUM_AXES)(0 MAIN_AXIS_MAP(_G38_SET)) }; + const Flags moving = { uvalue_t(NUM_AXES)(0 MAIN_AXIS_MAP(_G38_SET)) }; MAIN_AXIS_MAP(_G38_RESP); } #endif @@ -796,8 +801,17 @@ void Endstops::update() { // Signal, after validation, if an endstop limit is pressed or not #if HAS_X_AXIS - if (stepper.axis_is_moving(X_AXIS)) { - if (!stepper.motor_direction(X_AXIS_HEAD)) { // -direction + #if ENABLED(FT_MOTION) + const bool x_moving_pos = ftMotion.axis_moving_pos(X_AXIS_HEAD), + x_moving_neg = ftMotion.axis_moving_neg(X_AXIS_HEAD); + #define X_MOVE_TEST x_moving_pos || x_moving_neg + #define X_NEG_DIR_TEST x_moving_neg + #else + #define X_MOVE_TEST stepper.axis_is_moving(X_AXIS) + #define X_NEG_DIR_TEST !stepper.motor_direction(X_AXIS_HEAD) + #endif + if (X_MOVE_TEST) { + if (X_NEG_DIR_TEST) { // -direction #if HAS_X_MIN_STATE PROCESS_ENDSTOP_X(MIN); #if CORE_DIAG(XY, Y, MIN) @@ -829,8 +843,17 @@ void Endstops::update() { #endif // HAS_X_AXIS #if HAS_Y_AXIS - if (stepper.axis_is_moving(Y_AXIS)) { - if (!stepper.motor_direction(Y_AXIS_HEAD)) { // -direction + #if ENABLED(FT_MOTION) + const bool y_moving_pos = ftMotion.axis_moving_pos(Y_AXIS_HEAD), + y_moving_neg = ftMotion.axis_moving_neg(Y_AXIS_HEAD); + #define Y_MOVE_TEST y_moving_pos || y_moving_neg + #define Y_NEG_DIR_TEST y_moving_neg + #else + #define Y_MOVE_TEST stepper.axis_is_moving(Y_AXIS) + #define Y_NEG_DIR_TEST !stepper.motor_direction(Y_AXIS_HEAD) + #endif + if (Y_MOVE_TEST) { + if (Y_NEG_DIR_TEST) { // -direction #if HAS_Y_MIN_STATE PROCESS_ENDSTOP_Y(MIN); #if CORE_DIAG(XY, X, MIN) @@ -862,8 +885,17 @@ void Endstops::update() { #endif // HAS_Y_AXIS #if HAS_Z_AXIS - if (stepper.axis_is_moving(Z_AXIS)) { - if (!stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up. + #if ENABLED(FT_MOTION) + const bool z_moving_pos = ftMotion.axis_moving_pos(Z_AXIS_HEAD), + z_moving_neg = ftMotion.axis_moving_neg(Z_AXIS_HEAD); + #define Z_MOVE_TEST z_moving_pos || z_moving_neg + #define Z_NEG_DIR_TEST z_moving_neg + #else + #define Z_MOVE_TEST stepper.axis_is_moving(Z_AXIS) + #define Z_NEG_DIR_TEST !stepper.motor_direction(Z_AXIS_HEAD) + #endif + if (Z_MOVE_TEST) { + if (Z_NEG_DIR_TEST) { // Z -direction. Gantry down, bed up. #if HAS_Z_MIN_STATE // If the Z_MIN_PIN is being used for the probe there's no // separate Z_MIN endstop. But a Z endstop could be wired @@ -907,6 +939,7 @@ void Endstops::update() { #endif // HAS_Z_AXIS #if HAS_I_AXIS + // TODO: FT_Motion logic. if (stepper.axis_is_moving(I_AXIS)) { if (!stepper.motor_direction(I_AXIS_HEAD)) { // -direction #if HAS_I_MIN_STATE diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index e912255561..e73c75b9c5 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -26,6 +26,7 @@ #include "ft_motion.h" #include "stepper.h" // Access stepper block queue function and abort status. +#include "endstops.h" FTMotion ftMotion; @@ -59,6 +60,9 @@ int32_t FTMotion::stepperCmdBuff_produceIdx = 0, // Index of next stepper comman FTMotion::stepperCmdBuff_consumeIdx = 0; // Index of next stepper command read from the buffer. bool FTMotion::sts_stepperBusy = false; // The stepper buffer has items and is in use. +millis_t FTMotion::axis_pos_move_end_ti[NUM_AXIS_ENUMS] = {0}, + FTMotion::axis_neg_move_end_ti[NUM_AXIS_ENUMS] = {0}; + // Private variables. @@ -110,9 +114,9 @@ uint32_t FTMotion::interpIdx = 0, // Index of current data point b #if HAS_X_AXIS FTMotion::shaping_t FTMotion::shaping = { 0, 0, - x:{ { 0.0f }, { 0.0f }, { 0 } }, // d_zi, Ai, Ni + x:{ false, { 0.0f }, { 0.0f }, { 0 } }, // d_zi, Ai, Ni #if HAS_Y_AXIS - y:{ { 0.0f }, { 0.0f }, { 0 } } // d_zi, Ai, Ni + y:{ false, { 0.0f }, { 0.0f }, { 0 } } // d_zi, Ai, Ni #endif }; #endif @@ -131,7 +135,10 @@ constexpr uint32_t last_batchIdx = (FTM_WINDOW_SIZE) - (FTM_BATCH_SIZE); // Public functions. +static bool markBlockStart = false; + // Sets controller states to begin processing a block. +// Called by Stepper::ftMotion_blockQueueUpdate, invoked from the main loop. void FTMotion::startBlockProc() { blockProcRdy = true; blockProcDn = false; @@ -166,11 +173,13 @@ void FTMotion::loop() { if (!cfg.mode) return; - // Handle block abort with the following sequence: - // 1. Zero out commands in stepper ISR. - // 2. Drain the motion buffer, stop processing until they are emptied. - // 3. Reset all the states / memory. - // 4. Signal ready for new block. + /** + * Handle block abort with the following sequence: + * 1. Zero out commands in stepper ISR. + * 2. Drain the motion buffer, stop processing until they are emptied. + * 3. Reset all the states / memory. + * 4. Signal ready for new block. + */ if (stepper.abort_current_block) { if (sts_stepperBusy) return; // Wait until motion buffers are emptied reset(); @@ -183,7 +192,10 @@ void FTMotion::loop() { if (blockProcRdy) { if (!blockProcRdy_z1) { // One-shot. - if (!blockDataIsRunout) loadBlockData(stepper.current_block); + if (!blockDataIsRunout) { + loadBlockData(stepper.current_block); + markBlockStart = true; + } else blockDataIsRunout = false; } while (!blockProcDn && !batchRdy && (makeVector_idx - makeVector_idx_z1 < (FTM_POINTS_PER_LOOP))) @@ -199,22 +211,12 @@ void FTMotion::loop() { trajMod = traj; // Move the window to traj #else // Copy the uncompensated vectors. - #define TCOPY(A) memcpy(trajMod.A, traj.A, sizeof(trajMod.A)) - LOGICAL_AXIS_CODE( - TCOPY(e), - TCOPY(x), TCOPY(y), TCOPY(z), - TCOPY(i), TCOPY(j), TCOPY(k), - TCOPY(u), TCOPY(v), TCOPY(w) - ); + #define TCOPY(A) memcpy(trajMod.A, traj.A, sizeof(trajMod.A)); + LOGICAL_AXIS_MAP_LC(TCOPY); // Shift the time series back in the window - #define TSHIFT(A) memcpy(traj.A, &traj.A[FTM_BATCH_SIZE], last_batchIdx * sizeof(traj.A[0])) - LOGICAL_AXIS_CODE( - TSHIFT(e), - TSHIFT(x), TSHIFT(y), TSHIFT(z), - TSHIFT(i), TSHIFT(j), TSHIFT(k), - TSHIFT(u), TSHIFT(v), TSHIFT(w) - ); + #define TSHIFT(A) memcpy(traj.A, &traj.A[FTM_BATCH_SIZE], last_batchIdx * sizeof(traj.A[0])); + LOGICAL_AXIS_MAP_LC(TSHIFT); #endif // ... data is ready in trajMod. @@ -471,6 +473,9 @@ void FTMotion::reset() { #endif TERN_(HAS_EXTRUDERS, e_raw_z1 = e_advanced_z1 = 0.0f); + + ZERO(axis_pos_move_end_ti); + ZERO(axis_neg_move_end_ti); } // Private functions. @@ -490,14 +495,14 @@ void FTMotion::init() { reset(); // Precautionary. } -// Loads / converts block data from planner to fixed-time control variables. +// Load / convert block data from planner to fixed-time control variables. void FTMotion::loadBlockData(block_t * const current_block) { const float totalLength = current_block->millimeters, oneOverLength = 1.0f / totalLength; startPosn = endPosn_prevBlock; - xyze_pos_t moveDist = LOGICAL_AXIS_ARRAY( + const xyze_pos_t moveDist = LOGICAL_AXIS_ARRAY( current_block->steps.e * planner.mm_per_step[E_AXIS_N(current_block->extruder)] * (current_block->direction_bits.e ? 1 : -1), current_block->steps.x * planner.mm_per_step[X_AXIS] * (current_block->direction_bits.x ? 1 : -1), current_block->steps.y * planner.mm_per_step[Y_AXIS] * (current_block->direction_bits.y ? 1 : -1), @@ -574,7 +579,8 @@ void FTMotion::loadBlockData(block_t * const current_block) { * f_s * T1_P : (mm) Distance traveled during the accel phase * f_e * T3_P : (mm) Distance traveled during the decel phase */ - F_P = (2.0f * totalLength - f_s * T1_P - f_e * T3_P) / (T1_P + 2.0f * T2_P + T3_P); // (mm/s) Feedrate at the end of the accel phase + const float adist = f_s * T1_P; + F_P = (2.0f * totalLength - adist - f_e * T3_P) / (T1_P + 2.0f * T2_P + T3_P); // (mm/s) Feedrate at the end of the accel phase // Calculate the acceleration and deceleration rates accel_P = N1 ? ((F_P - f_s) / T1_P) : 0.0f; @@ -582,7 +588,7 @@ void FTMotion::loadBlockData(block_t * const current_block) { decel_P = (f_e - F_P) / T3_P; // Calculate the distance traveled during the accel phase - s_1e = f_s * T1_P + 0.5f * accel_P * sq(T1_P); + s_1e = adist + 0.5f * accel_P * sq(T1_P); // Calculate the distance traveled during the decel phase s_2e = s_1e + F_P * T2_P; @@ -591,6 +597,43 @@ void FTMotion::loadBlockData(block_t * const current_block) { max_intervals = N1 + N2 + N3; endPosn_prevBlock += moveDist; + + millis_t move_end_ti = millis() + SEC_TO_MS(FTM_TS*(float)(max_intervals + num_samples_cmpnstr_settle() + (PROP_BATCHES+1)*FTM_BATCH_SIZE) + ((float)FTM_STEPPERCMD_BUFF_SIZE/(float)FTM_STEPPER_FS)); + + #if CORE_IS_XY + if (moveDist.x > 0.f) axis_pos_move_end_ti[A_AXIS] = move_end_ti; + if (moveDist.y > 0.f) axis_pos_move_end_ti[B_AXIS] = move_end_ti; + if (moveDist.x + moveDist.y > 0.f) axis_pos_move_end_ti[X_HEAD] = move_end_ti; + if (moveDist.x - moveDist.y > 0.f) axis_pos_move_end_ti[Y_HEAD] = move_end_ti; + if (moveDist.x < 0.f) axis_neg_move_end_ti[A_AXIS] = move_end_ti; + if (moveDist.y < 0.f) axis_neg_move_end_ti[B_AXIS] = move_end_ti; + if (moveDist.x + moveDist.y < 0.f) axis_neg_move_end_ti[X_HEAD] = move_end_ti; + if (moveDist.x - moveDist.y < 0.f) axis_neg_move_end_ti[Y_HEAD] = move_end_ti; + #else + if (moveDist.x > 0.f) axis_pos_move_end_ti[X_AXIS] = move_end_ti; + if (moveDist.y > 0.f) axis_pos_move_end_ti[Y_AXIS] = move_end_ti; + if (moveDist.x < 0.f) axis_neg_move_end_ti[X_AXIS] = move_end_ti; + if (moveDist.y < 0.f) axis_neg_move_end_ti[Y_AXIS] = move_end_ti; + #endif + if (moveDist.z > 0.f) axis_pos_move_end_ti[Z_AXIS] = move_end_ti; + if (moveDist.z < 0.f) axis_neg_move_end_ti[Z_AXIS] = move_end_ti; + // if (moveDist.i > 0.f) axis_pos_move_end_ti[I_AXIS] = move_end_ti; + // if (moveDist.i < 0.f) axis_neg_move_end_ti[I_AXIS] = move_end_ti; + // if (moveDist.j > 0.f) axis_pos_move_end_ti[J_AXIS] = move_end_ti; + // if (moveDist.j < 0.f) axis_neg_move_end_ti[J_AXIS] = move_end_ti; + // if (moveDist.k > 0.f) axis_pos_move_end_ti[K_AXIS] = move_end_ti; + // if (moveDist.k < 0.f) axis_neg_move_end_ti[K_AXIS] = move_end_ti; + // if (moveDist.u > 0.f) axis_pos_move_end_ti[U_AXIS] = move_end_ti; + // if (moveDist.u < 0.f) axis_neg_move_end_ti[U_AXIS] = move_end_ti; + // . + // . + // . + + // If the endstop is already pressed, endstop interrupts won't invoke + // endstop_triggered and the move will grind. So check here for a + // triggered endstop, which shortly marks the block for discard. + endstops.update(); + } // Generate data points of the trajectory. @@ -607,7 +650,6 @@ void FTMotion::makeVector() { else if (makeVector_idx < (N1 + N2)) { // Coasting phase dist = s_1e + F_P * (tau - N1 * (FTM_TS)); // (mm) Distance traveled for coasting phase since start of block - //accel_k = 0.0f; } else { // Deceleration phase @@ -616,18 +658,8 @@ void FTMotion::makeVector() { accel_k = decel_P; // (mm/s^2) Acceleration K factor from Decel phase } - LOGICAL_AXIS_CODE( - traj.e[makeVector_batchIdx] = startPosn.e + ratio.e * dist, - traj.x[makeVector_batchIdx] = startPosn.x + ratio.x * dist, - traj.y[makeVector_batchIdx] = startPosn.y + ratio.y * dist, - traj.z[makeVector_batchIdx] = startPosn.z + ratio.z * dist, - traj.i[makeVector_batchIdx] = startPosn.i + ratio.i * dist, - traj.j[makeVector_batchIdx] = startPosn.j + ratio.j * dist, - traj.k[makeVector_batchIdx] = startPosn.k + ratio.k * dist, - traj.u[makeVector_batchIdx] = startPosn.u + ratio.u * dist, - traj.v[makeVector_batchIdx] = startPosn.v + ratio.v * dist, - traj.w[makeVector_batchIdx] = startPosn.w + ratio.w * dist - ); + #define _FTM_TRAJ(A) traj.A[makeVector_batchIdx] = startPosn.A + ratio.A * dist; + LOGICAL_AXIS_MAP_LC(_FTM_TRAJ); #if HAS_EXTRUDERS if (cfg.linearAdvEna) { @@ -706,7 +738,7 @@ void FTMotion::makeVector() { * - Tests for delta are moved outside the loop. * - Two functions are used for command computation with an array of function pointers. */ -static void (*command_set[NUM_AXES TERN0(HAS_EXTRUDERS, +1)])(int32_t&, int32_t&, ft_command_t&, int32_t, int32_t); +static void (*command_set[SUM_TERN(HAS_EXTRUDERS, NUM_AXES, 1)])(int32_t&, int32_t&, ft_command_t&, int32_t, int32_t); static void command_set_pos(int32_t &e, int32_t &s, ft_command_t &b, int32_t bd, int32_t bs) { if (e < FTM_CTS_COMPARE_VAL) return; @@ -730,7 +762,7 @@ void FTMotion::convertToSteps(const uint32_t idx) { #if ENABLED(STEPS_ROUNDING) #define TOSTEPS(A,B) int32_t(trajMod.A[idx] * planner.settings.axis_steps_per_mm[B] + (trajMod.A[idx] < 0.0f ? -0.5f : 0.5f)) const xyze_long_t steps_tar = LOGICAL_AXIS_ARRAY( - TOSTEPS(e, E_AXIS_N(current_block->extruder)), // May be eliminated if guaranteed positive. + TOSTEPS(e, E_AXIS_N(stepper.current_block->extruder)), // May be eliminated if guaranteed positive. TOSTEPS(x, X_AXIS), TOSTEPS(y, Y_AXIS), TOSTEPS(z, Z_AXIS), TOSTEPS(i, I_AXIS), TOSTEPS(j, J_AXIS), TOSTEPS(k, K_AXIS), TOSTEPS(u, U_AXIS), TOSTEPS(v, V_AXIS), TOSTEPS(w, W_AXIS) @@ -739,47 +771,37 @@ void FTMotion::convertToSteps(const uint32_t idx) { #else #define TOSTEPS(A,B) int32_t(trajMod.A[idx] * planner.settings.axis_steps_per_mm[B]) - steps.A xyze_long_t delta = LOGICAL_AXIS_ARRAY( - TOSTEPS(e, E_AXIS_N(current_block->extruder)), + TOSTEPS(e, E_AXIS_N(stepper.current_block->extruder)), TOSTEPS(x, X_AXIS), TOSTEPS(y, Y_AXIS), TOSTEPS(z, Z_AXIS), TOSTEPS(i, I_AXIS), TOSTEPS(j, J_AXIS), TOSTEPS(k, K_AXIS), TOSTEPS(u, U_AXIS), TOSTEPS(v, V_AXIS), TOSTEPS(w, W_AXIS) ); #endif - LOGICAL_AXIS_CODE( - command_set[E_AXIS_N(current_block->extruder)] = delta.e >= 0 ? command_set_pos : command_set_neg, - command_set[X_AXIS] = delta.x >= 0 ? command_set_pos : command_set_neg, - command_set[Y_AXIS] = delta.y >= 0 ? command_set_pos : command_set_neg, - command_set[Z_AXIS] = delta.z >= 0 ? command_set_pos : command_set_neg, - command_set[I_AXIS] = delta.i >= 0 ? command_set_pos : command_set_neg, - command_set[J_AXIS] = delta.j >= 0 ? command_set_pos : command_set_neg, - command_set[K_AXIS] = delta.k >= 0 ? command_set_pos : command_set_neg, - command_set[U_AXIS] = delta.u >= 0 ? command_set_pos : command_set_neg, - command_set[V_AXIS] = delta.v >= 0 ? command_set_pos : command_set_neg, - command_set[W_AXIS] = delta.w >= 0 ? command_set_pos : command_set_neg - ); + #define _COMMAND_SET(AXIS) command_set[_AXIS(AXIS)] = delta[_AXIS(AXIS)] >= 0 ? command_set_pos : command_set_neg; + LOGICAL_AXIS_MAP(_COMMAND_SET); for (uint32_t i = 0U; i < (FTM_STEPS_PER_UNIT_TIME); i++) { - // Init all step/dir bits to 0 (defaulting to reverse/negative motion) - stepperCmdBuff[stepperCmdBuff_produceIdx] = 0; + ft_command_t &cmd = stepperCmdBuff[stepperCmdBuff_produceIdx]; + // Init all step/dir bits to 0 (defaulting to reverse/negative motion) + cmd = 0; + + // Mark the start of a new block + if (markBlockStart) { + cmd = _BV(FT_BIT_START); + markBlockStart = false; + } + + // Accumulate the errors for all axes err_P += delta; // Set up step/dir bits for all axes - LOGICAL_AXIS_CODE( - command_set[E_AXIS_N(current_block->extruder)](err_P.e, steps.e, stepperCmdBuff[stepperCmdBuff_produceIdx], _BV(FT_BIT_DIR_E), _BV(FT_BIT_STEP_E)), - command_set[X_AXIS](err_P.x, steps.x, stepperCmdBuff[stepperCmdBuff_produceIdx], _BV(FT_BIT_DIR_X), _BV(FT_BIT_STEP_X)), - command_set[Y_AXIS](err_P.y, steps.y, stepperCmdBuff[stepperCmdBuff_produceIdx], _BV(FT_BIT_DIR_Y), _BV(FT_BIT_STEP_Y)), - command_set[Z_AXIS](err_P.z, steps.z, stepperCmdBuff[stepperCmdBuff_produceIdx], _BV(FT_BIT_DIR_Z), _BV(FT_BIT_STEP_Z)), - command_set[I_AXIS](err_P.i, steps.i, stepperCmdBuff[stepperCmdBuff_produceIdx], _BV(FT_BIT_DIR_I), _BV(FT_BIT_STEP_I)), - command_set[J_AXIS](err_P.j, steps.j, stepperCmdBuff[stepperCmdBuff_produceIdx], _BV(FT_BIT_DIR_J), _BV(FT_BIT_STEP_J)), - command_set[K_AXIS](err_P.k, steps.k, stepperCmdBuff[stepperCmdBuff_produceIdx], _BV(FT_BIT_DIR_K), _BV(FT_BIT_STEP_K)), - command_set[U_AXIS](err_P.u, steps.u, stepperCmdBuff[stepperCmdBuff_produceIdx], _BV(FT_BIT_DIR_U), _BV(FT_BIT_STEP_U)), - command_set[V_AXIS](err_P.v, steps.v, stepperCmdBuff[stepperCmdBuff_produceIdx], _BV(FT_BIT_DIR_V), _BV(FT_BIT_STEP_V)), - command_set[W_AXIS](err_P.w, steps.w, stepperCmdBuff[stepperCmdBuff_produceIdx], _BV(FT_BIT_DIR_W), _BV(FT_BIT_STEP_W)), - ); + #define _COMMAND_RUN(AXIS) command_set[_AXIS(AXIS)](err_P[_AXIS(AXIS)], steps[_AXIS(AXIS)], cmd, _BV(FT_BIT_DIR_##AXIS), _BV(FT_BIT_STEP_##AXIS)); + LOGICAL_AXIS_MAP(_COMMAND_RUN); + // Next circular buffer index if (++stepperCmdBuff_produceIdx == (FTM_STEPPERCMD_BUFF_SIZE)) stepperCmdBuff_produceIdx = 0; diff --git a/Marlin/src/module/ft_motion.h b/Marlin/src/module/ft_motion.h index 884a183479..3325005ae2 100644 --- a/Marlin/src/module/ft_motion.h +++ b/Marlin/src/module/ft_motion.h @@ -107,6 +107,9 @@ class FTMotion { static bool sts_stepperBusy; // The stepper buffer has items and is in use. + static millis_t axis_pos_move_end_ti[NUM_AXIS_ENUMS], + axis_neg_move_end_ti[NUM_AXIS_ENUMS]; + // Public methods static void init(); static void startBlockProc(); // Set controller states to begin processing a block. @@ -129,6 +132,9 @@ class FTMotion { static void reset(); // Reset all states of the fixed time conversion to defaults. + static bool axis_moving_pos(const AxisEnum axis) { return !ELAPSED(millis(), axis_pos_move_end_ti[axis]); } + static bool axis_moving_neg(const AxisEnum axis) { return !ELAPSED(millis(), axis_neg_move_end_ti[axis]); } + private: static xyze_trajectory_t traj; @@ -152,6 +158,8 @@ class FTMotion { static uint32_t N1, N2, N3; static uint32_t max_intervals; + static constexpr uint32_t PROP_BATCHES = CEIL(FTM_WINDOW_SIZE/FTM_BATCH_SIZE) - 1; // Number of batches needed to propagate the current trajectory to the stepper. + #define _DIVCEIL(A,B) (((A) + (B) - 1) / (B)) static constexpr uint32_t _ftm_ratio = TERN(FTM_UNIFIED_BWS, 2, _DIVCEIL(FTM_WINDOW_SIZE, FTM_BATCH_SIZE)), shaper_intervals = (FTM_BATCH_SIZE) * _DIVCEIL(FTM_ZMAX, FTM_BATCH_SIZE), @@ -172,6 +180,7 @@ class FTMotion { #if HAS_X_AXIS typedef struct AxisShaping { + bool ena = false; // Enabled indication. float d_zi[FTM_ZMAX] = { 0.0f }; // Data point delay vector. float Ai[5]; // Shaping gain vector. uint32_t Ni[5]; // Shaping time index vector. @@ -207,6 +216,9 @@ class FTMotion { static void makeVector(); static void convertToSteps(const uint32_t idx); + FORCE_INLINE static int32_t num_samples_cmpnstr_settle() { return ( shaping.x.ena || shaping.y.ena ) ? FTM_ZMAX : 0; } + + }; // class FTMotion extern FTMotion ftMotion; diff --git a/Marlin/src/module/ft_types.h b/Marlin/src/module/ft_types.h index d460853262..e6a2506017 100644 --- a/Marlin/src/module/ft_types.h +++ b/Marlin/src/module/ft_types.h @@ -47,7 +47,9 @@ enum dynFreqMode_t : uint8_t { typedef struct XYZEarray xyze_trajectory_t; typedef struct XYZEarray xyze_trajectoryMod_t; +// TODO: Convert ft_command_t to a struct with bitfields instead of using a primitive type enum { + FT_BIT_START, LIST_N(DOUBLE(LOGICAL_AXES), FT_BIT_DIR_E, FT_BIT_STEP_E, FT_BIT_DIR_X, FT_BIT_STEP_X, FT_BIT_DIR_Y, FT_BIT_STEP_Y, FT_BIT_DIR_Z, FT_BIT_STEP_Z, diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 8908c2fa73..473d54cc38 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -73,7 +73,6 @@ #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../core/debug_out.h" - #if ENABLED(BD_SENSOR) #include "../feature/bedlevel/bdl/bdl.h" #endif @@ -329,7 +328,7 @@ void report_current_position_projected() { can_reach = ( R2 <= sq(L1 + L2) - inset #if MIDDLE_DEAD_ZONE_R > 0 - && R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) + && R2 >= FLOAT_SQ(MIDDLE_DEAD_ZONE_R) #endif ); @@ -339,7 +338,7 @@ void report_current_position_projected() { can_reach = ( R2 <= sq(L1 + L2) - inset #if MIDDLE_DEAD_ZONE_R > 0 - && R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) + && R2 >= FLOAT_SQ(MIDDLE_DEAD_ZONE_R) #endif ); @@ -381,7 +380,6 @@ void report_current_position_projected() { #endif // CARTESIAN - void home_if_needed(const bool keeplev/*=false*/) { if (!all_axes_trusted()) gcode.home_all_axes(keeplev); } @@ -691,88 +689,6 @@ void do_blocking_move_to(const xyze_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f* fr_mm_s ); } -#endif - -#if HAS_Z_AXIS - void do_blocking_move_to_z(const_float_t rz, const_feedRate_t fr_mm_s/*=0.0*/) { - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("do_blocking_move_to_z(", rz, ", ", fr_mm_s, ")"); - do_blocking_move_to_xy_z(current_position, rz, fr_mm_s); - } -#endif - -#if HAS_I_AXIS - void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s/*=0.0*/) { - do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s); - } - void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i, const_feedRate_t fr_mm_s/*=0.0f*/) { - do_blocking_move_to( - NUM_AXIS_LIST_(raw.x, raw.y, raw.z, i, raw.j, raw.k, raw.u, raw.v, raw.w) - fr_mm_s - ); - } -#endif - -#if HAS_J_AXIS - void do_blocking_move_to_j(const_float_t rj, const_feedRate_t fr_mm_s/*=0.0*/) { - do_blocking_move_to_xyzi_j(current_position, rj, fr_mm_s); - } - void do_blocking_move_to_xyzi_j(const xyze_pos_t &raw, const_float_t j, const_feedRate_t fr_mm_s/*=0.0f*/) { - do_blocking_move_to( - NUM_AXIS_LIST_(raw.x, raw.y, raw.z, raw.i, j, raw.k, raw.u, raw.v, raw.w) - fr_mm_s - ); - } -#endif - -#if HAS_K_AXIS - void do_blocking_move_to_k(const_float_t rk, const_feedRate_t fr_mm_s/*=0.0*/) { - do_blocking_move_to_xyzij_k(current_position, rk, fr_mm_s); - } - void do_blocking_move_to_xyzij_k(const xyze_pos_t &raw, const_float_t k, const_feedRate_t fr_mm_s/*=0.0f*/) { - do_blocking_move_to( - NUM_AXIS_LIST_(raw.x, raw.y, raw.z, raw.i, raw.j, k, raw.u, raw.v, raw.w) - fr_mm_s - ); - } -#endif - -#if HAS_U_AXIS - void do_blocking_move_to_u(const_float_t ru, const_feedRate_t fr_mm_s/*=0.0*/) { - do_blocking_move_to_xyzijk_u(current_position, ru, fr_mm_s); - } - void do_blocking_move_to_xyzijk_u(const xyze_pos_t &raw, const_float_t u, const_feedRate_t fr_mm_s/*=0.0f*/) { - do_blocking_move_to( - NUM_AXIS_LIST_(raw.x, raw.y, raw.z, raw.i, raw.j, raw.k, u, raw.v, raw.w) - fr_mm_s - ); - } -#endif - -#if HAS_V_AXIS - void do_blocking_move_to_v(const_float_t rv, const_feedRate_t fr_mm_s/*=0.0*/) { - do_blocking_move_to_xyzijku_v(current_position, rv, fr_mm_s); - } - void do_blocking_move_to_xyzijku_v(const xyze_pos_t &raw, const_float_t v, const_feedRate_t fr_mm_s/*=0.0f*/) { - do_blocking_move_to( - NUM_AXIS_LIST_(raw.x, raw.y, raw.z, raw.i, raw.j, raw.k, raw.u, v, raw.w) - fr_mm_s - ); - } -#endif - -#if HAS_W_AXIS - void do_blocking_move_to_w(const_float_t rw, const_feedRate_t fr_mm_s/*=0.0*/) { - do_blocking_move_to_xyzijkuv_w(current_position, rw, fr_mm_s); - } - void do_blocking_move_to_xyzijkuv_w(const xyze_pos_t &raw, const_float_t w, const_feedRate_t fr_mm_s/*=0.0f*/) { - do_blocking_move_to( - NUM_AXIS_LIST_(raw.x, raw.y, raw.z, raw.i, raw.j, raw.k, raw.u, raw.v, w) - fr_mm_s - ); - } -#endif - -#if HAS_Y_AXIS void do_blocking_move_to_xy(const_float_t rx, const_float_t ry, const_feedRate_t fr_mm_s/*=0.0*/) { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("do_blocking_move_to_xy(", rx, ", ", ry, ", ", fr_mm_s, ")"); do_blocking_move_to( @@ -787,6 +703,10 @@ void do_blocking_move_to(const xyze_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f* #endif #if HAS_Z_AXIS + void do_blocking_move_to_z(const_float_t rz, const_feedRate_t fr_mm_s/*=0.0*/) { + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("do_blocking_move_to_z(", rz, ", ", fr_mm_s, ")"); + do_blocking_move_to_xy_z(current_position, rz, fr_mm_s); + } void do_blocking_move_to_xy_z(const xy_pos_t &raw, const_float_t z, const_feedRate_t fr_mm_s/*=0.0f*/) { do_blocking_move_to( NUM_AXIS_LIST_(raw.x, raw.y, z, current_position.i, current_position.j, current_position.k, @@ -794,6 +714,14 @@ void do_blocking_move_to(const xyze_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f* fr_mm_s ); } + /** + * Move Z to a particular height so the nozzle or deployed probe clears the bed. + * (Use do_z_clearance_by for clearance over the current position.) + * - For a probe, add clearance for the probe distance + * - Constrain to the Z max physical position + * - If lowering is not allowed then skip a downward move + * - Execute the move at the probing (or homing) feedrate + */ void do_z_clearance(const_float_t zclear, const bool with_probe/*=true*/, const bool lower_allowed/*=false*/) { UNUSED(with_probe); float zdest = zclear; @@ -807,9 +735,13 @@ void do_blocking_move_to(const xyze_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f* if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("do_z_clearance_by(", zclear, ")"); do_z_clearance(current_position.z + zclear, false); } + /** + * Move Z to Z_POST_CLEARANCE, + * The axis is allowed to move down. + */ void do_move_after_z_homing() { DEBUG_SECTION(mzah, "do_move_after_z_homing", DEBUGGING(LEVELING)); - #if defined(Z_AFTER_HOMING) || ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) + #ifdef Z_POST_CLEARANCE do_z_clearance(Z_POST_CLEARANCE, true, true); #elif ENABLED(USE_PROBE_FOR_Z_HOMING) probe.move_z_after_probing(); @@ -817,6 +749,78 @@ void do_blocking_move_to(const xyze_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f* } #endif +#if HAS_I_AXIS + void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i, const_feedRate_t fr_mm_s/*=0.0f*/) { + do_blocking_move_to( + NUM_AXIS_LIST_(raw.x, raw.y, raw.z, i, raw.j, raw.k, raw.u, raw.v, raw.w) + fr_mm_s + ); + } + void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s/*=0.0*/) { + do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s); + } +#endif + +#if HAS_J_AXIS + void do_blocking_move_to_xyzi_j(const xyze_pos_t &raw, const_float_t j, const_feedRate_t fr_mm_s/*=0.0f*/) { + do_blocking_move_to( + NUM_AXIS_LIST_(raw.x, raw.y, raw.z, raw.i, j, raw.k, raw.u, raw.v, raw.w) + fr_mm_s + ); + } + void do_blocking_move_to_j(const_float_t rj, const_feedRate_t fr_mm_s/*=0.0*/) { + do_blocking_move_to_xyzi_j(current_position, rj, fr_mm_s); + } +#endif + +#if HAS_K_AXIS + void do_blocking_move_to_xyzij_k(const xyze_pos_t &raw, const_float_t k, const_feedRate_t fr_mm_s/*=0.0f*/) { + do_blocking_move_to( + NUM_AXIS_LIST_(raw.x, raw.y, raw.z, raw.i, raw.j, k, raw.u, raw.v, raw.w) + fr_mm_s + ); + } + void do_blocking_move_to_k(const_float_t rk, const_feedRate_t fr_mm_s/*=0.0*/) { + do_blocking_move_to_xyzij_k(current_position, rk, fr_mm_s); + } +#endif + +#if HAS_U_AXIS + void do_blocking_move_to_xyzijk_u(const xyze_pos_t &raw, const_float_t u, const_feedRate_t fr_mm_s/*=0.0f*/) { + do_blocking_move_to( + NUM_AXIS_LIST_(raw.x, raw.y, raw.z, raw.i, raw.j, raw.k, u, raw.v, raw.w) + fr_mm_s + ); + } + void do_blocking_move_to_u(const_float_t ru, const_feedRate_t fr_mm_s/*=0.0*/) { + do_blocking_move_to_xyzijk_u(current_position, ru, fr_mm_s); + } +#endif + +#if HAS_V_AXIS + void do_blocking_move_to_xyzijku_v(const xyze_pos_t &raw, const_float_t v, const_feedRate_t fr_mm_s/*=0.0f*/) { + do_blocking_move_to( + NUM_AXIS_LIST_(raw.x, raw.y, raw.z, raw.i, raw.j, raw.k, raw.u, v, raw.w) + fr_mm_s + ); + } + void do_blocking_move_to_v(const_float_t rv, const_feedRate_t fr_mm_s/*=0.0*/) { + do_blocking_move_to_xyzijku_v(current_position, rv, fr_mm_s); + } +#endif + +#if HAS_W_AXIS + void do_blocking_move_to_xyzijkuv_w(const xyze_pos_t &raw, const_float_t w, const_feedRate_t fr_mm_s/*=0.0f*/) { + do_blocking_move_to( + NUM_AXIS_LIST_(raw.x, raw.y, raw.z, raw.i, raw.j, raw.k, raw.u, raw.v, w) + fr_mm_s + ); + } + void do_blocking_move_to_w(const_float_t rw, const_feedRate_t fr_mm_s/*=0.0*/) { + do_blocking_move_to_xyzijkuv_w(current_position, rw, fr_mm_s); + } +#endif + // // Prepare to do endstop or probe moves with custom feedrates. // - Save / restore current feedrate and multiplier @@ -888,7 +892,7 @@ void restore_feedrate_and_scaling() { #elif ENABLED(DELTA) soft_endstop.min[axis] = base_min_pos(axis); - soft_endstop.max[axis] = (axis == Z_AXIS) ? DIFF_TERN(USE_PROBE_FOR_Z_HOMING, delta_height, probe.offset.z) : base_home_pos(axis); + soft_endstop.max[axis] = (axis == Z_AXIS) ? DIFF_TERN(HAS_BED_PROBE, delta_height, probe.offset.z) : base_max_pos(axis); switch (axis) { case X_AXIS: @@ -1155,10 +1159,13 @@ float get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXES, bool #if HAS_ROTATIONAL_AXES if (UNEAR_ZERO(distance_sqr)) { - // Move involves only rotational axes. Calculate angular distance in accordance with LinuxCNC - is_cartesian_move = false; + // Move involves no linear axes. Calculate angular distance in accordance with LinuxCNC distance_sqr = ROTATIONAL_AXIS_GANG(sq(diff.i), + sq(diff.j), + sq(diff.k), + sq(diff.u), + sq(diff.v), + sq(diff.w)); } + if (!UNEAR_ZERO(distance_sqr)) { + // Move involves rotational axes, not just the extruder + is_cartesian_move = false; + } #endif #endif @@ -1319,8 +1326,9 @@ float get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXES, bool float cartesian_mm = get_move_distance(diff OPTARG(HAS_ROTATIONAL_AXES, cartes_move)); // If the move is very short, check the E move distance - // No E move either? Game over. TERN_(HAS_EXTRUDERS, if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(diff.e)); + + // No E move either? Game over. if (UNEAR_ZERO(cartesian_mm)) return; // The length divided by the segment size @@ -1629,8 +1637,7 @@ void prepare_line_to_destination() { SERIAL_ECHO_START(); msg.echoln(); - msg.setf(GET_TEXT_F(MSG_HOME_FIRST), need); - ui.set_status(msg); + ui.status_printf(0, GET_TEXT_F(MSG_HOME_FIRST), need); return true; } @@ -2178,9 +2185,10 @@ void prepare_line_to_destination() { // Move away from the endstop by the axis HOMING_BUMP_MM if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move Away: ", -bump, "mm"); - do_homing_move(axis, -bump, TERN(HOMING_Z_WITH_PROBE, (axis == Z_AXIS ? z_probe_fast_mm_s : 0), 0), false); + do_homing_move(axis, -bump, TERN0(HOMING_Z_WITH_PROBE, (axis == Z_AXIS ? z_probe_fast_mm_s : 0)), false); #if ENABLED(DETECT_BROKEN_ENDSTOP) + // Check for a broken endstop EndstopEnum es; switch (axis) { @@ -2188,11 +2196,20 @@ void prepare_line_to_destination() { MAIN_AXIS_MAP(_ESCASE) default: break; } + + #if ENABLED(DUAL_X_CARRIAGE) + if (axis == X_AXIS && axis_home_dir > 0) { + es = X_MAX; + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("DUAL_X_CARRIAGE: Homing to X_MAX"); + } + #endif + if (TEST(endstops.state(), es)) { SERIAL_ECHO_MSG("Bad ", C(AXIS_CHAR(axis)), " Endstop?"); kill(GET_TEXT_F(MSG_KILL_HOMING_FAILED)); } - #endif + + #endif // DETECT_BROKEN_ENDSTOP #if ALL(HOMING_Z_WITH_PROBE, BLTOUCH) if (axis == Z_AXIS && !bltouch.high_speed_mode && bltouch.deploy()) @@ -2449,7 +2466,7 @@ void set_axis_is_at_home(const AxisEnum axis) { #if ANY(MORGAN_SCARA, AXEL_TPARA) scara_set_axis_is_at_home(axis); #elif ENABLED(DELTA) - current_position[axis] = (axis == Z_AXIS) ? DIFF_TERN(USE_PROBE_FOR_Z_HOMING, delta_height, probe.offset.z) : base_home_pos(axis); + current_position[axis] = (axis == Z_AXIS) ? DIFF_TERN(HAS_BED_PROBE, delta_height, probe.offset.z) : base_home_pos(axis); #else current_position[axis] = SUM_TERN(HAS_HOME_OFFSET, base_home_pos(axis), home_offset[axis]); #endif diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index c7558db43f..f9748871f5 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -31,7 +31,7 @@ #include "../inc/MarlinConfig.h" #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) - #include "../lcd/e3v2/proui/dwin.h" + #include "../lcd/e3v2/proui/dwin.h" // for Z_POST_CLEARANCE #endif #if IS_SCARA @@ -413,12 +413,12 @@ void remember_feedrate_scaling_off(); void restore_feedrate_and_scaling(); #if HAS_Z_AXIS - #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) - #define Z_POST_CLEARANCE hmiData.zAfterHoming - #elif defined(Z_AFTER_HOMING) - #define Z_POST_CLEARANCE Z_AFTER_HOMING - #else - #define Z_POST_CLEARANCE Z_CLEARANCE_FOR_HOMING + #ifndef Z_POST_CLEARANCE // May be set by proui/dwin.h :-P + #ifdef Z_AFTER_HOMING + #define Z_POST_CLEARANCE Z_AFTER_HOMING + #else + #define Z_POST_CLEARANCE Z_CLEARANCE_FOR_HOMING + #endif #endif void do_z_clearance(const_float_t zclear, const bool with_probe=true, const bool lower_allowed=false); void do_z_clearance_by(const_float_t zclear); diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 6b27971d9d..8f11f4ec18 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -784,7 +784,9 @@ block_t* Planner::get_current_block() { /** * Calculate trapezoid parameters, multiplying the entry- and exit-speeds - * by the provided factors. + * by the provided factors. Requires that initial_rate and final_rate are + * no less than sqrt(block->acceleration_steps_per_s2 / 2), which is ensured + * through minimum_planner_speed_sqr in _populate_block(). ** * ############ VERY IMPORTANT ############ * NOTE that the PRECONDITION to call this function is that the block is @@ -794,12 +796,17 @@ block_t* Planner::get_current_block() { */ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t entry_factor, const_float_t exit_factor) { - uint32_t initial_rate = CEIL(block->nominal_rate * entry_factor), - final_rate = CEIL(block->nominal_rate * exit_factor); // (steps per second) + uint32_t initial_rate = LROUND(block->nominal_rate * entry_factor), + final_rate = LROUND(block->nominal_rate * exit_factor); // (steps per second) - // Limit minimal step rate (Otherwise the timer will overflow.) - NOLESS(initial_rate, uint32_t(MINIMAL_STEP_RATE)); + // Legacy check against supposed timer overflow. However Stepper::calc_timer_interval() already + // should protect against it. But removing this code produces judder in direction-switching + // moves. This is because the current discrete stepping math diverges from physical motion under + // constant acceleration when acceleration_steps_per_s2 is large compared to initial/final_rate. + NOLESS(initial_rate, uint32_t(MINIMAL_STEP_RATE)); // Enforce the minimum speed NOLESS(final_rate, uint32_t(MINIMAL_STEP_RATE)); + NOMORE(initial_rate, block->nominal_rate); // NOTE: The nominal rate may be less than MINIMAL_STEP_RATE! + NOMORE(final_rate, block->nominal_rate); #if ANY(S_CURVE_ACCELERATION, LIN_ADVANCE) // If we have some plateau time, the cruise rate will be the nominal rate @@ -807,21 +814,22 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t #endif // Steps for acceleration, plateau and deceleration - int32_t plateau_steps = block->step_event_count; - uint32_t accelerate_steps = 0, - decelerate_steps = 0; + int32_t plateau_steps = block->step_event_count, + accelerate_steps = 0, + decelerate_steps = 0; const int32_t accel = block->acceleration_steps_per_s2; float inverse_accel = 0.0f; if (accel != 0) { inverse_accel = 1.0f / accel; const float half_inverse_accel = 0.5f * inverse_accel, - nominal_rate_sq = sq(float(block->nominal_rate)), + nominal_rate_sq = FLOAT_SQ(block->nominal_rate), // Steps required for acceleration, deceleration to/from nominal rate - decelerate_steps_float = half_inverse_accel * (nominal_rate_sq - sq(float(final_rate))); - float accelerate_steps_float = half_inverse_accel * (nominal_rate_sq - sq(float(initial_rate))); + decelerate_steps_float = half_inverse_accel * (nominal_rate_sq - FLOAT_SQ(final_rate)), + accelerate_steps_float = half_inverse_accel * (nominal_rate_sq - FLOAT_SQ(initial_rate)); + // Aims to fully reach nominal and final rates accelerate_steps = CEIL(accelerate_steps_float); - decelerate_steps = FLOOR(decelerate_steps_float); + decelerate_steps = CEIL(decelerate_steps_float); // Steps between acceleration and deceleration, if any plateau_steps -= accelerate_steps + decelerate_steps; @@ -831,13 +839,13 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t // Calculate accel / braking time in order to reach the final_rate exactly // at the end of this block. if (plateau_steps < 0) { - accelerate_steps_float = CEIL((block->step_event_count + accelerate_steps_float - decelerate_steps_float) * 0.5f); - accelerate_steps = _MIN(uint32_t(_MAX(accelerate_steps_float, 0)), block->step_event_count); + accelerate_steps = LROUND((block->step_event_count + accelerate_steps_float - decelerate_steps_float) * 0.5f); + LIMIT(accelerate_steps, 0, int32_t(block->step_event_count)); decelerate_steps = block->step_event_count - accelerate_steps; #if ANY(S_CURVE_ACCELERATION, LIN_ADVANCE) // We won't reach the cruising rate. Let's calculate the speed we will reach - cruise_rate = final_speed(initial_rate, accel, accelerate_steps); + NOMORE(cruise_rate, final_speed(initial_rate, accel, accelerate_steps)); #endif } } @@ -853,8 +861,8 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t #endif // Store new block parameters - block->accelerate_until = accelerate_steps; - block->decelerate_after = block->step_event_count - decelerate_steps; + block->accelerate_before = accelerate_steps; + block->decelerate_start = block->step_event_count - decelerate_steps; block->initial_rate = initial_rate; #if ENABLED(S_CURVE_ACCELERATION) block->acceleration_time = acceleration_time; @@ -940,7 +948,7 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t * neighboring blocks. * b. A block entry speed cannot exceed one reverse-computed from its exit speed (next->entry_speed) * with a maximum allowable deceleration over the block travel distance. - * c. The last (or newest appended) block is planned from a complete stop (an exit speed of zero). + * c. The last (or newest appended) block is planned from safe_exit_speed_sqr. * 2. Go over every block in chronological (forward) order and dial down junction speed values if * a. The exit speed exceeds the one forward-computed from its entry speed with the maximum allowable * acceleration over the block travel distance. @@ -996,29 +1004,13 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t // The kernel called by recalculate() when scanning the plan from last to first entry. void Planner::reverse_pass_kernel(block_t * const current, const block_t * const next, const_float_t safe_exit_speed_sqr) { - if (current) { - // If entry speed is already at the maximum entry speed, and there was no change of speed - // in the next block, there is no need to recheck. Block is cruising and there is no need to - // compute anything for this block, - // If not, block entry speed needs to be recalculated to ensure maximum possible planned speed. - const float max_entry_speed_sqr = current->max_entry_speed_sqr; - - // Compute maximum entry speed decelerating over the current block from its exit speed. - // If not at the maximum entry speed, or the previous block entry speed changed - if (current->entry_speed_sqr != max_entry_speed_sqr || (next && next->flag.recalculate)) { - - // If nominal length true, max junction speed is guaranteed to be reached. - // If a block can de/ac-celerate from nominal speed to zero within the length of the block, then - // the current block and next block junction speeds are guaranteed to always be at their maximum - // junction speeds in deceleration and acceleration, respectively. This is due to how the current - // block nominal speed limits both the current and next maximum junction speeds. Hence, in both - // the reverse and forward planners, the corresponding block junction speed will always be at the - // the maximum junction speed and may always be ignored for any speed reduction checks. - - const float next_entry_speed_sqr = next ? next->entry_speed_sqr : safe_exit_speed_sqr, - new_entry_speed_sqr = current->flag.nominal_length - ? max_entry_speed_sqr - : _MIN(max_entry_speed_sqr, max_allowable_speed_sqr(-current->acceleration, next_entry_speed_sqr, current->millimeters)); + // We need to recalculate only for the last block added or if next->entry_speed_sqr changed. + if (!next || next->flag.recalculate) { + // And only if we're not already at max entry speed. + if (current->entry_speed_sqr != current->max_entry_speed_sqr) { + const float next_entry_speed_sqr = next ? next->entry_speed_sqr : safe_exit_speed_sqr; + float new_entry_speed_sqr = max_allowable_speed_sqr(-current->acceleration, next_entry_speed_sqr, current->millimeters); + NOMORE(new_entry_speed_sqr, current->max_entry_speed_sqr); if (current->entry_speed_sqr != new_entry_speed_sqr) { // Need to recalculate the block speed - Mark it now, so the stepper @@ -1094,41 +1086,26 @@ void Planner::reverse_pass(const_float_t safe_exit_speed_sqr) { // The kernel called by recalculate() when scanning the plan from first to last entry. void Planner::forward_pass_kernel(const block_t * const previous, block_t * const current, const uint8_t block_index) { - if (previous) { - // If the previous block is an acceleration block, too short to complete the full speed - // change, adjust the entry speed accordingly. Entry speeds have already been reset, - // maximized, and reverse-planned. If nominal length is set, max junction speed is - // guaranteed to be reached. No need to recheck. - if (!previous->flag.nominal_length && previous->entry_speed_sqr < current->entry_speed_sqr) { + // Check against previous speed only on current->entry_speed_sqr changes (or if first time). + if (current->flag.recalculate) { + // If the previous block is accelerating check if it's too short to complete the full speed + // change then adjust the entry speed accordingly. Entry speeds have already been maximized. + if (previous->entry_speed_sqr < current->entry_speed_sqr) { + float new_entry_speed_sqr = max_allowable_speed_sqr(-previous->acceleration, previous->entry_speed_sqr, previous->millimeters); - // Compute the maximum allowable speed - const float new_entry_speed_sqr = max_allowable_speed_sqr(-previous->acceleration, previous->entry_speed_sqr, previous->millimeters); - - // If true, current block is full-acceleration and we can move the planned pointer forward. + // If true, previous block is full-acceleration and we can move the planned pointer forward. if (new_entry_speed_sqr < current->entry_speed_sqr) { + // Current entry speed limited by full acceleration from previous entry speed. + // Make sure entry speed not lower than minimum_planner_speed_sqr. + NOLESS(new_entry_speed_sqr, current->min_entry_speed_sqr); + current->entry_speed_sqr = new_entry_speed_sqr; - // Mark we need to recompute the trapezoidal shape, and do it now, - // so the stepper ISR does not consume the block before being recalculated - current->flag.recalculate = true; - - // But there is an inherent race condition here, as the block maybe - // became BUSY, just before it was marked as RECALCULATE, so check - // if that is the case! - if (stepper.is_block_busy(current)) { - // Block became busy. Clear the RECALCULATE flag (no point in - // recalculating BUSY blocks and don't set its speed, as it can't - // be updated at this time. - current->flag.recalculate = false; - } - else { - // Block is not BUSY, we won the race against the Stepper ISR: - - // Always <= max_entry_speed_sqr. Backward pass sets this. - current->entry_speed_sqr = new_entry_speed_sqr; // Always <= max_entry_speed_sqr. Backward pass sets this. - - // Set optimal plan pointer. - block_buffer_planned = block_index; - } + // Set optimal plan pointer. + block_buffer_planned = block_index; + } + else { + // Previous entry speed has been maximized. + block_buffer_planned = prev_block_index(block_index); } } @@ -1170,7 +1147,7 @@ void Planner::forward_pass() { // the previous block became BUSY, so assume the current block's // entry speed can't be altered (since that would also require // updating the exit speed of the previous block). - if (!previous || !stepper.is_block_busy(previous)) + if (previous && !stepper.is_block_busy(previous)) forward_pass_kernel(previous, block, block_index); previous = block; } @@ -1458,7 +1435,7 @@ void Planner::check_axes_activity() { */ void Planner::autotemp_update() { _autotemp_update_from_hotend(); - autotemp.factor = TERN(AUTOTEMP_PROPORTIONAL, AUTOTEMP_FACTOR_P, 0); + autotemp.factor = TERN0(AUTOTEMP_PROPORTIONAL, AUTOTEMP_FACTOR_P); autotemp.enabled = autotemp.factor != 0; } @@ -1474,7 +1451,7 @@ void Planner::check_axes_activity() { // When AUTOTEMP_PROPORTIONAL is enabled, F0 disables autotemp. // Normally, leaving off F also disables autotemp. - autotemp.factor = parser.seen('F') ? parser.value_float() : TERN(AUTOTEMP_PROPORTIONAL, AUTOTEMP_FACTOR_P, 0); + autotemp.factor = parser.seen('F') ? parser.value_float() : TERN0(AUTOTEMP_PROPORTIONAL, AUTOTEMP_FACTOR_P); autotemp.enabled = autotemp.factor != 0; } @@ -1905,13 +1882,13 @@ bool Planner::_populate_block( SERIAL_ECHOLNPGM( " _populate_block FR:", fr_mm_s, #if HAS_X_AXIS - " A:", target.a, " (", dist.a, " steps)" + " " STR_A ":", target.a, " (", dist.a, " steps)" #endif #if HAS_Y_AXIS - " B:", target.b, " (", dist.b, " steps)" + " " STR_B ":", target.b, " (", dist.b, " steps)" #endif #if HAS_Z_AXIS - " C:", target.c, " (", dist.c, " steps)" + " " STR_C ":", target.c, " (", dist.c, " steps)" #endif #if HAS_I_AXIS " " STR_I ":", target.i, " (", dist.i, " steps)" @@ -1973,32 +1950,35 @@ bool Planner::_populate_block( // Compute direction bit-mask for this block AxisBits dm; - #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) - dm.hx = (dist.a > 0); // Save the toolhead's true direction in X - dm.hy = (dist.b > 0); // ...and Y - TERN_(HAS_Z_AXIS, dm.z = (dist.c > 0)); + #if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX) + dm.hx = (dist.a > 0); // True direction in X + #endif + #if ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY, MARKFORGED_YX) + dm.hy = (dist.b > 0); // True direction in Y + #endif + #if ANY(CORE_IS_XZ, CORE_IS_YZ) + dm.hz = (dist.c > 0); // True direction in Z #endif #if CORE_IS_XY - dm.a = (dist.a + dist.b > 0); // Motor A direction - dm.b = (CORESIGN(dist.a - dist.b) > 0); // Motor B direction + dm.a = (dist.a + dist.b > 0); // Motor A direction + dm.b = (CORESIGN(dist.a - dist.b) > 0); // Motor B direction + TERN_(HAS_Z_AXIS, dm.z = (dist.c > 0)); // Axis Z direction #elif CORE_IS_XZ - dm.hx = (dist.a > 0); // Save the toolhead's true direction in X - dm.y = (dist.b > 0); - dm.hz = (dist.c > 0); // ...and Z dm.a = (dist.a + dist.c > 0); // Motor A direction + dm.y = (dist.b > 0); // Axis Y direction dm.c = (CORESIGN(dist.a - dist.c) > 0); // Motor C direction #elif CORE_IS_YZ - dm.x = (dist.a > 0); - dm.hy = (dist.b > 0); // Save the toolhead's true direction in Y - dm.hz = (dist.c > 0); // ...and Z + dm.x = (dist.a > 0); // Axis X direction dm.b = (dist.b + dist.c > 0); // Motor B direction dm.c = (CORESIGN(dist.b - dist.c) > 0); // Motor C direction #elif ENABLED(MARKFORGED_XY) dm.a = (dist.a TERN(MARKFORGED_INVERSE, -, +) dist.b > 0); // Motor A direction dm.b = (dist.b > 0); // Motor B direction + TERN_(HAS_Z_AXIS, dm.z = (dist.c > 0)); // Axis Z direction #elif ENABLED(MARKFORGED_YX) dm.a = (dist.a > 0); // Motor A direction dm.b = (dist.b TERN(MARKFORGED_INVERSE, -, +) dist.a > 0); // Motor B direction + TERN_(HAS_Z_AXIS, dm.z = (dist.c > 0)); // Axis Z direction #else XYZ_CODE( dm.x = (dist.a > 0), @@ -2079,11 +2059,11 @@ bool Planner::_populate_block( /** * This part of the code calculates the total length of the movement. - * For cartesian bots, the X_AXIS is the real X movement and same for Y_AXIS. - * But for corexy bots, that is not true. The "X_AXIS" and "Y_AXIS" motors (that should be named to A_AXIS - * and B_AXIS) cannot be used for X and Y length, because A=X+Y and B=X-Y. - * So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head. - * Having the real displacement of the head, we can calculate the total movement length and apply the desired speed. + * For cartesian bots, the distance along the X axis equals the X_AXIS joint displacement and same holds true for Y_AXIS. + * But for geometries like CORE_XY that is not true. For these machines we need to create 2 additional variables, named X_HEAD and Y_HEAD, to store the displacent of the head along the X and Y axes in a cartesian coordinate system. + * The displacement of the head along the axes of the cartesian coordinate system has to be calculated from "X_AXIS" and "Y_AXIS" (should be renamed to A_JOINT and B_JOINT) + * displacements in joints space using forward kinematics (A=X+Y and B=X-Y in the case of CORE_XY). + * Next we can calculate the total movement length and apply the desired speed. */ struct DistanceMM : abce_float_t { #if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX) @@ -2308,6 +2288,10 @@ bool Planner::_populate_block( // Example 2: At 120°/s a 60° move involving only rotational axes takes 0.5s. So this will give 2.0. float inverse_secs = inverse_millimeters * ( #if ALL(HAS_ROTATIONAL_AXES, INCH_MODE_SUPPORT) + /** + * Workaround for premature feedrate conversion + * from in/s to mm/s by get_distance_from_command. + */ cartesian_move ? fr_mm_s : LINEAR_UNIT(fr_mm_s) #else fr_mm_s @@ -2385,14 +2369,12 @@ bool Planner::_populate_block( #endif const feedRate_t cs = ABS(current_speed.e), - max_fr = settings.max_feedrate_mm_s[E_AXIS_N(extruder)] - * TERN(HAS_MIXER_SYNC_CHANNEL, MIXING_STEPPERS, 1); + max_fr = MUL_TERN(HAS_MIXER_SYNC_CHANNEL, settings.max_feedrate_mm_s[E_AXIS_N(extruder)], MIXING_STEPPERS); - if (cs > max_fr) NOMORE(speed_factor, max_fr / cs); //respect max feedrate on any movement (doesn't matter if E axes only or not) + if (cs > max_fr) NOMORE(speed_factor, max_fr / cs); // Respect max feedrate on any move (travel and print) #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) - const feedRate_t max_vfr = volumetric_extruder_feedrate_limit[extruder] - * TERN(HAS_MIXER_SYNC_CHANNEL, MIXING_STEPPERS, 1); + const feedRate_t max_vfr = MUL_TERN(HAS_MIXER_SYNC_CHANNEL, volumetric_extruder_feedrate_limit[extruder], MIXING_STEPPERS); // TODO: Doesn't work properly for joined segments. Set MIN_STEPS_PER_SEGMENT 1 as workaround. @@ -2458,11 +2440,7 @@ bool Planner::_populate_block( #if ENABLED(LIN_ADVANCE) bool use_advance_lead = false; #endif - if (true NUM_AXIS_GANG( - && !block->steps.a, && !block->steps.b, && !block->steps.c, - && !block->steps.i, && !block->steps.j, && !block->steps.k, - && !block->steps.u, && !block->steps.v, && !block->steps.w) - ) { // Is this a retract / recover move? + if (!ANY_AXIS_MOVES(block)) { // Is this a retract / recover move? accel = CEIL(settings.retract_acceleration * steps_per_mm); // Convert to: acceleration steps/sec^2 } else { @@ -2565,9 +2543,13 @@ bool Planner::_populate_block( } #endif - // The minimum possible speed is the average speed for - // the first / last step at current acceleration limit + // Formula for the average speed over a 1 step worth of distance if starting from zero and + // accelerating at the current limit. Since we can only change the speed every step this is a + // good lower limit for the entry and exit speeds. Note that for calculate_trapezoid_for_block() + // to work correctly, this must be accurately set and propagated. minimum_planner_speed_sqr = 0.5f * block->acceleration / steps_per_mm; + // Go straight to/from nominal speed if block->acceleration is too high for it. + NOMORE(minimum_planner_speed_sqr, sq(block->nominal_speed)); float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2 @@ -2763,8 +2745,7 @@ bool Planner::_populate_block( // Get the lowest speed vmax_junction_sqr = _MIN(vmax_junction_sqr, sq(block->nominal_speed), sq(previous_nominal_speed)); } - else // Init entry speed to zero. Assume it starts from rest. Planner will correct this later. - vmax_junction_sqr = 0; + else vmax_junction_sqr = minimum_planner_speed_sqr; prev_unit_vec = unit_vec; @@ -2806,8 +2787,7 @@ bool Planner::_populate_block( xyze_float_t speed_diff = current_speed; float vmax_junction; - const bool start_from_zero = !moves_queued || UNEAR_ZERO(previous_nominal_speed); - if (start_from_zero) { + if (!moves_queued || UNEAR_ZERO(previous_nominal_speed)) { // Limited by a jerk to/from full halt. vmax_junction = block->nominal_speed; } @@ -2837,28 +2817,20 @@ bool Planner::_populate_block( } vmax_junction_sqr = sq(vmax_junction * v_factor); - if (start_from_zero) minimum_planner_speed_sqr = vmax_junction_sqr; - #endif // CLASSIC_JERK + // High acceleration limits override low jerk/junction deviation limits (as fixing trapezoids + // or reducing acceleration introduces too much complexity and/or too much compute) + NOLESS(vmax_junction_sqr, minimum_planner_speed_sqr); + // Max entry speed of this block equals the max exit speed of the previous block. block->max_entry_speed_sqr = vmax_junction_sqr; - - // Initialize block entry speed. Compute based on deceleration to sqrt(minimum_planner_speed_sqr). - const float v_allowable_sqr = max_allowable_speed_sqr(-block->acceleration, minimum_planner_speed_sqr, block->millimeters); - - // Start with the minimum allowed speed + // Set entry speed. The reverse and forward passes will optimize it later. block->entry_speed_sqr = minimum_planner_speed_sqr; + // Set min entry speed. Rarely it could be higher than the previous nominal speed but that's ok. + block->min_entry_speed_sqr = minimum_planner_speed_sqr; - // Initialize planner efficiency flags - // Set flag if block will always reach maximum junction speed regardless of entry/exit speeds. - // If a block can de/ac-celerate from nominal speed to zero within the length of the block, then - // the current block and next block junction speeds are guaranteed to always be at their maximum - // junction speeds in deceleration and acceleration, respectively. This is due to how the current - // block nominal speed limits both the current and next maximum junction speeds. Hence, in both - // the reverse and forward planners, the corresponding block junction speed will always be at the - // the maximum junction speed and may always be ignored for any speed reduction checks. - block->flag.set_nominal(sq(block->nominal_speed) <= v_allowable_sqr); + block->flag.recalculate = true; // Update previous path unit_vector and nominal speed previous_speed = current_speed; @@ -2895,10 +2867,12 @@ void Planner::buffer_sync_block(const BlockFlagBit sync_flag/*=BLOCK_BIT_SYNC_PO block->flag.apply(sync_flag); block->position = position; + #if ENABLED(BACKLASH_COMPENSATION) LOOP_NUM_AXES(axis) block->position[axis] += backlash.get_applied_steps((AxisEnum)axis); #endif - #if ALL(HAS_FAN, LASER_SYNCHRONOUS_M106_M107) + + #if ENABLED(LASER_SYNCHRONOUS_M106_M107) FANS_LOOP(i) block->fan_speed[i] = thermalManager.fan_speed[i]; #endif @@ -3190,8 +3164,8 @@ bool Planner::buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s block->step_event_count = num_steps; block->initial_rate = block->final_rate = block->nominal_rate = last_page_step_rate; // steps/s - block->accelerate_until = 0; - block->decelerate_after = block->step_event_count; + block->accelerate_before = 0; + block->decelerate_start = block->step_event_count; // Will be set to last direction later if directional format. block->direction_bits.reset(); @@ -3227,6 +3201,10 @@ bool Planner::buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s * The provided ABCE position is in machine units. */ void Planner::set_machine_position_mm(const abce_pos_t &abce) { + + // When FT Motion is enabled, call synchronize() here instead of generating a sync block + if (TERN0(FT_MOTION, ftMotion.cfg.mode)) synchronize(); + TERN_(DISTINCT_E_FACTORS, last_extruder = active_extruder); TERN_(HAS_POSITION_FLOAT, position_float = abce); position.set( @@ -3320,16 +3298,12 @@ void Planner::refresh_positioning() { } // Apply limits to a variable and give a warning if the value was out of range -inline void limit_and_warn(float &val, const AxisEnum axis, PGM_P const setting_name, const xyze_float_t &max_limit) { +inline void limit_and_warn(float &val, const AxisEnum axis, FSTR_P const setting_name, const xyze_float_t &max_limit) { const uint8_t lim_axis = TERN_(HAS_EXTRUDERS, axis > E_AXIS ? E_AXIS :) axis; const float before = val; LIMIT(val, 0.1f, max_limit[lim_axis]); - if (before != val) { - SERIAL_CHAR(AXIS_CHAR(lim_axis)); - SERIAL_ECHOPGM(" Max "); - SERIAL_ECHOPGM_P(setting_name); - SERIAL_ECHOLNPGM(" limited to ", val); - } + if (before != val) + SERIAL_ECHOLN(C(AXIS_CHAR(lim_axis)), F(" Max "), setting_name, F(" limited to "), val); } /** @@ -3348,7 +3322,7 @@ void Planner::set_max_acceleration(const AxisEnum axis, float inMaxAccelMMS2) { constexpr xyze_float_t max_accel_edit = DEFAULT_MAX_ACCELERATION; const xyze_float_t max_acc_edit_scaled = max_accel_edit * 2; #endif - limit_and_warn(inMaxAccelMMS2, axis, PSTR("Acceleration"), max_acc_edit_scaled); + limit_and_warn(inMaxAccelMMS2, axis, F("Acceleration"), max_acc_edit_scaled); #endif settings.max_acceleration_mm_per_s2[axis] = inMaxAccelMMS2; @@ -3371,7 +3345,7 @@ void Planner::set_max_feedrate(const AxisEnum axis, float inMaxFeedrateMMS) { constexpr xyze_float_t max_fr_edit = DEFAULT_MAX_FEEDRATE; const xyze_float_t max_fr_edit_scaled = max_fr_edit * 2; #endif - limit_and_warn(inMaxFeedrateMMS, axis, PSTR("Feedrate"), max_fr_edit_scaled); + limit_and_warn(inMaxFeedrateMMS, axis, F("Feedrate"), max_fr_edit_scaled); #endif settings.max_feedrate_mm_s[axis] = inMaxFeedrateMMS; } @@ -3390,11 +3364,15 @@ void Planner::set_max_feedrate(const AxisEnum axis, float inMaxFeedrateMMS) { #ifdef MAX_JERK_EDIT_VALUES MAX_JERK_EDIT_VALUES #else - { (DEFAULT_XJERK) * 2, (DEFAULT_YJERK) * 2, - (DEFAULT_ZJERK) * 2, (DEFAULT_EJERK) * 2 } + LOGICAL_AXIS_ARRAY( + (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 + ) #endif ; - limit_and_warn(inMaxJerkMMS, axis, PSTR("Jerk"), max_jerk_edit); + limit_and_warn(inMaxJerkMMS, axis, F("Jerk"), max_jerk_edit); #endif max_jerk[axis] = inMaxJerkMMS; } diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 42eee677cb..fd26b4340e 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -111,11 +111,6 @@ enum BlockFlagBit { // Recalculate trapezoids on entry junction. For optimization. BLOCK_BIT_RECALCULATE, - // Nominal speed always reached. - // i.e., The segment is long enough, so the nominal speed is reachable if accelerating - // from a safe speed (in consideration of jerking from zero speed). - BLOCK_BIT_NOMINAL_LENGTH, - // The block is segment 2+ of a longer move BLOCK_BIT_CONTINUED, @@ -125,7 +120,6 @@ enum BlockFlagBit { // Direct stepping page OPTARG(DIRECT_STEPPING, BLOCK_BIT_PAGE) - // Sync the fan speeds from the block OPTARG(LASER_SYNCHRONOUS_M106_M107, BLOCK_BIT_SYNC_FANS) @@ -143,8 +137,6 @@ typedef struct { struct { bool recalculate:1; - bool nominal_length:1; - bool continued:1; bool sync_position:1; @@ -167,7 +159,6 @@ typedef struct { void apply(const uint8_t f) volatile { bits |= f; } void apply(const BlockFlagBit b) volatile { SBI(bits, b); } void reset(const BlockFlagBit b) volatile { bits = _BV(b); } - void set_nominal(const bool n) volatile { recalculate = true; if (n) nominal_length = true; } } block_flags_t; @@ -215,15 +206,17 @@ typedef struct PlannerBlock { volatile block_flags_t flag; // Block flags - bool is_fan_sync() { return TERN0(LASER_SYNCHRONOUS_M106_M107, flag.sync_fans); } - bool is_pwr_sync() { return TERN0(LASER_POWER_SYNC, flag.sync_laser_pwr); } - bool is_sync() { return flag.sync_position || is_fan_sync() || is_pwr_sync(); } + bool is_sync_pos() { return flag.sync_position; } + bool is_sync_fan() { return TERN0(LASER_SYNCHRONOUS_M106_M107, flag.sync_fans); } + bool is_sync_pwr() { return TERN0(LASER_POWER_SYNC, flag.sync_laser_pwr); } + bool is_sync() { return is_sync_pos() || is_sync_fan() || is_sync_pwr(); } bool is_page() { return TERN0(DIRECT_STEPPING, flag.page); } bool is_move() { return !(is_sync() || is_page()); } // Fields used by the motion planner to manage acceleration float nominal_speed, // The nominal speed for this block in (mm/sec) entry_speed_sqr, // Entry speed at previous-current junction in (mm/sec)^2 + min_entry_speed_sqr, // Minimum allowable junction entry speed in (mm/sec)^2 max_entry_speed_sqr, // Maximum allowable junction entry speed in (mm/sec)^2 millimeters, // The total travel of this block in mm acceleration; // acceleration mm/sec^2 @@ -245,8 +238,8 @@ typedef struct PlannerBlock { #endif // Settings for the trapezoid generator - uint32_t accelerate_until, // The index of the step event on which to stop acceleration - decelerate_after; // The index of the step event on which to start decelerating + uint32_t accelerate_before, // The index of the step event where cruising starts + decelerate_start; // The index of the step event on which to start decelerating #if ENABLED(S_CURVE_ACCELERATION) uint32_t cruise_rate, // The actual cruise rate to use, between end of the acceleration phase and start of deceleration phase @@ -255,7 +248,7 @@ typedef struct PlannerBlock { acceleration_time_inverse, // Inverse of acceleration and deceleration periods, expressed as integer. Scale depends on CPU being used deceleration_time_inverse; #else - uint32_t acceleration_rate; // The acceleration rate used for acceleration calculation + uint32_t acceleration_rate; // Acceleration rate in (2^24 steps)/timer_ticks*s #endif AxisBits direction_bits; // Direction bits set for this block, where 1 is negative motion @@ -454,7 +447,6 @@ class Planner { static uint16_t cleaning_buffer_counter; // A counter to disable queuing of blocks static uint8_t delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks - #if ENABLED(DISTINCT_E_FACTORS) static uint8_t last_extruder; // Respond to extruder change #endif @@ -635,7 +627,7 @@ class Planner { #if HAS_EXTRUDERS FORCE_INLINE static void refresh_e_factor(const uint8_t e) { - e_factor[e] = flow_percentage[e] * 0.01f * TERN(NO_VOLUMETRICS, 1.0f, volumetric_multiplier[e]); + e_factor[e] = flow_percentage[e] * 0.01f IF_DISABLED(NO_VOLUMETRICS, * volumetric_multiplier[e]); } static void set_flow(const uint8_t e, const int16_t flow) { @@ -1125,4 +1117,10 @@ class Planner { #define PLANNER_XY_FEEDRATE() _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) +#define ANY_AXIS_MOVES(BLOCK) \ + (false NUM_AXIS_GANG( \ + || BLOCK->steps.a, || BLOCK->steps.b, || BLOCK->steps.c, \ + || BLOCK->steps.i, || BLOCK->steps.j, || BLOCK->steps.k, \ + || BLOCK->steps.u, || BLOCK->steps.v, || BLOCK->steps.w)) + extern Planner planner; diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 0bd83bc3ac..616414a027 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -96,8 +96,6 @@ #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../lcd/e3v2/proui/dwin.h" #endif #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) @@ -356,28 +354,31 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { // Start preheating before waiting for user confirmation that the probe is ready. TERN_(PREHEAT_BEFORE_PROBING, if (deploy) probe.preheat_for_probing(0, PROBING_BED_TEMP, true)); - FSTR_P const ds_str = deploy ? GET_TEXT_F(MSG_MANUAL_DEPLOY) : GET_TEXT_F(MSG_MANUAL_STOW); + FSTR_P const ds_fstr = deploy ? GET_TEXT_F(MSG_MANUAL_DEPLOY) : GET_TEXT_F(MSG_MANUAL_STOW); ui.return_to_status(); // To display the new status message - ui.set_max_status(ds_str); + ui.set_max_status(ds_fstr); SERIAL_ECHOLN(deploy ? GET_EN_TEXT_F(MSG_MANUAL_DEPLOY) : GET_EN_TEXT_F(MSG_MANUAL_STOW)); OKAY_BUZZ(); #if ENABLED(PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED) + { // Wait for the probe to be attached or detached before asking for explicit user confirmation // Allow the user to interrupt - { - KEEPALIVE_STATE(PAUSED_FOR_USER); - TERN_(HAS_RESUME_CONTINUE, wait_for_user = true); - while (deploy == PROBE_TRIGGERED() && TERN1(HAS_RESUME_CONTINUE, wait_for_user)) idle_no_sleep(); - TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); - OKAY_BUZZ(); - } + KEEPALIVE_STATE(PAUSED_FOR_USER); + TERN_(HAS_RESUME_CONTINUE, wait_for_user = true); + while (deploy == PROBE_TRIGGERED() && TERN1(HAS_RESUME_CONTINUE, wait_for_user)) idle_no_sleep(); + TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); + OKAY_BUZZ(); + } #endif - TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(ds_str)); - TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired(ds_str)); - TERN_(DWIN_LCD_PROUI, dwinPopupConfirm(ICON_BLTouch, ds_str, FPSTR(CONTINUE_STR))); + TERN_(HOST_PROMPT_SUPPORT, hostui.continue_prompt(ds_fstr)); + #if ENABLED(DWIN_LCD_PROUI) + ExtUI::onUserConfirmRequired(ICON_BLTouch, ds_fstr, FPSTR(CONTINUE_STR)); + #elif ENABLED(EXTENSIBLE_UI) + ExtUI::onUserConfirmRequired(ds_fstr); + #endif TERN_(HAS_RESUME_CONTINUE, wait_for_user_response()); ui.reset_status(); @@ -998,7 +999,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai default: break; case PROBE_PT_RAISE: if (raise_after_is_relative) - do_z_clearance(current_position.z + z_clearance, false); + do_z_clearance_by(z_clearance); else do_z_clearance(z_clearance); break; @@ -1010,6 +1011,10 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai // If any error occurred stow the probe and set an alert if (isnan(measured_z)) { + // TODO: Disable steppers (unless G29_RETRY_AND_RECOVER or G29_HALT_ON_FAILURE are set). + // Something definitely went wrong at this point, so it might be a good idea to release the steppers. + // The user may want to quickly move the carriage or bed by hand to avoid bed damage from the (hot) nozzle. + // This would also benefit from the contemplated "Audio Alerts" feature. stow(); LCD_MESSAGE(MSG_LCD_PROBING_FAILED); #if DISABLED(G29_RETRY_AND_RECOVER) diff --git a/Marlin/src/module/scara.cpp b/Marlin/src/module/scara.cpp index 9c149670e9..0f00ab5643 100644 --- a/Marlin/src/module/scara.cpp +++ b/Marlin/src/module/scara.cpp @@ -229,9 +229,7 @@ float segments_per_second = DEFAULT_SEGMENTS_PER_SECOND; // Move all carriages together linearly until an endstop is hit. //do_blocking_move_to_xy_z(pos, mlz, homing_feedrate(Z_AXIS)); - current_position.x = 0 ; - current_position.y = 0 ; - current_position.z = max_length(Z_AXIS) ; + current_position.set(0, 0, max_length(Z_AXIS)); line_to_current_position(homing_feedrate(Z_AXIS)); planner.synchronize(); diff --git a/Marlin/src/module/scara.h b/Marlin/src/module/scara.h index 8ce50e55e1..c574b2f818 100644 --- a/Marlin/src/module/scara.h +++ b/Marlin/src/module/scara.h @@ -32,8 +32,8 @@ extern float segments_per_second; #if ENABLED(AXEL_TPARA) float constexpr L1 = TPARA_LINKAGE_1, L2 = TPARA_LINKAGE_2, // Float constants for Robot arm calculations - L1_2 = sq(float(L1)), L1_2_2 = 2.0 * L1_2, - L2_2 = sq(float(L2)); + L1_2 = FLOAT_SQ(L1), L1_2_2 = 2.0 * L1_2, + L2_2 = FLOAT_SQ(L2); void forward_kinematics(const_float_t a, const_float_t b, const_float_t c); void home_TPARA(); @@ -41,8 +41,8 @@ extern float segments_per_second; #else float constexpr L1 = SCARA_LINKAGE_1, L2 = SCARA_LINKAGE_2, // Float constants for SCARA calculations - L1_2 = sq(float(L1)), L1_2_2 = 2.0 * L1_2, - L2_2 = sq(float(L2)); + L1_2 = FLOAT_SQ(L1), L1_2_2 = 2.0 * L1_2, + L2_2 = FLOAT_SQ(L2); void forward_kinematics(const_float_t a, const_float_t b); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index da62a42781..a9f2f888bf 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -75,11 +75,13 @@ #include "../feature/z_stepper_align.h" #endif -#if ENABLED(EXTENSIBLE_UI) - #include "../lcd/extui/ui_api.h" -#elif ENABLED(DWIN_LCD_PROUI) +#if ENABLED(DWIN_LCD_PROUI) #include "../lcd/e3v2/proui/dwin.h" #include "../lcd/e3v2/proui/bedlevel_tools.h" +#endif + +#if ENABLED(EXTENSIBLE_UI) + #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) #include "../lcd/e3v2/jyersui/dwin.h" #endif @@ -490,6 +492,13 @@ typedef struct SettingsDataStruct { #endif uint32_t motor_current_setting[MOTOR_CURRENT_COUNT]; // M907 X Z E ... + // + // Adaptive Step Smoothing state + // + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + bool adaptive_step_smoothing_enabled; // G-code pending + #endif + // // CNC_COORDINATE_SYSTEMS // @@ -537,9 +546,7 @@ typedef struct SettingsDataStruct { // // Ender-3 V2 DWIN // - #if ENABLED(DWIN_LCD_PROUI) - uint8_t dwin_data[eeprom_data_size]; - #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) + #if ENABLED(DWIN_CREALITY_LCD_JYERSUI) uint8_t dwin_settings[jyersDWIN.eeprom_data_size]; #endif @@ -627,6 +634,10 @@ typedef struct SettingsDataStruct { float shaping_y_frequency, // M593 Y F shaping_y_zeta; // M593 Y D #endif + #if ENABLED(INPUT_SHAPING_Z) + float shaping_z_frequency, // M593 Z F + shaping_z_zeta; // M593 Z D + #endif // // HOTEND_IDLE_TIMEOUT @@ -702,7 +713,7 @@ void MarlinSettings::postprocess() { if (oldpos != current_position) report_current_position(); - // Moved as last update due to interference with Neopixel init + // Moved as last update due to interference with NeoPixel init TERN_(HAS_LCD_CONTRAST, ui.refresh_contrast()); TERN_(HAS_LCD_BRIGHTNESS, ui.refresh_brightness()); TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout()); @@ -729,7 +740,8 @@ void MarlinSettings::postprocess() { bool MarlinSettings::sd_update_status() { uint8_t val; - persistentStore.read_data(SD_FIRMWARE_UPDATE_EEPROM_ADDR, &val); + int pos = SD_FIRMWARE_UPDATE_EEPROM_ADDR; + persistentStore.read_data(pos, &val); return (val == SD_FIRMWARE_UPDATE_ACTIVE_VALUE); } @@ -856,7 +868,7 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(dummyf); #endif #else - const xyze_pos_t planner_max_jerk = LOGICAL_AXIS_ARRAY(float(DEFAULT_EJERK), 10, 10, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4); + const xyze_pos_t planner_max_jerk = LOGICAL_AXIS_ARRAY(5, 10, 10, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4); EEPROM_WRITE(planner_max_jerk); #endif @@ -1529,6 +1541,14 @@ void MarlinSettings::postprocess() { #endif } + // + // Adaptive Step Smoothing state + // + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + _FIELD_TEST(adaptive_step_smoothing_enabled); + EEPROM_WRITE(stepper.adaptive_step_smoothing_enabled); + #endif + // // CNC Coordinate Systems // @@ -1605,17 +1625,8 @@ void MarlinSettings::postprocess() { #endif // - // Creality DWIN User Data + // JyersUI DWIN User Data // - #if ENABLED(DWIN_LCD_PROUI) - { - _FIELD_TEST(dwin_data); - char dwin_data[eeprom_data_size] = { 0 }; - dwinCopySettingsTo(dwin_data); - EEPROM_WRITE(dwin_data); - } - #endif - #if ENABLED(DWIN_CREALITY_LCD_JYERSUI) { _FIELD_TEST(dwin_settings); @@ -1724,6 +1735,10 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(stepper.get_shaping_frequency(Y_AXIS)); EEPROM_WRITE(stepper.get_shaping_damping_ratio(Y_AXIS)); #endif + #if ENABLED(INPUT_SHAPING_Z) + EEPROM_WRITE(stepper.get_shaping_frequency(Z_AXIS)); + EEPROM_WRITE(stepper.get_shaping_damping_ratio(Z_AXIS)); + #endif #endif // @@ -1861,8 +1876,10 @@ void MarlinSettings::postprocess() { EEPROM_READ(planner.settings.min_segment_time_us); - float tmp2[NUM_AXES + e_factors]; - EEPROM_READ((uint8_t *)tmp2, sizeof(tmp2)); // axis_steps_per_mm + #if ENABLED(EDITABLE_STEPS_PER_UNIT) + float tmp2[NUM_AXES + e_factors]; + EEPROM_READ((uint8_t *)tmp2, sizeof(tmp2)); // axis_steps_per_mm + #endif feedRate_t tmp3[NUM_AXES + e_factors]; EEPROM_READ((uint8_t *)tmp3, sizeof(tmp3)); // max_feedrate_mm_s @@ -1931,7 +1948,7 @@ void MarlinSettings::postprocess() { _FIELD_TEST(runout_sensor_enabled); EEPROM_READ(runout_sensor_enabled); #if HAS_FILAMENT_SENSOR - runout.enabled = runout_sensor_enabled < 0 ? FIL_RUNOUT_ENABLED_DEFAULT : runout_sensor_enabled; + if (!validating) runout.enabled = runout_sensor_enabled < 0 ? FIL_RUNOUT_ENABLED_DEFAULT : runout_sensor_enabled; #endif TERN_(HAS_FILAMENT_SENSOR, if (runout.enabled) runout.reset()); @@ -2112,7 +2129,7 @@ void MarlinSettings::postprocess() { #if ENABLED(PTC_HOTEND) EEPROM_READ(ptc.z_offsets_hotend); #endif - ptc.reset_index(); + if (!validating) ptc.reset_index(); #else // No placeholder data for this feature #endif @@ -2596,6 +2613,13 @@ void MarlinSettings::postprocess() { #endif } + // + // Adaptive Step Smoothing state + // + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + EEPROM_READ(stepper.adaptive_step_smoothing_enabled); + #endif + // // CNC Coordinate System // @@ -2665,11 +2689,13 @@ void MarlinSettings::postprocess() { EEPROM_READ(backlash_smoothing_mm); #if ENABLED(BACKLASH_GCODE) + if (!validating) { LOOP_NUM_AXES(axis) backlash.set_distance_mm((AxisEnum)axis, backlash_distance_mm[axis]); backlash.set_correction_uint8(backlash_correction); #ifdef BACKLASH_SMOOTHING_MM backlash.set_smoothing_mm(backlash_smoothing_mm); #endif + } #endif } #endif // NUM_AXES @@ -2687,16 +2713,9 @@ void MarlinSettings::postprocess() { #endif // - // DWIN User Data + // JyersUI User Data // - #if ENABLED(DWIN_LCD_PROUI) - { - const char dwin_data[eeprom_data_size] = { 0 }; - _FIELD_TEST(dwin_data); - EEPROM_READ(dwin_data); - if (!validating) dwinCopySettingsFrom(dwin_data); - } - #elif ENABLED(DWIN_CREALITY_LCD_JYERSUI) + #if ENABLED(DWIN_CREALITY_LCD_JYERSUI) { const char dwin_settings[jyersDWIN.eeprom_data_size] = { 0 }; _FIELD_TEST(dwin_settings); @@ -2778,7 +2797,7 @@ void MarlinSettings::postprocess() { uint8_t ui_language; EEPROM_READ(ui_language); if (ui_language >= NUM_LANGUAGES) ui_language = 0; - ui.set_language(ui_language); + if (!validating) ui.set_language(ui_language); } #endif @@ -2802,19 +2821,34 @@ void MarlinSettings::postprocess() { // #if ENABLED(INPUT_SHAPING_X) { - float _data[2]; + struct { float freq, damp; } _data; EEPROM_READ(_data); - stepper.set_shaping_frequency(X_AXIS, _data[0]); - stepper.set_shaping_damping_ratio(X_AXIS, _data[1]); + if (!validating) { + stepper.set_shaping_frequency(X_AXIS, _data.freq); + stepper.set_shaping_damping_ratio(X_AXIS, _data.damp); + } } #endif #if ENABLED(INPUT_SHAPING_Y) { - float _data[2]; + struct { float freq, damp; } _data; EEPROM_READ(_data); - stepper.set_shaping_frequency(Y_AXIS, _data[0]); - stepper.set_shaping_damping_ratio(Y_AXIS, _data[1]); + if (!validating) { + stepper.set_shaping_frequency(Y_AXIS, _data.freq); + stepper.set_shaping_damping_ratio(Y_AXIS, _data.damp); + } + } + #endif + + #if ENABLED(INPUT_SHAPING_Z) + { + struct { float freq, damp; } _data; + EEPROM_READ(_data); + if (!validating) { + stepper.set_shaping_frequency(Z_AXIS, _data.freq); + stepper.set_shaping_damping_ratio(Z_AXIS, _data.damp); + } } #endif @@ -3465,7 +3499,7 @@ void MarlinSettings::reset() { #if HAS_BACKLIGHT_TIMEOUT ui.backlight_timeout_minutes = LCD_BACKLIGHT_TIMEOUT_MINS; #elif HAS_DISPLAY_SLEEP - ui.sleep_timeout_minutes = TERN(TOUCH_SCREEN, TOUCH_IDLE_SLEEP_MINS, DISPLAY_SLEEP_MINUTES); + ui.sleep_timeout_minutes = DISPLAY_SLEEP_MINUTES; #endif #endif @@ -3541,6 +3575,13 @@ void MarlinSettings::reset() { DEBUG_ECHOLNPGM("Digipot Written"); #endif + // + // Adaptive Step Smoothing state + // + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + stepper.adaptive_step_smoothing_enabled = true; + #endif + // // CNC Coordinate System // @@ -3586,11 +3627,6 @@ void MarlinSettings::reset() { // TERN_(DGUS_LCD_UI_MKS, MKS_reset_settings()); - // - // Ender-3 V2 with ProUI - // - TERN_(DWIN_LCD_PROUI, dwinSetDataDefaults()); - // // Model predictive control // @@ -3648,6 +3684,10 @@ void MarlinSettings::reset() { stepper.set_shaping_frequency(Y_AXIS, SHAPING_FREQ_Y); stepper.set_shaping_damping_ratio(Y_AXIS, SHAPING_ZETA_Y); #endif + #if ENABLED(INPUT_SHAPING_Z) + stepper.set_shaping_frequency(Z_AXIS, SHAPING_FREQ_Z); + stepper.set_shaping_damping_ratio(Z_AXIS, SHAPING_ZETA_Z); + #endif #endif // diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 8d55d37b96..083d2019dc 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -58,10 +58,16 @@ * * time -----> * - * The trapezoid is the shape the speed curve over time. It starts at block->initial_rate, accelerates - * first block->accelerate_until step_events_completed, then keeps going at constant speed until - * step_events_completed reaches block->decelerate_after after which it decelerates until the trapezoid generator is reset. - * The slope of acceleration is calculated using v = u + at where t is the accumulated timer values of the steps so far. + * The speed over time graph forms a TRAPEZOID. The slope of acceleration is calculated by + * v = u + t + * where 't' is the accumulated timer values of the steps so far. + * + * The Stepper ISR dynamically executes acceleration, deceleration, and cruising according to the block parameters. + * - Start at block->initial_rate. + * - Accelerate while step_events_completed < block->accelerate_before. + * - Cruise while step_events_completed < block->decelerate_start. + * - Decelerate after that, until all steps are completed. + * - Reset the trapezoid generator. */ /** @@ -193,6 +199,7 @@ bool Stepper::abort_current_block; ; #endif +// In timer_ticks uint32_t Stepper::acceleration_time, Stepper::deceleration_time; #if MULTISTEPPING_LIMIT > 1 @@ -203,19 +210,29 @@ uint32_t Stepper::acceleration_time, Stepper::deceleration_time; hal_timer_t Stepper::time_spent_in_isr = 0, Stepper::time_spent_out_isr = 0; #endif +#if ENABLED(ADAPTIVE_STEP_SMOOTHING) + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + bool Stepper::adaptive_step_smoothing_enabled; // Initialized by settings.load() + #else + constexpr bool Stepper::adaptive_step_smoothing_enabled; // = true + #endif + // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis + uint8_t Stepper::oversampling_factor; +#else + constexpr uint8_t Stepper::oversampling_factor; // = 0 +#endif + #if ENABLED(FREEZE_FEATURE) bool Stepper::frozen; // = false #endif -IF_DISABLED(ADAPTIVE_STEP_SMOOTHING, constexpr) uint8_t Stepper::oversampling_factor; - xyze_long_t Stepper::delta_error{0}; xyze_long_t Stepper::advance_dividend{0}; uint32_t Stepper::advance_divisor = 0, Stepper::step_events_completed = 0, // The number of step events executed in the current block - Stepper::accelerate_until, // The count at which to stop accelerating - Stepper::decelerate_after, // The count at which to start decelerating + Stepper::accelerate_before, // The count at which to start cruising + Stepper::decelerate_start, // The count at which to start decelerating Stepper::step_event_count; // The total event count for the current block #if ANY(HAS_MULTI_EXTRUDER, MIXING_EXTRUDER) @@ -264,20 +281,16 @@ uint32_t Stepper::advance_divisor = 0, shaping_echo_axis_t ShapingQueue::echo_axes[shaping_echoes]; uint16_t ShapingQueue::tail = 0; - #if ENABLED(INPUT_SHAPING_X) - shaping_time_t ShapingQueue::delay_x; - shaping_time_t ShapingQueue::peek_x_val = shaping_time_t(-1); - uint16_t ShapingQueue::head_x = 0; - uint16_t ShapingQueue::_free_count_x = shaping_echoes - 1; - ShapeParams Stepper::shaping_x; - #endif - #if ENABLED(INPUT_SHAPING_Y) - shaping_time_t ShapingQueue::delay_y; - shaping_time_t ShapingQueue::peek_y_val = shaping_time_t(-1); - uint16_t ShapingQueue::head_y = 0; - uint16_t ShapingQueue::_free_count_y = shaping_echoes - 1; - ShapeParams Stepper::shaping_y; - #endif + #define SHAPING_VAR_DEFS(AXIS) \ + shaping_time_t ShapingQueue::delay_##AXIS; \ + shaping_time_t ShapingQueue::_peek_##AXIS = shaping_time_t(-1); \ + uint16_t ShapingQueue::head_##AXIS = 0; \ + uint16_t ShapingQueue::_free_count_##AXIS = shaping_echoes - 1; \ + ShapeParams Stepper::shaping_##AXIS; + + TERN_(INPUT_SHAPING_X, SHAPING_VAR_DEFS(x)) + TERN_(INPUT_SHAPING_Y, SHAPING_VAR_DEFS(y)) + TERN_(INPUT_SHAPING_Z, SHAPING_VAR_DEFS(z)) #endif #if ENABLED(BABYSTEPPING) @@ -542,12 +555,30 @@ void Stepper::enable_axis(const AxisEnum axis) { default: break; } mark_axis_enabled(axis); + + TERN_(EXTENSIBLE_UI, ExtUI::onAxisEnabled(ExtUI::axis_to_axis_t(axis))); } +/** + * Mark an axis as disabled and power off its stepper(s). + * If one of the axis steppers is still in use by a non-disabled axis the axis will remain powered. + * DISCUSSION: It's basically just stepper ENA pins that are shared across axes, not whole steppers. + * Used on MCUs with a shortage of pins. We already track the overlap of ENA pins, so now + * we just need stronger logic to track which ENA pins are being set more than once. + * + * It would be better to use a bit mask (i.e., Flags). + * While the method try_to_disable in gcode/control/M17_M18_M84.cpp does use the + * bit mask, it is still only at the axis level. + * TODO: Power off steppers that don't share another axis. Currently axis-based steppers turn off as a unit. + * So we'd need to power off the off axis, then power on the on axis (for a microsecond). + * A global solution would keep a usage count when enabling or disabling a stepper, but this partially + * defeats the purpose of an on/off mask. + */ bool Stepper::disable_axis(const AxisEnum axis) { mark_axis_disabled(axis); - TERN_(DWIN_LCD_PROUI, set_axis_untrusted(axis)); // MRISCOC workaround: https://github.com/MarlinFirmware/Marlin/issues/23095 + // This scheme prevents shared steppers being disabled. It should consider several axes at once + // and keep a count of how many times each ENA pin has been set. // If all the axes that share the enabled bit are disabled const bool can_disable = can_axis_disable(axis); @@ -557,7 +588,9 @@ bool Stepper::disable_axis(const AxisEnum axis) { MAIN_AXIS_MAP(_CASE_DISABLE) default: break; } + TERN_(EXTENSIBLE_UI, ExtUI::onAxisDisabled(ExtUI::axis_to_axis_t(axis))); } + return can_disable; } @@ -617,6 +650,11 @@ void Stepper::disable_all_steppers() { TERN_(EXTENSIBLE_UI, ExtUI::onSteppersDisabled()); } +#if ENABLED(FTM_OPTIMIZE_DIR_STATES) + // We'll compare the updated DIR bits to the last set state + static AxisBits last_set_direction; +#endif + // Set a single axis direction based on the last set flags. // A direction bit of "1" indicates forward or positive motion. #define SET_STEP_DIR(A) do{ \ @@ -642,6 +680,8 @@ void Stepper::apply_directions() { SET_STEP_DIR(U), SET_STEP_DIR(V), SET_STEP_DIR(W) ); + TERN_(FTM_OPTIMIZE_DIR_STATES, last_set_direction = last_direction_bits); + DIR_WAIT_AFTER(); } @@ -1512,8 +1552,20 @@ void Stepper::isr() { nextMainISR = FTM_MIN_TICKS; // Set to minimum interval (a limit on the top speed) ftMotion_stepper(); // Run FTM Stepping } - interval = nextMainISR; // Interval is either some old nextMainISR or FTM_MIN_TICKS - nextMainISR = 0; // For FT Motion fire again ASAP + + #if ENABLED(BABYSTEPPING) + if (nextBabystepISR == 0) { // Avoid ANY stepping too soon after baby-stepping + nextBabystepISR = babystepping_isr(); + NOLESS(nextMainISR, (BABYSTEP_TICKS) / 8); // FULL STOP for 125µs after a baby-step + } + if (nextBabystepISR != BABYSTEP_NEVER) // Avoid baby-stepping too close to axis Stepping + NOLESS(nextBabystepISR, nextMainISR / 2); // TODO: Only look at axes enabled for baby-stepping + #endif + + interval = nextMainISR; // Interval is either some old nextMainISR or FTM_MIN_TICKS + TERN_(BABYSTEPPING, NOMORE(interval, nextBabystepISR)); // Come back early for Babystepping? + + nextMainISR = 0; // For FT Motion fire again ASAP } #endif @@ -1554,6 +1606,7 @@ void Stepper::isr() { interval = _MIN(nextMainISR, uint32_t(HAL_TIMER_TYPE_MAX)); // Time until the next Pulse / Block phase TERN_(INPUT_SHAPING_X, NOMORE(interval, ShapingQueue::peek_x())); // Time until next input shaping echo for X TERN_(INPUT_SHAPING_Y, NOMORE(interval, ShapingQueue::peek_y())); // Time until next input shaping echo for Y + TERN_(INPUT_SHAPING_Z, NOMORE(interval, ShapingQueue::peek_z())); // Time until next input shaping echo for Z TERN_(LIN_ADVANCE, NOMORE(interval, nextAdvanceISR)); // Come back early for Linear Advance? TERN_(BABYSTEPPING, NOMORE(interval, nextBabystepISR)); // Come back early for Babystepping? @@ -1698,6 +1751,10 @@ void Stepper::pulse_phase_isr() { shaping_y.delta_error = 0; shaping_y.last_block_end_pos = count_position.y; #endif + #if ENABLED(INPUT_SHAPING_Z) + shaping_z.delta_error = 0; + shaping_z.last_block_end_pos = count_position.z; + #endif #endif } } @@ -1757,6 +1814,12 @@ void Stepper::pulse_phase_isr() { #else #define HYSTERESIS_Y 0 #endif + #if AXIS_DRIVER_TYPE_Z(TMC2208) || AXIS_DRIVER_TYPE_Z(TMC2208_STANDALONE) || \ + AXIS_DRIVER_TYPE_Z(TMC5160) || AXIS_DRIVER_TYPE_Z(TMC5160_STANDALONE) + #define HYSTERESIS_Z 64 + #else + #define HYSTERESIS_Z 0 + #endif #define _HYSTERESIS(AXIS) HYSTERESIS_##AXIS #define HYSTERESIS(AXIS) _HYSTERESIS(AXIS) @@ -1771,6 +1834,7 @@ void Stepper::pulse_phase_isr() { last_direction_bits.toggle(_AXIS(AXIS)); \ DIR_WAIT_BEFORE(); \ SET_STEP_DIR(AXIS); \ + TERN_(FTM_OPTIMIZE_DIR_STATES, last_set_direction = last_direction_bits); \ DIR_WAIT_AFTER(); \ } \ } \ @@ -1948,9 +2012,10 @@ void Stepper::pulse_phase_isr() { #if HAS_ZV_SHAPING // record an echo if a step is needed in the primary bresenham const bool x_step = TERN0(INPUT_SHAPING_X, step_needed.x && shaping_x.enabled), - y_step = TERN0(INPUT_SHAPING_Y, step_needed.y && shaping_y.enabled); - if (x_step || y_step) - ShapingQueue::enqueue(x_step, TERN0(INPUT_SHAPING_X, shaping_x.forward), y_step, TERN0(INPUT_SHAPING_Y, shaping_y.forward)); + y_step = TERN0(INPUT_SHAPING_Y, step_needed.y && shaping_y.enabled), + z_step = TERN0(INPUT_SHAPING_Z, step_needed.z && shaping_z.enabled); + if (x_step || y_step || z_step) + ShapingQueue::enqueue(x_step, TERN0(INPUT_SHAPING_X, shaping_x.forward), y_step, TERN0(INPUT_SHAPING_Y, shaping_y.forward), z_step, TERN0(INPUT_SHAPING_Z, shaping_z.forward)); // do the first part of the secondary bresenham #if ENABLED(INPUT_SHAPING_X) @@ -1961,6 +2026,10 @@ void Stepper::pulse_phase_isr() { if (y_step) PULSE_PREP_SHAPING(Y, shaping_y.delta_error, shaping_y.forward ? shaping_y.factor1 : -shaping_y.factor1); #endif + #if ENABLED(INPUT_SHAPING_Z) + if (z_step) + PULSE_PREP_SHAPING(Z, shaping_z.delta_error, shaping_z.forward ? shaping_z.factor1 : -shaping_z.factor1); + #endif #endif } @@ -2067,6 +2136,7 @@ void Stepper::pulse_phase_isr() { // Clear the echoes that are ready to process. If the buffers are too full and risk overflow, also apply echoes early. TERN_(INPUT_SHAPING_X, step_needed.x = !ShapingQueue::peek_x() || ShapingQueue::free_count_x() < steps_per_isr); TERN_(INPUT_SHAPING_Y, step_needed.y = !ShapingQueue::peek_y() || ShapingQueue::free_count_y() < steps_per_isr); + TERN_(INPUT_SHAPING_Z, step_needed.z = !ShapingQueue::peek_z() || ShapingQueue::free_count_z() < steps_per_isr); if (bool(step_needed)) while (true) { #if ENABLED(INPUT_SHAPING_X) @@ -2085,6 +2155,14 @@ void Stepper::pulse_phase_isr() { } #endif + #if ENABLED(INPUT_SHAPING_Z) + if (step_needed.z) { + const bool forward = ShapingQueue::dequeue_z(); + PULSE_PREP_SHAPING(Z, shaping_z.delta_error, (forward ? shaping_z.factor2 : -shaping_z.factor2)); + PULSE_START(Z); + } + #endif + TERN_(I2S_STEPPER_STREAM, i2s_push_sample()); USING_TIMED_PULSE(); @@ -2099,10 +2177,14 @@ void Stepper::pulse_phase_isr() { #if ENABLED(INPUT_SHAPING_Y) PULSE_STOP(Y); #endif + #if ENABLED(INPUT_SHAPING_Z) + PULSE_STOP(Z); + #endif } TERN_(INPUT_SHAPING_X, step_needed.x = !ShapingQueue::peek_x() || ShapingQueue::free_count_x() < steps_per_isr); TERN_(INPUT_SHAPING_Y, step_needed.y = !ShapingQueue::peek_y() || ShapingQueue::free_count_y() < steps_per_isr); + TERN_(INPUT_SHAPING_Z, step_needed.z = !ShapingQueue::peek_z() || ShapingQueue::free_count_z() < steps_per_isr); if (!bool(step_needed)) break; @@ -2218,6 +2300,90 @@ hal_timer_t Stepper::calc_multistep_timer_interval(uint32_t step_rate) { return calc_timer_interval(step_rate); } +// Method to get all moving axes (for proper endstop handling) +void Stepper::set_axis_moved_for_current_block() { + + #if IS_CORE + // Define conditions for checking endstops + #define S_(N) current_block->steps[CORE_AXIS_##N] + #define D_(N) current_block->direction_bits[CORE_AXIS_##N] + #endif + + #if CORE_IS_XY || CORE_IS_XZ + /** + * Head direction in -X axis for CoreXY and CoreXZ bots. + * + * If steps differ, both axes are moving. + * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z, handled below) + * If DeltaA == DeltaB, the movement is only in the 1st axis (X) + */ + #if ANY(COREXY, COREXZ) + #define X_CMP(A,B) ((A)==(B)) + #else + #define X_CMP(A,B) ((A)!=(B)) + #endif + #define X_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && X_CMP(D_(1),D_(2))) ) + #elif ENABLED(MARKFORGED_XY) + #define X_MOVE_TEST (current_block->steps.a != current_block->steps.b) + #else + #define X_MOVE_TEST !!current_block->steps.a + #endif + + #if CORE_IS_XY || CORE_IS_YZ + /** + * Head direction in -Y axis for CoreXY / CoreYZ bots. + * + * If steps differ, both axes are moving + * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y) + * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z) + */ + #if ANY(COREYX, COREYZ) + #define Y_CMP(A,B) ((A)==(B)) + #else + #define Y_CMP(A,B) ((A)!=(B)) + #endif + #define Y_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && Y_CMP(D_(1),D_(2))) ) + #elif ENABLED(MARKFORGED_YX) + #define Y_MOVE_TEST (current_block->steps.a != current_block->steps.b) + #else + #define Y_MOVE_TEST !!current_block->steps.b + #endif + + #if CORE_IS_XZ || CORE_IS_YZ + /** + * Head direction in -Z axis for CoreXZ or CoreYZ bots. + * + * If steps differ, both axes are moving + * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y, already handled above) + * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Z) + */ + #if ANY(COREZX, COREZY) + #define Z_CMP(A,B) ((A)==(B)) + #else + #define Z_CMP(A,B) ((A)!=(B)) + #endif + #define Z_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && Z_CMP(D_(1),D_(2))) ) + #else + #define Z_MOVE_TEST !!current_block->steps.c + #endif + + // Set flags for all axes that move in this block + // These are set per-axis, not per-stepper + AxisBits didmove; + NUM_AXIS_CODE( + if (X_MOVE_TEST) didmove.a = true, // Cartesian X or Kinematic A + if (Y_MOVE_TEST) didmove.b = true, // Cartesian Y or Kinematic B + if (Z_MOVE_TEST) didmove.c = true, // Cartesian Z or Kinematic C + if (!!current_block->steps.i) didmove.i = true, + if (!!current_block->steps.j) didmove.j = true, + if (!!current_block->steps.k) didmove.k = true, + if (!!current_block->steps.u) didmove.u = true, + if (!!current_block->steps.v) didmove.v = true, + if (!!current_block->steps.w) didmove.w = true + ); + axis_did_move = didmove; +} + /** * This last phase of the stepper interrupt processes and properly * schedules planner blocks. This is executed after the step pulses @@ -2269,7 +2435,7 @@ hal_timer_t Stepper::block_phase_isr() { // Step events not completed yet... // Are we in acceleration phase ? - if (step_events_completed <= accelerate_until) { // Calculate new timer value + if (step_events_completed < accelerate_before) { // Calculate new timer value #if ENABLED(S_CURVE_ACCELERATION) // Get the next speed to use (Jerk limited!) @@ -2286,6 +2452,7 @@ hal_timer_t Stepper::block_phase_isr() { // step_rate to timer interval and steps per stepper isr interval = calc_multistep_timer_interval(acc_step_rate << oversampling_factor); acceleration_time += interval; + deceleration_time = 0; // Reset since we're doing acceleration first. #if ENABLED(NONLINEAR_EXTRUSION) calc_nonlinear_e(acc_step_rate << oversampling_factor); @@ -2307,16 +2474,13 @@ hal_timer_t Stepper::block_phase_isr() { * Laser power variables are calulated and stored in this block by the planner code. * trap_ramp_active_pwr - the active power in this block across accel or decel trap steps. * trap_ramp_entry_incr - holds the precalculated value to increase the current power per accel step. - * - * Apply the starting active power and then increase power per step by the trap_ramp_entry_incr value if positive. */ - #if ENABLED(LASER_POWER_TRAP) if (cutter.cutter_mode == CUTTER_MODE_CONTINUOUS) { if (planner.laser_inline.status.isPowered && planner.laser_inline.status.isEnabled) { if (current_block->laser.trap_ramp_entry_incr > 0) { cutter.apply_power(current_block->laser.trap_ramp_active_pwr); - current_block->laser.trap_ramp_active_pwr += current_block->laser.trap_ramp_entry_incr; + current_block->laser.trap_ramp_active_pwr += current_block->laser.trap_ramp_entry_incr * steps_per_isr; } } // Not a powered move. @@ -2325,30 +2489,24 @@ hal_timer_t Stepper::block_phase_isr() { #endif } // Are we in Deceleration phase ? - else if (step_events_completed > decelerate_after) { + else if (step_events_completed >= decelerate_start) { uint32_t step_rate; #if ENABLED(S_CURVE_ACCELERATION) - // If this is the 1st time we process the 2nd half of the trapezoid... if (!bezier_2nd_half) { // Initialize the Bézier speed curve _calc_bezier_curve_coeffs(current_block->cruise_rate, current_block->final_rate, current_block->deceleration_time_inverse); bezier_2nd_half = true; - // The first point starts at cruise rate. Just save evaluation of the Bézier curve - step_rate = current_block->cruise_rate; } - else { - // Calculate the next speed to use - step_rate = deceleration_time < current_block->deceleration_time - ? _eval_bezier_curve(deceleration_time) - : current_block->final_rate; - } - + // Calculate the next speed to use + step_rate = deceleration_time < current_block->deceleration_time + ? _eval_bezier_curve(deceleration_time) + : current_block->final_rate; #else // Using the old trapezoidal control step_rate = STEP_MULTIPLY(deceleration_time, current_block->acceleration_rate); - if (step_rate < acc_step_rate) { // Still decelerating? + if (step_rate < acc_step_rate) { step_rate = acc_step_rate - step_rate; NOLESS(step_rate, current_block->final_rate); } @@ -2380,6 +2538,8 @@ hal_timer_t Stepper::block_phase_isr() { E_APPLY_DIR(forward_e, false); + TERN_(FTM_OPTIMIZE_DIR_STATES, last_set_direction = last_direction_bits); + DIR_WAIT_AFTER(); } } @@ -2388,15 +2548,12 @@ hal_timer_t Stepper::block_phase_isr() { } #endif // LIN_ADVANCE - /** - * Adjust Laser Power - Decelerating - * trap_ramp_entry_decr - holds the precalculated value to decrease the current power per decel step. - */ + // Adjust Laser Power - Decelerating #if ENABLED(LASER_POWER_TRAP) if (cutter.cutter_mode == CUTTER_MODE_CONTINUOUS) { if (planner.laser_inline.status.isPowered && planner.laser_inline.status.isEnabled) { if (current_block->laser.trap_ramp_exit_decr > 0) { - current_block->laser.trap_ramp_active_pwr -= current_block->laser.trap_ramp_exit_decr; + current_block->laser.trap_ramp_active_pwr -= current_block->laser.trap_ramp_exit_decr * steps_per_isr; cutter.apply_power(current_block->laser.trap_ramp_active_pwr); } // Not a powered move. @@ -2412,6 +2569,9 @@ hal_timer_t Stepper::block_phase_isr() { if (ticks_nominal == 0) { // step_rate to timer interval and loops for the nominal speed ticks_nominal = calc_multistep_timer_interval(current_block->nominal_rate << oversampling_factor); + // Prepare for deceleration + IF_DISABLED(S_CURVE_ACCELERATION, acc_step_rate = current_block->nominal_rate); + deceleration_time = ticks_nominal / 2; #if ENABLED(NONLINEAR_EXTRUSION) calc_nonlinear_e(current_block->nominal_rate << oversampling_factor); @@ -2421,30 +2581,25 @@ hal_timer_t Stepper::block_phase_isr() { if (la_active) la_interval = calc_timer_interval(current_block->nominal_rate >> current_block->la_scaling); #endif + + // Adjust Laser Power - Cruise + #if ENABLED(LASER_POWER_TRAP) + if (cutter.cutter_mode == CUTTER_MODE_CONTINUOUS) { + if (planner.laser_inline.status.isPowered && planner.laser_inline.status.isEnabled) { + if (current_block->laser.trap_ramp_entry_incr > 0) { + current_block->laser.trap_ramp_active_pwr = current_block->laser.power; + cutter.apply_power(current_block->laser.power); + } + } + // Not a powered move. + else cutter.apply_power(0); + } + #endif } // The timer interval is just the nominal value for the nominal speed interval = ticks_nominal; } - - /** - * Adjust Laser Power - Cruise - * power - direct or floor adjusted active laser power. - */ - #if ENABLED(LASER_POWER_TRAP) - if (cutter.cutter_mode == CUTTER_MODE_CONTINUOUS) { - if (step_events_completed + 1 == accelerate_until) { - if (planner.laser_inline.status.isPowered && planner.laser_inline.status.isEnabled) { - if (current_block->laser.trap_ramp_entry_incr > 0) { - current_block->laser.trap_ramp_active_pwr = current_block->laser.power; - cutter.apply_power(current_block->laser.power); - } - } - // Not a powered move. - else cutter.apply_power(0); - } - } - #endif } #if ENABLED(LASER_FEATURE) @@ -2456,7 +2611,8 @@ hal_timer_t Stepper::block_phase_isr() { */ if (cutter.cutter_mode == CUTTER_MODE_DYNAMIC && planner.laser_inline.status.isPowered // isPowered flag set on any parsed G1, G2, G3, or G5 move; cleared on any others. - && cutter.last_block_power != current_block->laser.power // Prevent constant update without change + && current_block // Block may not be available if steps completed (see discard_current_block() above) + && cutter.last_block_power != current_block->laser.power // Only update if the power changed ) { cutter.apply_power(current_block->laser.power); cutter.last_block_power = current_block->laser.power; @@ -2477,25 +2633,31 @@ hal_timer_t Stepper::block_phase_isr() { // Anything in the buffer? if ((current_block = planner.get_current_block())) { - // Sync block? Sync the stepper counts or fan speeds and return + // Run through all sync blocks while (current_block->is_sync()) { + // Set laser power #if ENABLED(LASER_POWER_SYNC) if (cutter.cutter_mode == CUTTER_MODE_CONTINUOUS) { - if (current_block->is_pwr_sync()) { + if (current_block->is_sync_pwr()) { planner.laser_inline.status.isSyncPower = true; cutter.apply_power(current_block->laser.power); } } #endif - TERN_(LASER_SYNCHRONOUS_M106_M107, if (current_block->is_fan_sync()) planner.sync_fan_speeds(current_block->fan_speed)); + // Set "fan speeds" for a laser module + #if ENABLED(LASER_SYNCHRONOUS_M106_M107) + if (current_block->is_sync_fan()) planner.sync_fan_speeds(current_block->fan_speed); + #endif - if (!(current_block->is_fan_sync() || current_block->is_pwr_sync())) _set_position(current_block->position); + // Set position + if (current_block->is_sync_pos()) _set_position(current_block->position); + // Done with this block discard_current_block(); - // Try to get a new block + // Try to get a new block. Exit if there are no more. if (!(current_block = planner.get_current_block())) return interval; // No more queued movements! } @@ -2529,100 +2691,16 @@ hal_timer_t Stepper::block_phase_isr() { } #endif - // Flag all moving axes for proper endstop handling - - #if IS_CORE - // Define conditions for checking endstops - #define S_(N) current_block->steps[CORE_AXIS_##N] - #define D_(N) current_block->direction_bits[CORE_AXIS_##N] - #endif - - #if CORE_IS_XY || CORE_IS_XZ - /** - * Head direction in -X axis for CoreXY and CoreXZ bots. - * - * If steps differ, both axes are moving. - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z, handled below) - * If DeltaA == DeltaB, the movement is only in the 1st axis (X) - */ - #if ANY(COREXY, COREXZ) - #define X_CMP(A,B) ((A)==(B)) - #else - #define X_CMP(A,B) ((A)!=(B)) - #endif - #define X_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && X_CMP(D_(1),D_(2))) ) - #elif ENABLED(MARKFORGED_XY) - #define X_MOVE_TEST (current_block->steps.a != current_block->steps.b) - #else - #define X_MOVE_TEST !!current_block->steps.a - #endif - - #if CORE_IS_XY || CORE_IS_YZ - /** - * Head direction in -Y axis for CoreXY / CoreYZ bots. - * - * If steps differ, both axes are moving - * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y) - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Y or Z) - */ - #if ANY(COREYX, COREYZ) - #define Y_CMP(A,B) ((A)==(B)) - #else - #define Y_CMP(A,B) ((A)!=(B)) - #endif - #define Y_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && Y_CMP(D_(1),D_(2))) ) - #elif ENABLED(MARKFORGED_YX) - #define Y_MOVE_TEST (current_block->steps.a != current_block->steps.b) - #else - #define Y_MOVE_TEST !!current_block->steps.b - #endif - - #if CORE_IS_XZ || CORE_IS_YZ - /** - * Head direction in -Z axis for CoreXZ or CoreYZ bots. - * - * If steps differ, both axes are moving - * If DeltaA == DeltaB, the movement is only in the 1st axis (X or Y, already handled above) - * If DeltaA == -DeltaB, the movement is only in the 2nd axis (Z) - */ - #if ANY(COREZX, COREZY) - #define Z_CMP(A,B) ((A)==(B)) - #else - #define Z_CMP(A,B) ((A)!=(B)) - #endif - #define Z_MOVE_TEST ( S_(1) != S_(2) || (S_(1) > 0 && Z_CMP(D_(1),D_(2))) ) - #else - #define Z_MOVE_TEST !!current_block->steps.c - #endif - - AxisBits didmove; - NUM_AXIS_CODE( - if (X_MOVE_TEST) didmove.a = true, - if (Y_MOVE_TEST) didmove.b = true, - if (Z_MOVE_TEST) didmove.c = true, - if (current_block->steps.i) didmove.i = true, - if (current_block->steps.j) didmove.j = true, - if (current_block->steps.k) didmove.k = true, - if (current_block->steps.u) didmove.u = true, - if (current_block->steps.v) didmove.v = true, - if (current_block->steps.w) didmove.w = true - ); - //if (current_block->steps.e) didmove.e = true; - //if (current_block->steps.a) didmove.x = true; - //if (current_block->steps.b) didmove.y = true; - //if (current_block->steps.c) didmove.z = true; - axis_did_move = didmove; - - // No acceleration / deceleration time elapsed so far - acceleration_time = deceleration_time = 0; + // Set flags for all moving axes, accounting for kinematics + set_axis_moved_for_current_block(); #if ENABLED(ADAPTIVE_STEP_SMOOTHING) // Nonlinear Extrusion needs at least 2x oversampling to permit increase of E step rate // Otherwise assume no axis smoothing (via oversampling) - oversampling_factor = TERN(NONLINEAR_EXTRUSION, 1, 0); + oversampling_factor = TERN0(NONLINEAR_EXTRUSION, 1); // Decide if axis smoothing is possible - if (TERN1(DWIN_LCD_PROUI, hmiData.adaptiveStepSmoothing)) { + if (stepper.adaptive_step_smoothing_enabled) { uint32_t max_rate = current_block->nominal_rate; // Get the step event rate while (max_rate < MIN_STEP_ISR_FREQUENCY) { // As long as more ISRs are possible... max_rate <<= 1; // Try to double the rate @@ -2655,7 +2733,7 @@ hal_timer_t Stepper::block_phase_isr() { } #endif - // Y follows the same logic as X (but the comments aren't repeated) + // Y and Z follow the same logic as X (but the comments aren't repeated) #if ENABLED(INPUT_SHAPING_Y) if (shaping_y.enabled) { const int64_t steps = current_block->direction_bits.y ? int64_t(current_block->steps.y) : -int64_t(current_block->steps.y); @@ -2665,12 +2743,21 @@ hal_timer_t Stepper::block_phase_isr() { } #endif + #if ENABLED(INPUT_SHAPING_Z) + if (shaping_z.enabled) { + const int64_t steps = current_block->direction_bits.z ? int64_t(current_block->steps.z) : -int64_t(current_block->steps.z); + shaping_z.last_block_end_pos += steps; + shaping_z.forward = current_block->direction_bits.z; + if (!ShapingQueue::empty_z()) current_block->direction_bits.z = last_direction_bits.z; + } + #endif + // No step events completed so far step_events_completed = 0; // Compute the acceleration and deceleration points - accelerate_until = current_block->accelerate_until << oversampling_factor; - decelerate_after = current_block->decelerate_after << oversampling_factor; + accelerate_before = current_block->accelerate_before << oversampling_factor; + decelerate_start = current_block->decelerate_start << oversampling_factor; TERN_(MIXING_EXTRUDER, mixer.stepper_setup(current_block->b_color)); @@ -2743,7 +2830,7 @@ hal_timer_t Stepper::block_phase_isr() { ne_edividend = advance_dividend.e; const float scale = (float(ne_edividend) / advance_divisor) * planner.mm_per_step[E_AXIS_N(current_block->extruder)]; ne_scale = (1L << 24) * scale; - if (current_block->direction_bits.e) { + if (current_block->direction_bits.e && ANY_AXIS_MOVES(current_block)) { ne_fix.A = (1L << 24) * ne.A; ne_fix.B = (1L << 24) * ne.B; ne_fix.C = (1L << 24) * ne.C; @@ -2756,7 +2843,8 @@ hal_timer_t Stepper::block_phase_isr() { // Calculate the initial timer interval interval = calc_multistep_timer_interval(current_block->initial_rate << oversampling_factor); - acceleration_time += interval; + // Initialize ac/deceleration time as if half the time passed. + acceleration_time = deceleration_time = interval / 2; #if ENABLED(NONLINEAR_EXTRUSION) calc_nonlinear_e(current_block->initial_rate << oversampling_factor); @@ -3166,12 +3254,14 @@ void Stepper::init() { hal.isr_off(); TERN_(INPUT_SHAPING_X, if (axis == X_AXIS) { shaping_x.factor2 = factor2; shaping_x.factor1 = 128 - factor2; shaping_x.zeta = zeta; }) TERN_(INPUT_SHAPING_Y, if (axis == Y_AXIS) { shaping_y.factor2 = factor2; shaping_y.factor1 = 128 - factor2; shaping_y.zeta = zeta; }) + TERN_(INPUT_SHAPING_Z, if (axis == Z_AXIS) { shaping_z.factor2 = factor2; shaping_z.factor1 = 128 - factor2; shaping_z.zeta = zeta; }) if (was_on) hal.isr_on(); } float Stepper::get_shaping_damping_ratio(const AxisEnum axis) { TERN_(INPUT_SHAPING_X, if (axis == X_AXIS) return shaping_x.zeta); TERN_(INPUT_SHAPING_Y, if (axis == Y_AXIS) return shaping_y.zeta); + TERN_(INPUT_SHAPING_Z, if (axis == Z_AXIS) return shaping_z.zeta); return -1; } @@ -3183,24 +3273,18 @@ void Stepper::init() { hal.isr_off(); const shaping_time_t delay = freq ? float(uint32_t(STEPPER_TIMER_RATE) / 2) / freq : shaping_time_t(-1); - #if ENABLED(INPUT_SHAPING_X) - if (axis == X_AXIS) { - ShapingQueue::set_delay(X_AXIS, delay); - shaping_x.frequency = freq; - shaping_x.enabled = !!freq; - shaping_x.delta_error = 0; - shaping_x.last_block_end_pos = count_position.x; + #define SHAPING_SET_FREQ_FOR_AXIS(AXISN, AXISL) \ + if (axis == AXISN) { \ + ShapingQueue::set_delay(AXISN, delay); \ + shaping_##AXISL.frequency = freq; \ + shaping_##AXISL.enabled = !!freq; \ + shaping_##AXISL.delta_error = 0; \ + shaping_##AXISL.last_block_end_pos = count_position.AXISL; \ } - #endif - #if ENABLED(INPUT_SHAPING_Y) - if (axis == Y_AXIS) { - ShapingQueue::set_delay(Y_AXIS, delay); - shaping_y.frequency = freq; - shaping_y.enabled = !!freq; - shaping_y.delta_error = 0; - shaping_y.last_block_end_pos = count_position.y; - } - #endif + + TERN_(INPUT_SHAPING_X, SHAPING_SET_FREQ_FOR_AXIS(X_AXIS, x)) + TERN_(INPUT_SHAPING_Y, SHAPING_SET_FREQ_FOR_AXIS(Y_AXIS, y)) + TERN_(INPUT_SHAPING_Z, SHAPING_SET_FREQ_FOR_AXIS(Z_AXIS, z)) if (was_on) hal.isr_on(); } @@ -3208,6 +3292,7 @@ void Stepper::init() { float Stepper::get_shaping_frequency(const AxisEnum axis) { TERN_(INPUT_SHAPING_X, if (axis == X_AXIS) return shaping_x.frequency); TERN_(INPUT_SHAPING_Y, if (axis == Y_AXIS) return shaping_y.frequency); + TERN_(INPUT_SHAPING_Z, if (axis == Z_AXIS) return shaping_z.frequency); return -1; } @@ -3229,17 +3314,17 @@ void Stepper::_set_position(const abce_long_t &spos) { #if ENABLED(INPUT_SHAPING_Y) const int32_t y_shaping_delta = count_position.y - shaping_y.last_block_end_pos; #endif + #if ENABLED(INPUT_SHAPING_Z) + const int32_t z_shaping_delta = count_position.z - shaping_z.last_block_end_pos; + #endif #if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX) + // Core equations follow the form of the dA and dB equations at https://www.corexy.com/theory.html #if CORE_IS_XY - // corexy positioning - // these equations follow the form of the dA and dB equations on https://www.corexy.com/theory.html count_position.set(spos.a + spos.b, CORESIGN(spos.a - spos.b) OPTARG(HAS_Z_AXIS, spos.c)); #elif CORE_IS_XZ - // corexz planning count_position.set(spos.a + spos.c, spos.b, CORESIGN(spos.a - spos.c)); #elif CORE_IS_YZ - // coreyz planning count_position.set(spos.a, spos.b + spos.c, CORESIGN(spos.b - spos.c)); #elif ENABLED(MARKFORGED_XY) count_position.set(spos.a TERN(MARKFORGED_INVERSE, +, -) spos.b, spos.b, spos.c); @@ -3272,6 +3357,12 @@ void Stepper::_set_position(const abce_long_t &spos) { shaping_y.last_block_end_pos = spos.y; } #endif + #if ENABLED(INPUT_SHAPING_Z) + if (shaping_z.enabled) { + count_position.z += z_shaping_delta; + shaping_z.last_block_end_pos = spos.z; + } + #endif } /** @@ -3313,6 +3404,7 @@ void Stepper::set_axis_position(const AxisEnum a, const int32_t &v) { count_position[a] = v; TERN_(INPUT_SHAPING_X, if (a == X_AXIS) shaping_x.last_block_end_pos = v); TERN_(INPUT_SHAPING_Y, if (a == Y_AXIS) shaping_y.last_block_end_pos = v); + TERN_(INPUT_SHAPING_Z, if (a == Z_AXIS) shaping_z.last_block_end_pos = v); #ifdef __AVR__ // Reenable Stepper ISR @@ -3435,16 +3527,24 @@ void Stepper::report_positions() { #if ENABLED(FT_MOTION) - // Set stepper I/O for fixed time controller. + /** + * Run stepping from the Stepper ISR at regular short intervals. + * + * - Set ftMotion.sts_stepperBusy state to reflect whether there are any commands in the circular buffer. + * - If there are no commands in the buffer, return. + * - Get the next command from the circular buffer ftMotion.stepperCmdBuff[]. + * - If the block is being aborted, return without processing the command. + * - Apply STEP/DIR along with any delays required. A command may be empty, with no STEP/DIR. + */ void Stepper::ftMotion_stepper() { + static AxisBits direction_bits{0}; + // Check if the buffer is empty. ftMotion.sts_stepperBusy = (ftMotion.stepperCmdBuff_produceIdx != ftMotion.stepperCmdBuff_consumeIdx); if (!ftMotion.sts_stepperBusy) return; // "Pop" one command from current motion buffer - // Use one byte to restore one stepper command in the format: - // |X_step|X_direction|Y_step|Y_direction|Z_step|Z_direction|E_step|E_direction| const ft_command_t command = ftMotion.stepperCmdBuff[ftMotion.stepperCmdBuff_consumeIdx]; if (++ftMotion.stepperCmdBuff_consumeIdx == (FTM_STEPPERCMD_BUFF_SIZE)) ftMotion.stepperCmdBuff_consumeIdx = 0; @@ -3453,58 +3553,80 @@ void Stepper::report_positions() { USING_TIMED_PULSE(); - axis_did_move = LOGICAL_AXIS_ARRAY( + // Get FT Motion command flags for axis STEP / DIR + #define _FTM_STEP(AXIS) TEST(command, FT_BIT_STEP_##AXIS) + #define _FTM_DIR(AXIS) TEST(command, FT_BIT_DIR_##AXIS) + + AxisBits axis_step; + axis_step = LOGICAL_AXIS_ARRAY( TEST(command, FT_BIT_STEP_E), TEST(command, FT_BIT_STEP_X), TEST(command, FT_BIT_STEP_Y), TEST(command, FT_BIT_STEP_Z), TEST(command, FT_BIT_STEP_I), TEST(command, FT_BIT_STEP_J), TEST(command, FT_BIT_STEP_K), TEST(command, FT_BIT_STEP_U), TEST(command, FT_BIT_STEP_V), TEST(command, FT_BIT_STEP_W) ); - last_direction_bits = LOGICAL_AXIS_ARRAY( - axis_did_move.e ? TEST(command, FT_BIT_DIR_E) : last_direction_bits.e, - axis_did_move.x ? TEST(command, FT_BIT_DIR_X) : last_direction_bits.x, - axis_did_move.y ? TEST(command, FT_BIT_DIR_Y) : last_direction_bits.y, - axis_did_move.z ? TEST(command, FT_BIT_DIR_Z) : last_direction_bits.z, - axis_did_move.i ? TEST(command, FT_BIT_DIR_I) : last_direction_bits.i, - axis_did_move.j ? TEST(command, FT_BIT_DIR_J) : last_direction_bits.j, - axis_did_move.k ? TEST(command, FT_BIT_DIR_K) : last_direction_bits.k, - axis_did_move.u ? TEST(command, FT_BIT_DIR_U) : last_direction_bits.u, - axis_did_move.v ? TEST(command, FT_BIT_DIR_V) : last_direction_bits.v, - axis_did_move.w ? TEST(command, FT_BIT_DIR_W) : last_direction_bits.w + direction_bits = LOGICAL_AXIS_ARRAY( + axis_step.e ? TEST(command, FT_BIT_DIR_E) : direction_bits.e, + axis_step.x ? TEST(command, FT_BIT_DIR_X) : direction_bits.x, + axis_step.y ? TEST(command, FT_BIT_DIR_Y) : direction_bits.y, + axis_step.z ? TEST(command, FT_BIT_DIR_Z) : direction_bits.z, + axis_step.i ? TEST(command, FT_BIT_DIR_I) : direction_bits.i, + axis_step.j ? TEST(command, FT_BIT_DIR_J) : direction_bits.j, + axis_step.k ? TEST(command, FT_BIT_DIR_K) : direction_bits.k, + axis_step.u ? TEST(command, FT_BIT_DIR_U) : direction_bits.u, + axis_step.v ? TEST(command, FT_BIT_DIR_V) : direction_bits.v, + axis_step.w ? TEST(command, FT_BIT_DIR_W) : direction_bits.w ); // Apply directions (which will apply to the entire linear move) LOGICAL_AXIS_CODE( - E_APPLY_DIR(last_direction_bits.e, false), - X_APPLY_DIR(last_direction_bits.x, false), Y_APPLY_DIR(last_direction_bits.y, false), Z_APPLY_DIR(last_direction_bits.z, false), - I_APPLY_DIR(last_direction_bits.i, false), J_APPLY_DIR(last_direction_bits.j, false), K_APPLY_DIR(last_direction_bits.k, false), - U_APPLY_DIR(last_direction_bits.u, false), V_APPLY_DIR(last_direction_bits.v, false), W_APPLY_DIR(last_direction_bits.w, false) + E_APPLY_DIR(direction_bits.e, false), + X_APPLY_DIR(direction_bits.x, false), Y_APPLY_DIR(direction_bits.y, false), Z_APPLY_DIR(direction_bits.z, false), + I_APPLY_DIR(direction_bits.i, false), J_APPLY_DIR(direction_bits.j, false), K_APPLY_DIR(direction_bits.k, false), + U_APPLY_DIR(direction_bits.u, false), V_APPLY_DIR(direction_bits.v, false), W_APPLY_DIR(direction_bits.w, false) ); - DIR_WAIT_AFTER(); + /** + * Update direction bits for steppers that were stepped by this command. + * HX, HY, HZ direction bits were set for Core kinematics + * when the block was fetched and are not overwritten here. + */ // Start a step pulse LOGICAL_AXIS_CODE( - E_APPLY_STEP(axis_did_move.e, false), - X_APPLY_STEP(axis_did_move.x, false), Y_APPLY_STEP(axis_did_move.y, false), Z_APPLY_STEP(axis_did_move.z, false), - I_APPLY_STEP(axis_did_move.i, false), J_APPLY_STEP(axis_did_move.j, false), K_APPLY_STEP(axis_did_move.k, false), - U_APPLY_STEP(axis_did_move.u, false), V_APPLY_STEP(axis_did_move.v, false), W_APPLY_STEP(axis_did_move.w, false) + E_APPLY_STEP(axis_step.e, false), + X_APPLY_STEP(axis_step.x, false), Y_APPLY_STEP(axis_step.y, false), Z_APPLY_STEP(axis_step.z, false), + I_APPLY_STEP(axis_step.i, false), J_APPLY_STEP(axis_step.j, false), K_APPLY_STEP(axis_step.k, false), + U_APPLY_STEP(axis_step.u, false), V_APPLY_STEP(axis_step.v, false), W_APPLY_STEP(axis_step.w, false) ); + if (TERN1(FTM_OPTIMIZE_DIR_STATES, last_set_direction != last_direction_bits)) { + // Apply directions (generally applying to the entire linear move) + #define _FTM_APPLY_DIR(AXIS) if (TERN1(FTM_OPTIMIZE_DIR_STATES, last_direction_bits[_AXIS(A)] != last_set_direction[_AXIS(AXIS)])) \ + SET_STEP_DIR(AXIS); + LOGICAL_AXIS_MAP(_FTM_APPLY_DIR); + + TERN_(FTM_OPTIMIZE_DIR_STATES, last_set_direction = last_direction_bits); + + // Any DIR change requires a wait period + DIR_WAIT_AFTER(); + } + + // Start step pulses. Edge stepping will toggle the STEP pin. + #define _FTM_STEP_START(AXIS) AXIS##_APPLY_STEP(_FTM_STEP(AXIS), false); + LOGICAL_AXIS_MAP(_FTM_STEP_START); + + // Apply steps via I2S TERN_(I2S_STEPPER_STREAM, i2s_push_sample()); // Begin waiting for the minimum pulse duration START_TIMED_PULSE(); // Update step counts - LOGICAL_AXIS_CODE( - if (axis_did_move.e) count_position.e += last_direction_bits.e ? 1 : -1, if (axis_did_move.x) count_position.x += last_direction_bits.x ? 1 : -1, - if (axis_did_move.y) count_position.y += last_direction_bits.y ? 1 : -1, if (axis_did_move.z) count_position.z += last_direction_bits.z ? 1 : -1, - if (axis_did_move.i) count_position.i += last_direction_bits.i ? 1 : -1, if (axis_did_move.j) count_position.j += last_direction_bits.j ? 1 : -1, - if (axis_did_move.k) count_position.k += last_direction_bits.k ? 1 : -1, if (axis_did_move.u) count_position.u += last_direction_bits.u ? 1 : -1, - if (axis_did_move.v) count_position.v += last_direction_bits.v ? 1 : -1, if (axis_did_move.w) count_position.w += last_direction_bits.w ? 1 : -1 - ); + #define _FTM_STEP_COUNT(AXIS) if (axis_step[_AXIS(AXIS)]) count_position[_AXIS(AXIS)] += direction_bits[_AXIS(AXIS)] ? 1 : -1; + LOGICAL_AXIS_MAP(_FTM_STEP_COUNT); + // Provide EDGE flags for E stepper(s) #if HAS_EXTRUDERS #if ENABLED(E_DUAL_STEPPER_DRIVERS) constexpr bool e_axis_has_dedge = AXIS_HAS_DEDGE(E0) && AXIS_HAS_DEDGE(E1); @@ -3517,38 +3639,32 @@ void Stepper::report_positions() { // Only wait for axes without edge stepping const bool any_wait = false LOGICAL_AXIS_GANG( - || (!e_axis_has_dedge && axis_did_move.e), - || (!AXIS_HAS_DEDGE(X) && axis_did_move.x), || (!AXIS_HAS_DEDGE(Y) && axis_did_move.y), || (!AXIS_HAS_DEDGE(Z) && axis_did_move.z), - || (!AXIS_HAS_DEDGE(I) && axis_did_move.i), || (!AXIS_HAS_DEDGE(J) && axis_did_move.j), || (!AXIS_HAS_DEDGE(K) && axis_did_move.k), - || (!AXIS_HAS_DEDGE(U) && axis_did_move.u), || (!AXIS_HAS_DEDGE(V) && axis_did_move.v), || (!AXIS_HAS_DEDGE(W) && axis_did_move.w) + || (!e_axis_has_dedge && axis_step.e), + || (!AXIS_HAS_DEDGE(X) && axis_step.x), || (!AXIS_HAS_DEDGE(Y) && axis_step.y), || (!AXIS_HAS_DEDGE(Z) && axis_step.z), + || (!AXIS_HAS_DEDGE(I) && axis_step.i), || (!AXIS_HAS_DEDGE(J) && axis_step.j), || (!AXIS_HAS_DEDGE(K) && axis_step.k), + || (!AXIS_HAS_DEDGE(U) && axis_step.u), || (!AXIS_HAS_DEDGE(V) && axis_step.v), || (!AXIS_HAS_DEDGE(W) && axis_step.w) ); // Allow pulses to be registered by stepper drivers if (any_wait) AWAIT_HIGH_PULSE(); // Stop pulses. Axes with DEDGE will do nothing, assuming STEP_STATE_* is HIGH - LOGICAL_AXIS_CODE( - E_APPLY_STEP(!STEP_STATE_E, false), - X_APPLY_STEP(!STEP_STATE_X, false), Y_APPLY_STEP(!STEP_STATE_Y, false), Z_APPLY_STEP(!STEP_STATE_Z, false), - I_APPLY_STEP(!STEP_STATE_I, false), J_APPLY_STEP(!STEP_STATE_J, false), K_APPLY_STEP(!STEP_STATE_K, false), - U_APPLY_STEP(!STEP_STATE_U, false), V_APPLY_STEP(!STEP_STATE_V, false), W_APPLY_STEP(!STEP_STATE_W, false) - ); - - // Check endstops on every step - IF_DISABLED(ENDSTOP_INTERRUPTS_FEATURE, endstops.update()); + #define _FTM_STEP_STOP(AXIS) AXIS##_APPLY_STEP(!STEP_STATE_##AXIS, false); + LOGICAL_AXIS_MAP(_FTM_STEP_STOP); // Also handle babystepping here TERN_(BABYSTEPPING, if (babystep.has_steps()) babystepping_isr()); } // Stepper::ftMotion_stepper + // Called from FTMotion::loop (when !blockProcRdy) which is called from Marlin idle() void Stepper::ftMotion_blockQueueUpdate() { if (current_block) { - // If the current block is not done processing, return right away + // If the current block is not done processing, return right away. + // A block is done processing when the command buffer has been + // filled, not necessarily when it's done running. if (!ftMotion.getBlockProcDn()) return; - - axis_did_move.reset(); planner.release_current_block(); } @@ -3556,10 +3672,37 @@ void Stepper::report_positions() { current_block = planner.get_current_block(); if (current_block) { - // Sync block? Sync the stepper counts and return - while (current_block->is_sync()) { - TERN_(LASER_FEATURE, if (!(current_block->is_fan_sync() || current_block->is_pwr_sync()))) _set_position(current_block->position); + // Sync position, fan power, laser power? + while (current_block->is_sync()) { + + #if 0 + + // TODO: Implement compatible sync blocks with FT Motion commands, + // perhaps by setting a FT_BIT_SYNC flag that holds the current block + // until it is processed by ftMotion_stepper + + // Set laser power + #if ENABLED(LASER_POWER_SYNC) + if (cutter.cutter_mode == CUTTER_MODE_CONTINUOUS) { + if (current_block->is_sync_pwr()) { + planner.laser_inline.status.isSyncPower = true; + cutter.apply_power(current_block->laser.power); + } + } + #endif + + // Set "fan speeds" for a laser module + #if ENABLED(LASER_SYNCHRONOUS_M106_M107) + if (current_block->is_sync_fan()) planner.sync_fan_speeds(current_block->fan_speed); + #endif + + // Set position + if (current_block->is_sync_pos()) _set_position(current_block->position); + + #endif + + // Done with this block planner.release_current_block(); // Try to get a new block @@ -3567,6 +3710,17 @@ void Stepper::report_positions() { return; // No queued blocks. } + // Some kinematics track axis motion in HX, HY, HZ + #if ANY(CORE_IS_XY, CORE_IS_XZ, MARKFORGED_XY, MARKFORGED_YX) + last_direction_bits.hx = current_block->direction_bits.hx; + #endif + #if ANY(CORE_IS_XY, CORE_IS_YZ, MARKFORGED_XY, MARKFORGED_YX) + last_direction_bits.hy = current_block->direction_bits.hy; + #endif + #if ANY(CORE_IS_XZ, CORE_IS_YZ) + last_direction_bits.hz = current_block->direction_bits.hz; + #endif + ftMotion.startBlockProc(); return; } @@ -3785,7 +3939,7 @@ void Stepper::report_positions() { #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) case 1: #endif - #if ANY_PIN(MOTOR_CURRENT_PWM_E, MOTOR_CURRENT_PWM_E0, MOTOR_CURRENT_PWM_E1) + #if HAS_MOTOR_CURRENT_PWM_E case 2: #endif set_digipot_current(i, motor_current_setting[i]); @@ -4122,22 +4276,22 @@ void Stepper::report_positions() { break; #endif #if HAS_I_MS_PINS - case I_AXIS: WRITE(I_MS1_PIN, ms1); break + case I_AXIS: WRITE(I_MS1_PIN, ms1); break; #endif #if HAS_J_MS_PINS - case J_AXIS: WRITE(J_MS1_PIN, ms1); break + case J_AXIS: WRITE(J_MS1_PIN, ms1); break; #endif #if HAS_K_MS_PINS - case K_AXIS: WRITE(K_MS1_PIN, ms1); break + case K_AXIS: WRITE(K_MS1_PIN, ms1); break; #endif #if HAS_U_MS_PINS - case U_AXIS: WRITE(U_MS1_PIN, ms1); break + case U_AXIS: WRITE(U_MS1_PIN, ms1); break; #endif #if HAS_V_MS_PINS - case V_AXIS: WRITE(V_MS1_PIN, ms1); break + case V_AXIS: WRITE(V_MS1_PIN, ms1); break; #endif #if HAS_W_MS_PINS - case W_AXIS: WRITE(W_MS1_PIN, ms1); break + case W_AXIS: WRITE(W_MS1_PIN, ms1); break; #endif #if HAS_E0_MS_PINS case E_AXIS: WRITE(E0_MS1_PIN, ms1); break; @@ -4202,22 +4356,22 @@ void Stepper::report_positions() { break; #endif #if HAS_I_MS_PINS - case I_AXIS: WRITE(I_MS2_PIN, ms2); break + case I_AXIS: WRITE(I_MS2_PIN, ms2); break; #endif #if HAS_J_MS_PINS - case J_AXIS: WRITE(J_MS2_PIN, ms2); break + case J_AXIS: WRITE(J_MS2_PIN, ms2); break; #endif #if HAS_K_MS_PINS - case K_AXIS: WRITE(K_MS2_PIN, ms2); break + case K_AXIS: WRITE(K_MS2_PIN, ms2); break; #endif #if HAS_U_MS_PINS - case U_AXIS: WRITE(U_MS2_PIN, ms2); break + case U_AXIS: WRITE(U_MS2_PIN, ms2); break; #endif #if HAS_V_MS_PINS - case V_AXIS: WRITE(V_MS2_PIN, ms2); break + case V_AXIS: WRITE(V_MS2_PIN, ms2); break; #endif #if HAS_W_MS_PINS - case W_AXIS: WRITE(W_MS2_PIN, ms2); break + case W_AXIS: WRITE(W_MS2_PIN, ms2); break; #endif #if HAS_E0_MS_PINS case E_AXIS: WRITE(E0_MS2_PIN, ms2); break; @@ -4281,23 +4435,23 @@ void Stepper::report_positions() { #endif break; #endif - #if HAS_I_MS_PINS - case I_AXIS: WRITE(I_MS3_PIN, ms3); break + #if HAS_I_MS_PINS && PIN_EXISTS(I_MS3) + case I_AXIS: WRITE(I_MS3_PIN, ms3); break; #endif - #if HAS_J_MS_PINS - case J_AXIS: WRITE(J_MS3_PIN, ms3); break + #if HAS_J_MS_PINS && PIN_EXISTS(J_MS3) + case J_AXIS: WRITE(J_MS3_PIN, ms3); break; #endif - #if HAS_K_MS_PINS - case K_AXIS: WRITE(K_MS3_PIN, ms3); break + #if HAS_K_MS_PINS && PIN_EXISTS(K_MS3) + case K_AXIS: WRITE(K_MS3_PIN, ms3); break; #endif - #if HAS_U_MS_PINS - case U_AXIS: WRITE(U_MS3_PIN, ms3); break + #if HAS_U_MS_PINS && PIN_EXISTS(U_MS3) + case U_AXIS: WRITE(U_MS3_PIN, ms3); break; #endif - #if HAS_V_MS_PINS - case V_AXIS: WRITE(V_MS3_PIN, ms3); break + #if HAS_V_MS_PINS && PIN_EXISTS(V_MS3) + case V_AXIS: WRITE(V_MS3_PIN, ms3); break; #endif - #if HAS_W_MS_PINS - case W_AXIS: WRITE(W_MS3_PIN, ms3); break + #if HAS_W_MS_PINS && PIN_EXISTS(W_MS3) + case W_AXIS: WRITE(W_MS3_PIN, ms3); break; #endif #if HAS_E0_MS_PINS && PIN_EXISTS(E0_MS3) case E_AXIS: WRITE(E0_MS3_PIN, ms3); break; diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 99fd2d2936..8cf6d39dea 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -143,7 +143,8 @@ constexpr ena_mask_t enable_overlap[] = { constexpr float _ISDASU[] = DEFAULT_AXIS_STEPS_PER_UNIT; constexpr feedRate_t _ISDMF[] = DEFAULT_MAX_FEEDRATE; constexpr float max_shaped_rate = TERN0(INPUT_SHAPING_X, _ISDMF[X_AXIS] * _ISDASU[X_AXIS]) + - TERN0(INPUT_SHAPING_Y, _ISDMF[Y_AXIS] * _ISDASU[Y_AXIS]); + TERN0(INPUT_SHAPING_Y, _ISDMF[Y_AXIS] * _ISDASU[Y_AXIS]) + + TERN0(INPUT_SHAPING_Z, _ISDMF[Z_AXIS] * _ISDASU[Z_AXIS]); #if defined(__AVR__) || !defined(ADAPTIVE_STEP_SMOOTHING) // MIN_STEP_ISR_FREQUENCY is known at compile time on AVRs and any reduction in SRAM is welcome template constexpr float max_isr_rate() { @@ -159,16 +160,17 @@ constexpr ena_mask_t enable_overlap[] = { #endif #ifndef SHAPING_MIN_FREQ - #define SHAPING_MIN_FREQ _MIN(0x7FFFFFFFL OPTARG(INPUT_SHAPING_X, SHAPING_FREQ_X) OPTARG(INPUT_SHAPING_Y, SHAPING_FREQ_Y)) + #define SHAPING_MIN_FREQ _MIN(__FLT_MAX__ OPTARG(INPUT_SHAPING_X, SHAPING_FREQ_X) OPTARG(INPUT_SHAPING_Y, SHAPING_FREQ_Y) OPTARG(INPUT_SHAPING_Z, SHAPING_FREQ_Z)) #endif - constexpr uint16_t shaping_min_freq = SHAPING_MIN_FREQ, - shaping_echoes = max_step_rate / shaping_min_freq / 2 + 3; + constexpr float shaping_min_freq = SHAPING_MIN_FREQ; + constexpr uint16_t shaping_echoes = FLOOR(max_step_rate / shaping_min_freq / 2) + 3; typedef hal_timer_t shaping_time_t; enum shaping_echo_t { ECHO_NONE = 0, ECHO_FWD = 1, ECHO_BWD = 2 }; struct shaping_echo_axis_t { TERN_(INPUT_SHAPING_X, shaping_echo_t x:2); TERN_(INPUT_SHAPING_Y, shaping_echo_t y:2); + TERN_(INPUT_SHAPING_Z, shaping_echo_t z:2); }; class ShapingQueue { @@ -178,96 +180,89 @@ constexpr ena_mask_t enable_overlap[] = { static shaping_echo_axis_t echo_axes[shaping_echoes]; static uint16_t tail; - #if ENABLED(INPUT_SHAPING_X) - static shaping_time_t delay_x; // = shaping_time_t(-1) to disable queueing - static shaping_time_t peek_x_val; - static uint16_t head_x; - static uint16_t _free_count_x; - #endif - #if ENABLED(INPUT_SHAPING_Y) - static shaping_time_t delay_y; // = shaping_time_t(-1) to disable queueing - static shaping_time_t peek_y_val; - static uint16_t head_y; - static uint16_t _free_count_y; - #endif + #define SHAPING_QUEUE_AXIS_VARS(AXIS) \ + static shaping_time_t delay_##AXIS; /* = shaping_time_t(-1) to disable queueing*/ \ + static shaping_time_t _peek_##AXIS; \ + static uint16_t head_##AXIS; \ + static uint16_t _free_count_##AXIS; + + TERN_(INPUT_SHAPING_X, SHAPING_QUEUE_AXIS_VARS(x)) + TERN_(INPUT_SHAPING_Y, SHAPING_QUEUE_AXIS_VARS(y)) + TERN_(INPUT_SHAPING_Z, SHAPING_QUEUE_AXIS_VARS(z)) public: static void decrement_delays(const shaping_time_t interval) { now += interval; - TERN_(INPUT_SHAPING_X, if (peek_x_val != shaping_time_t(-1)) peek_x_val -= interval); - TERN_(INPUT_SHAPING_Y, if (peek_y_val != shaping_time_t(-1)) peek_y_val -= interval); + TERN_(INPUT_SHAPING_X, if (_peek_x != shaping_time_t(-1)) _peek_x -= interval); + TERN_(INPUT_SHAPING_Y, if (_peek_y != shaping_time_t(-1)) _peek_y -= interval); + TERN_(INPUT_SHAPING_Z, if (_peek_z != shaping_time_t(-1)) _peek_z -= interval); } static void set_delay(const AxisEnum axis, const shaping_time_t delay) { TERN_(INPUT_SHAPING_X, if (axis == X_AXIS) delay_x = delay); TERN_(INPUT_SHAPING_Y, if (axis == Y_AXIS) delay_y = delay); + TERN_(INPUT_SHAPING_Z, if (axis == Z_AXIS) delay_z = delay); } - static void enqueue(const bool x_step, const bool x_forward, const bool y_step, const bool y_forward) { - #if ENABLED(INPUT_SHAPING_X) - if (x_step) { - if (head_x == tail) peek_x_val = delay_x; - echo_axes[tail].x = x_forward ? ECHO_FWD : ECHO_BWD; - _free_count_x--; + + static void enqueue(const bool x_step, const bool x_forward, const bool y_step, const bool y_forward, const bool z_step, const bool z_forward) { + #define SHAPING_QUEUE_ENQUEUE(AXIS) \ + if (AXIS##_step) { \ + if (head_##AXIS == tail) _peek_##AXIS = delay_##AXIS; \ + echo_axes[tail].AXIS = AXIS##_forward ? ECHO_FWD : ECHO_BWD; \ + _free_count_##AXIS--; \ + } \ + else { \ + echo_axes[tail].AXIS = ECHO_NONE; \ + if (head_##AXIS != tail) \ + _free_count_##AXIS--; \ + else if (++head_##AXIS == shaping_echoes) \ + head_##AXIS = 0; \ } - else { - echo_axes[tail].x = ECHO_NONE; - if (head_x != tail) - _free_count_x--; - else if (++head_x == shaping_echoes) - head_x = 0; - } - #endif - #if ENABLED(INPUT_SHAPING_Y) - if (y_step) { - if (head_y == tail) peek_y_val = delay_y; - echo_axes[tail].y = y_forward ? ECHO_FWD : ECHO_BWD; - _free_count_y--; - } - else { - echo_axes[tail].y = ECHO_NONE; - if (head_y != tail) - _free_count_y--; - else if (++head_y == shaping_echoes) - head_y = 0; - } - #endif + + TERN_(INPUT_SHAPING_X, SHAPING_QUEUE_ENQUEUE(x)) + TERN_(INPUT_SHAPING_Y, SHAPING_QUEUE_ENQUEUE(y)) + TERN_(INPUT_SHAPING_Z, SHAPING_QUEUE_ENQUEUE(z)) + times[tail] = now; if (++tail == shaping_echoes) tail = 0; } + + #define SHAPING_QUEUE_DEQUEUE(AXIS) \ + bool forward = echo_axes[head_##AXIS].AXIS == ECHO_FWD; \ + do { \ + _free_count_##AXIS++; \ + if (++head_##AXIS == shaping_echoes) head_##AXIS = 0; \ + } while (head_##AXIS != tail && echo_axes[head_##AXIS].AXIS == ECHO_NONE); \ + _peek_##AXIS = head_##AXIS == tail ? shaping_time_t(-1) : times[head_##AXIS] + delay_##AXIS - now; \ + return forward; + #if ENABLED(INPUT_SHAPING_X) - static shaping_time_t peek_x() { return peek_x_val; } - static bool dequeue_x() { - bool forward = echo_axes[head_x].x == ECHO_FWD; - do { - _free_count_x++; - if (++head_x == shaping_echoes) head_x = 0; - } while (head_x != tail && echo_axes[head_x].x == ECHO_NONE); - peek_x_val = head_x == tail ? shaping_time_t(-1) : times[head_x] + delay_x - now; - return forward; - } + static shaping_time_t peek_x() { return _peek_x; } + static bool dequeue_x() { SHAPING_QUEUE_DEQUEUE(x) } static bool empty_x() { return head_x == tail; } static uint16_t free_count_x() { return _free_count_x; } #endif #if ENABLED(INPUT_SHAPING_Y) - static shaping_time_t peek_y() { return peek_y_val; } - static bool dequeue_y() { - bool forward = echo_axes[head_y].y == ECHO_FWD; - do { - _free_count_y++; - if (++head_y == shaping_echoes) head_y = 0; - } while (head_y != tail && echo_axes[head_y].y == ECHO_NONE); - peek_y_val = head_y == tail ? shaping_time_t(-1) : times[head_y] + delay_y - now; - return forward; - } + static shaping_time_t peek_y() { return _peek_y; } + static bool dequeue_y() { SHAPING_QUEUE_DEQUEUE(y) } static bool empty_y() { return head_y == tail; } static uint16_t free_count_y() { return _free_count_y; } #endif + #if ENABLED(INPUT_SHAPING_Z) + static shaping_time_t peek_z() { return _peek_z; } + static bool dequeue_z() { SHAPING_QUEUE_DEQUEUE(z) } + static bool empty_z() { return head_z == tail; } + static uint16_t free_count_z() { return _free_count_z; } + #endif static void purge() { const auto st = shaping_time_t(-1); #if ENABLED(INPUT_SHAPING_X) - head_x = tail; _free_count_x = shaping_echoes - 1; peek_x_val = st; + head_x = tail; _free_count_x = shaping_echoes - 1; _peek_x = st; #endif #if ENABLED(INPUT_SHAPING_Y) - head_y = tail; _free_count_y = shaping_echoes - 1; peek_y_val = st; + head_y = tail; _free_count_y = shaping_echoes - 1; _peek_y = st; + #endif + #if ENABLED(INPUT_SHAPING_Z) + head_z = tail; _free_count_z = shaping_echoes - 1; _peek_z = st; #endif } }; @@ -336,6 +331,12 @@ class Stepper { static ne_coeff_t ne; #endif + #if ENABLED(ADAPTIVE_STEP_SMOOTHING_TOGGLE) + static bool adaptive_step_smoothing_enabled; + #else + static constexpr bool adaptive_step_smoothing_enabled = true; + #endif + private: static block_t* current_block; // A pointer to the block currently being traced @@ -377,7 +378,7 @@ class Stepper { #if ENABLED(ADAPTIVE_STEP_SMOOTHING) static uint8_t oversampling_factor; // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis #else - static constexpr uint8_t oversampling_factor = 0; + static constexpr uint8_t oversampling_factor = 0; // Without smoothing apply no shift #endif // Delta error variables for the Bresenham line tracer @@ -385,8 +386,8 @@ class Stepper { static xyze_long_t advance_dividend; static uint32_t advance_divisor, step_events_completed, // The number of step events executed in the current block - accelerate_until, // The point from where we need to stop acceleration - decelerate_after, // The point from where we need to start decelerating + accelerate_before, // The count at which to start cruising + decelerate_start, // The count at which to start decelerating step_event_count; // The total event count for the current block #if ANY(HAS_MULTI_EXTRUDER, MIXING_EXTRUDER) @@ -414,6 +415,9 @@ class Stepper { #if ENABLED(INPUT_SHAPING_Y) static ShapeParams shaping_y; #endif + #if ENABLED(INPUT_SHAPING_Z) + static ShapeParams shaping_z; + #endif #endif #if ENABLED(LIN_ADVANCE) @@ -511,7 +515,7 @@ class Stepper { const bool was_on = hal.isr_state(); hal.isr_off(); - const bool result = TERN0(INPUT_SHAPING_X, !ShapingQueue::empty_x()) || TERN0(INPUT_SHAPING_Y, !ShapingQueue::empty_y()); + const bool result = TERN0(INPUT_SHAPING_X, !ShapingQueue::empty_x()) || TERN0(INPUT_SHAPING_Y, !ShapingQueue::empty_y()) || TERN0(INPUT_SHAPING_Z, !ShapingQueue::empty_z()); if (was_on) hal.isr_on(); @@ -678,6 +682,9 @@ class Stepper { // Calculate timing interval and steps-per-ISR for the given step rate static hal_timer_t calc_multistep_timer_interval(uint32_t step_rate); + // Evaluate axis motions and set bits in axis_did_move + static void set_axis_moved_for_current_block(); + #if ENABLED(NONLINEAR_EXTRUSION) static void calc_nonlinear_e(uint32_t step_rate); #endif diff --git a/Marlin/src/module/stepper/TMC26X.cpp b/Marlin/src/module/stepper/TMC26X.cpp deleted file mode 100644 index f46163ea2d..0000000000 --- a/Marlin/src/module/stepper/TMC26X.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * stepper/TMC26X.cpp - * Stepper driver indirection for TMC26X drivers - */ - -#include "../../inc/MarlinConfig.h" - -// -// TMC26X Driver objects and inits -// -#if HAS_TMC26X - -#include "TMC26X.h" - -#define _TMC26X_DEFINE(ST) TMC26XStepper stepper##ST(200, ST##_CS_PIN, ST##_STEP_PIN, ST##_DIR_PIN, ST##_CURRENT, int(ST##_RSENSE * 1000)) - -#if AXIS_DRIVER_TYPE_X(TMC26X) - _TMC26X_DEFINE(X); -#endif -#if AXIS_DRIVER_TYPE_X2(TMC26X) - _TMC26X_DEFINE(X2); -#endif -#if AXIS_DRIVER_TYPE_Y(TMC26X) - _TMC26X_DEFINE(Y); -#endif -#if AXIS_DRIVER_TYPE_Y2(TMC26X) - _TMC26X_DEFINE(Y2); -#endif -#if AXIS_DRIVER_TYPE_Z(TMC26X) - _TMC26X_DEFINE(Z); -#endif -#if AXIS_DRIVER_TYPE_Z2(TMC26X) - _TMC26X_DEFINE(Z2); -#endif -#if AXIS_DRIVER_TYPE_Z3(TMC26X) - _TMC26X_DEFINE(Z3); -#endif -#if AXIS_DRIVER_TYPE_Z4(TMC26X) - _TMC26X_DEFINE(Z4); -#endif -#if AXIS_DRIVER_TYPE_I(TMC26X) - _TMC26X_DEFINE(I); -#endif -#if AXIS_DRIVER_TYPE_J(TMC26X) - _TMC26X_DEFINE(J); -#endif -#if AXIS_DRIVER_TYPE_K(TMC26X) - _TMC26X_DEFINE(K); -#endif -#if AXIS_DRIVER_TYPE_U(TMC26X) - _TMC26X_DEFINE(U); -#endif -#if AXIS_DRIVER_TYPE_V(TMC26X) - _TMC26X_DEFINE(V); -#endif -#if AXIS_DRIVER_TYPE_W(TMC26X) - _TMC26X_DEFINE(W); -#endif -#if AXIS_DRIVER_TYPE_E0(TMC26X) - _TMC26X_DEFINE(E0); -#endif -#if AXIS_DRIVER_TYPE_E1(TMC26X) - _TMC26X_DEFINE(E1); -#endif -#if AXIS_DRIVER_TYPE_E2(TMC26X) - _TMC26X_DEFINE(E2); -#endif -#if AXIS_DRIVER_TYPE_E3(TMC26X) - _TMC26X_DEFINE(E3); -#endif -#if AXIS_DRIVER_TYPE_E4(TMC26X) - _TMC26X_DEFINE(E4); -#endif -#if AXIS_DRIVER_TYPE_E5(TMC26X) - _TMC26X_DEFINE(E5); -#endif -#if AXIS_DRIVER_TYPE_E6(TMC26X) - _TMC26X_DEFINE(E6); -#endif -#if AXIS_DRIVER_TYPE_E7(TMC26X) - _TMC26X_DEFINE(E7); -#endif - -#define _TMC26X_INIT(A) do{ \ - stepper##A.setMicrosteps(A##_MICROSTEPS); \ - stepper##A.start(); \ -}while(0) - -void tmc26x_init_to_defaults() { - #if AXIS_DRIVER_TYPE_X(TMC26X) - _TMC26X_INIT(X); - #endif - #if AXIS_DRIVER_TYPE_X2(TMC26X) - _TMC26X_INIT(X2); - #endif - #if AXIS_DRIVER_TYPE_Y(TMC26X) - _TMC26X_INIT(Y); - #endif - #if AXIS_DRIVER_TYPE_Y2(TMC26X) - _TMC26X_INIT(Y2); - #endif - #if AXIS_DRIVER_TYPE_Z(TMC26X) - _TMC26X_INIT(Z); - #endif - #if AXIS_DRIVER_TYPE_Z2(TMC26X) - _TMC26X_INIT(Z2); - #endif - #if AXIS_DRIVER_TYPE_Z3(TMC26X) - _TMC26X_INIT(Z3); - #endif - #if AXIS_DRIVER_TYPE_Z4(TMC26X) - _TMC26X_INIT(Z4); - #endif - #if AXIS_DRIVER_TYPE_I(TMC26X) - _TMC26X_INIT(I); - #endif - #if AXIS_DRIVER_TYPE_J(TMC26X) - _TMC26X_INIT(J); - #endif - #if AXIS_DRIVER_TYPE_K(TMC26X) - _TMC26X_INIT(K); - #endif - #if AXIS_DRIVER_TYPE_U(TMC26X) - _TMC26X_INIT(U); - #endif - #if AXIS_DRIVER_TYPE_V(TMC26X) - _TMC26X_INIT(V); - #endif - #if AXIS_DRIVER_TYPE_W(TMC26X) - _TMC26X_INIT(W); - #endif - #if AXIS_DRIVER_TYPE_E0(TMC26X) - _TMC26X_INIT(E0); - #endif - #if AXIS_DRIVER_TYPE_E1(TMC26X) - _TMC26X_INIT(E1); - #endif - #if AXIS_DRIVER_TYPE_E2(TMC26X) - _TMC26X_INIT(E2); - #endif - #if AXIS_DRIVER_TYPE_E3(TMC26X) - _TMC26X_INIT(E3); - #endif - #if AXIS_DRIVER_TYPE_E4(TMC26X) - _TMC26X_INIT(E4); - #endif - #if AXIS_DRIVER_TYPE_E5(TMC26X) - _TMC26X_INIT(E5); - #endif - #if AXIS_DRIVER_TYPE_E6(TMC26X) - _TMC26X_INIT(E6); - #endif - #if AXIS_DRIVER_TYPE_E7(TMC26X) - _TMC26X_INIT(E7); - #endif -} - -#endif // HAS_TMC26X diff --git a/Marlin/src/module/stepper/TMC26X.h b/Marlin/src/module/stepper/TMC26X.h deleted file mode 100644 index 1fd94b26a8..0000000000 --- a/Marlin/src/module/stepper/TMC26X.h +++ /dev/null @@ -1,212 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -/** - * stepper/TMC26X.h - * Stepper driver indirection for TMC26X drivers - */ - -#include "../../inc/MarlinConfig.h" - -// TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI - -#include -#include - -void tmc26x_init_to_defaults(); - -// X Stepper -#if AXIS_DRIVER_TYPE_X(TMC26X) - extern TMC26XStepper stepperX; - #define X_ENABLE_INIT() NOOP - #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE) - #define X_ENABLE_READ() stepperX.isEnabled() -#endif - -// Y Stepper -#if AXIS_DRIVER_TYPE_Y(TMC26X) - extern TMC26XStepper stepperY; - #define Y_ENABLE_INIT() NOOP - #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE) - #define Y_ENABLE_READ() stepperY.isEnabled() -#endif - -// Z Stepper -#if AXIS_DRIVER_TYPE_Z(TMC26X) - extern TMC26XStepper stepperZ; - #define Z_ENABLE_INIT() NOOP - #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE) - #define Z_ENABLE_READ() stepperZ.isEnabled() -#endif - -// X2 Stepper -#if HAS_X2_ENABLE && AXIS_DRIVER_TYPE_X2(TMC26X) - extern TMC26XStepper stepperX2; - #define X2_ENABLE_INIT() NOOP - #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE) - #define X2_ENABLE_READ() stepperX2.isEnabled() -#endif - -// Y2 Stepper -#if HAS_Y2_ENABLE && AXIS_DRIVER_TYPE_Y2(TMC26X) - extern TMC26XStepper stepperY2; - #define Y2_ENABLE_INIT() NOOP - #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE) - #define Y2_ENABLE_READ() stepperY2.isEnabled() -#endif - -// Z2 Stepper -#if HAS_Z2_ENABLE && AXIS_DRIVER_TYPE_Z2(TMC26X) - extern TMC26XStepper stepperZ2; - #define Z2_ENABLE_INIT() NOOP - #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE) - #define Z2_ENABLE_READ() stepperZ2.isEnabled() -#endif - -// Z3 Stepper -#if HAS_Z3_ENABLE && AXIS_DRIVER_TYPE_Z3(TMC26X) - extern TMC26XStepper stepperZ3; - #define Z3_ENABLE_INIT() NOOP - #define Z3_ENABLE_WRITE(STATE) stepperZ3.setEnabled(STATE) - #define Z3_ENABLE_READ() stepperZ3.isEnabled() -#endif - -// Z4 Stepper -#if HAS_Z4_ENABLE && AXIS_DRIVER_TYPE_Z4(TMC26X) - extern TMC26XStepper stepperZ4; - #define Z4_ENABLE_INIT() NOOP - #define Z4_ENABLE_WRITE(STATE) stepperZ4.setEnabled(STATE) - #define Z4_ENABLE_READ() stepperZ4.isEnabled() -#endif - -// I Stepper -#if HAS_I_ENABLE && AXIS_DRIVER_TYPE_I(TMC26X) - extern TMC26XStepper stepperI; - #define I_ENABLE_INIT() NOOP - #define I_ENABLE_WRITE(STATE) stepperI.setEnabled(STATE) - #define I_ENABLE_READ() stepperI.isEnabled() -#endif - -// J Stepper -#if HAS_J_ENABLE && AXIS_DRIVER_TYPE_J(TMC26X) - extern TMC26XStepper stepperJ; - #define J_ENABLE_INIT() NOOP - #define J_ENABLE_WRITE(STATE) stepperJ.setEnabled(STATE) - #define J_ENABLE_READ() stepperJ.isEnabled() -#endif - -// K Stepper -#if HAS_K_ENABLE && AXIS_DRIVER_TYPE_K(TMC26X) - extern TMC26XStepper stepperK; - #define K_ENABLE_INIT() NOOP - #define K_ENABLE_WRITE(STATE) stepperK.setEnabled(STATE) - #define K_ENABLE_READ() stepperK.isEnabled() -#endif - -// U Stepper -#if HAS_U_ENABLE && AXIS_DRIVER_TYPE_U(TMC26X) - extern TMC26XStepper stepperU; - #define U_ENABLE_INIT() NOOP - #define U_ENABLE_WRITE(STATE) stepperU.setEnabled(STATE) - #define U_ENABLE_READ() stepperU.isEnabled() -#endif - -// V Stepper -#if HAS_V_ENABLE && AXIS_DRIVER_TYPE_V(TMC26X) - extern TMC26XStepper stepperV; - #define V_ENABLE_INIT() NOOP - #define V_ENABLE_WRITE(STATE) stepperV.setEnabled(STATE) - #define V_ENABLE_READ() stepperV.isEnabled() -#endif - -// W Stepper -#if HAS_W_ENABLE && AXIS_DRIVER_TYPE_W(TMC26X) - extern TMC26XStepper stepperW; - #define W_ENABLE_INIT() NOOP - #define W_ENABLE_WRITE(STATE) stepperW.setEnabled(STATE) - #define W_ENABLE_READ() stepperW.isEnabled() -#endif - -// E0 Stepper -#if AXIS_DRIVER_TYPE_E0(TMC26X) - extern TMC26XStepper stepperE0; - #define E0_ENABLE_INIT() NOOP - #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE) - #define E0_ENABLE_READ() stepperE0.isEnabled() -#endif - -// E1 Stepper -#if AXIS_DRIVER_TYPE_E1(TMC26X) - extern TMC26XStepper stepperE1; - #define E1_ENABLE_INIT() NOOP - #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE) - #define E1_ENABLE_READ() stepperE1.isEnabled() -#endif - -// E2 Stepper -#if AXIS_DRIVER_TYPE_E2(TMC26X) - extern TMC26XStepper stepperE2; - #define E2_ENABLE_INIT() NOOP - #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE) - #define E2_ENABLE_READ() stepperE2.isEnabled() -#endif - -// E3 Stepper -#if AXIS_DRIVER_TYPE_E3(TMC26X) - extern TMC26XStepper stepperE3; - #define E3_ENABLE_INIT() NOOP - #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE) - #define E3_ENABLE_READ() stepperE3.isEnabled() -#endif - -// E4 Stepper -#if AXIS_DRIVER_TYPE_E4(TMC26X) - extern TMC26XStepper stepperE4; - #define E4_ENABLE_INIT() NOOP - #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE) - #define E4_ENABLE_READ() stepperE4.isEnabled() -#endif - -// E5 Stepper -#if AXIS_DRIVER_TYPE_E5(TMC26X) - extern TMC26XStepper stepperE5; - #define E5_ENABLE_INIT() NOOP - #define E5_ENABLE_WRITE(STATE) stepperE5.setEnabled(STATE) - #define E5_ENABLE_READ() stepperE5.isEnabled() -#endif - -// E6 Stepper -#if AXIS_DRIVER_TYPE_E6(TMC26X) - extern TMC26XStepper stepperE6; - #define E6_ENABLE_INIT() NOOP - #define E6_ENABLE_WRITE(STATE) stepperE6.setEnabled(STATE) - #define E6_ENABLE_READ() stepperE6.isEnabled() -#endif - -// E7 Stepper -#if AXIS_DRIVER_TYPE_E7(TMC26X) - extern TMC26XStepper stepperE7; - #define E7_ENABLE_INIT() NOOP - #define E7_ENABLE_WRITE(STATE) stepperE7.setEnabled(STATE) - #define E7_ENABLE_READ() stepperE7.isEnabled() -#endif diff --git a/Marlin/src/module/stepper/cycles.h b/Marlin/src/module/stepper/cycles.h index dae9e7c62c..0089124eed 100644 --- a/Marlin/src/module/stepper/cycles.h +++ b/Marlin/src/module/stepper/cycles.h @@ -188,7 +188,7 @@ #define ISR_LOOP_CYCLES(R) ((ISR_LOOP_BASE_CYCLES + MIN_ISR_LOOP_CYCLES + MIN_STEPPER_PULSE_CYCLES) * ((1UL << R) - 1) + _MAX(MIN_ISR_LOOP_CYCLES, MIN_STEPPER_PULSE_CYCLES)) // Model input shaping as an extra loop call -#define ISR_SHAPING_LOOP_CYCLES(R) (TERN0(HAS_ZV_SHAPING, (ISR_LOOP_BASE_CYCLES + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES)) << R)) +#define ISR_SHAPING_LOOP_CYCLES(R) (TERN0(HAS_ZV_SHAPING, (ISR_LOOP_BASE_CYCLES + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Z, ISR_Z_STEPPER_CYCLES)) << R)) // If linear advance is enabled, then it is handled separately #if ENABLED(LIN_ADVANCE) diff --git a/Marlin/src/module/stepper/indirection.cpp b/Marlin/src/module/stepper/indirection.cpp index 0290d8135d..fec77c1237 100644 --- a/Marlin/src/module/stepper/indirection.cpp +++ b/Marlin/src/module/stepper/indirection.cpp @@ -37,7 +37,6 @@ void restore_stepper_drivers() { } void reset_stepper_drivers() { - TERN_(HAS_TMC26X, tmc26x_init_to_defaults()); TERN_(HAS_TRINAMIC_CONFIG, reset_trinamic_drivers()); } diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index e82ab66e00..1ffeb8b907 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -69,10 +69,6 @@ */ #include "../../inc/MarlinConfig.h" -#if HAS_TMC26X - #include "TMC26X.h" -#endif - #if HAS_TRINAMIC_CONFIG #include "trinamic.h" #endif diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h index a9832945a5..3ae784be97 100644 --- a/Marlin/src/module/stepper/trinamic.h +++ b/Marlin/src/module/stepper/trinamic.h @@ -248,7 +248,7 @@ void reset_trinamic_drivers(); static constexpr chopper_timing_t chopper_timing_I = CHOPPER_TIMING_I; #if ENABLED(SOFTWARE_DRIVER_ENABLE) #define I_ENABLE_INIT() NOOP - #define I_ENABLE_WRITE(STATE) stepperI.toff((STATE)==I_ENABLE_ON ? chopper_timing.toff : 0) + #define I_ENABLE_WRITE(STATE) stepperI.toff((STATE)==I_ENABLE_ON ? chopper_timing_I.toff : 0) #define I_ENABLE_READ() stepperI.isEnabled() #endif #if AXIS_HAS_DEDGE(I) @@ -262,7 +262,7 @@ void reset_trinamic_drivers(); static constexpr chopper_timing_t chopper_timing_J = CHOPPER_TIMING_J; #if ENABLED(SOFTWARE_DRIVER_ENABLE) #define J_ENABLE_INIT() NOOP - #define J_ENABLE_WRITE(STATE) stepperJ.toff((STATE)==J_ENABLE_ON ? chopper_timing.toff : 0) + #define J_ENABLE_WRITE(STATE) stepperJ.toff((STATE)==J_ENABLE_ON ? chopper_timing_J.toff : 0) #define J_ENABLE_READ() stepperJ.isEnabled() #endif #if AXIS_HAS_DEDGE(J) @@ -276,7 +276,7 @@ void reset_trinamic_drivers(); static constexpr chopper_timing_t chopper_timing_K = CHOPPER_TIMING_K; #if ENABLED(SOFTWARE_DRIVER_ENABLE) #define K_ENABLE_INIT() NOOP - #define K_ENABLE_WRITE(STATE) stepperK.toff((STATE)==K_ENABLE_ON ? chopper_timing.toff : 0) + #define K_ENABLE_WRITE(STATE) stepperK.toff((STATE)==K_ENABLE_ON ? chopper_timing_K.toff : 0) #define K_ENABLE_READ() stepperK.isEnabled() #endif #if AXIS_HAS_DEDGE(K) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index ad1daae762..16b43f62f0 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -52,8 +52,6 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../lcd/e3v2/proui/dwin.h" #endif #if ENABLED(EXTENSIBLE_UI) @@ -723,13 +721,11 @@ volatile bool Temperature::raw_temps_ready = false; TERN_(HAS_FAN_LOGIC, fan_update_ms = next_temp_ms + fan_update_interval_ms); - TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_STARTED)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(isbed ? PIDTEMPBED_START : PIDTEMP_START)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ischamber ? ExtUI::pidresult_t::PID_CHAMBER_STARTED : isbed ? ExtUI::pidresult_t::PID_BED_STARTED : ExtUI::pidresult_t::PID_STARTED)); if (target > GHV(CHAMBER_MAX_TARGET, BED_MAX_TARGET, hotend_max_target(heater_id))) { SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); - TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_TEMP_TOO_HIGH)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_TEMP_TOO_HIGH)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); return; } @@ -810,7 +806,7 @@ volatile bool Temperature::raw_temps_ready = false; } } SHV((bias + d) >> 1); - TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PID_CYCLE), cycles, ncycles)); + TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT_F(MSG_PID_CYCLE), cycles, ncycles)); cycles++; minT = target; } @@ -822,8 +818,7 @@ volatile bool Temperature::raw_temps_ready = false; #endif if (current_temp > target + MAX_OVERSHOOT_PID_AUTOTUNE) { SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH); - TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_TEMP_TOO_HIGH)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_TEMP_TOO_HIGH)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH))); break; } @@ -854,14 +849,13 @@ volatile bool Temperature::raw_temps_ready = false; #endif } // every 2 seconds - // Timeout after MAX_CYCLE_TIME_PID_AUTOTUNE minutes since the last undershoot/overshoot cycle - #ifndef MAX_CYCLE_TIME_PID_AUTOTUNE - #define MAX_CYCLE_TIME_PID_AUTOTUNE 20L + // Timeout after PID_AUTOTUNE_MAX_CYCLE_MINS minutes since the last undershoot/overshoot cycle + #ifndef PID_AUTOTUNE_MAX_CYCLE_MINS + #define PID_AUTOTUNE_MAX_CYCLE_MINS 20L #endif - if ((ms - _MIN(t1, t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { + if ((ms - _MIN(t1, t2)) > MIN_TO_MS(PID_AUTOTUNE_MAX_CYCLE_MINS)) { TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(PID_TUNING_TIMEOUT)); - TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_TUNING_TIMEOUT)); TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TIMEOUT))); SERIAL_ECHOPGM(STR_PID_AUTOTUNE); SERIAL_ECHOLNPGM(STR_PID_TIMEOUT); break; @@ -910,11 +904,6 @@ volatile bool Temperature::raw_temps_ready = false; if (set_result) GHV(_set_chamber_pid(tune_pid), _set_bed_pid(tune_pid), _set_hotend_pid(heater_id, tune_pid)); - TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(oldcolor)); - - TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(AUTOTUNE_DONE)); - goto EXIT_M303; } } @@ -922,12 +911,9 @@ volatile bool Temperature::raw_temps_ready = false; disable_all_heaters(); - TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPidTuningDone(oldcolor)); - - TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_DONE)); - TERN_(PROUI_PID_TUNE, dwinPidTuning(AUTOTUNE_DONE)); - EXIT_M303: + TERN_(PRINTER_EVENT_LEDS, printerEventLEDs.onPIDTuningDone(oldcolor)); + TERN_(EXTENSIBLE_UI, ExtUI::onPIDTuning(ExtUI::pidresult_t::PID_DONE)); TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = true); return; } @@ -1144,7 +1130,7 @@ volatile bool Temperature::raw_temps_ready = false; // Ensure we don't drift too far from the window between the last sampled temp and the target temperature if (!WITHIN(current_temp, get_sample_3_temp() - 15.0f, hotend.target + 15.0f)) { SERIAL_ECHOLNPGM(STR_MPC_TEMPERATURE_ERROR); - TERN_(DWIN_LCD_PROUI, dwinMPCTuning(MPC_TEMP_ERROR)); + TERN_(EXTENSIBLE_UI, ExtUI::onMPCTuning(ExtUI::mpcresult_t::MPC_TEMP_ERROR)); wait_for_heatup = false; return FAILED; } @@ -1182,7 +1168,7 @@ volatile bool Temperature::raw_temps_ready = false; if (!wait_for_heatup) { SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_INTERRUPTED); - TERN_(DWIN_LCD_PROUI, dwinMPCTuning(MPC_INTERRUPTED)); + TERN_(EXTENSIBLE_UI, ExtUI::onMPCTuning(ExtUI::mpcresult_t::MPC_INTERRUPTED)); return MeasurementState::CANCELLED; } @@ -1209,12 +1195,8 @@ volatile bool Temperature::raw_temps_ready = false; // Determine ambient temperature. SERIAL_ECHOLNPGM(STR_MPC_COOLING_TO_AMBIENT); - #if ENABLED(DWIN_LCD_PROUI) - dwinMPCTuning(MPCTEMP_START); - LCD_ALERTMESSAGE(MSG_MPC_COOLING_TO_AMBIENT); - #else - LCD_MESSAGE(MSG_COOLING); - #endif + TERN_(EXTENSIBLE_UI, ExtUI::onMPCTuning(ExtUI::mpcresult_t::MPC_STARTED)); + TERN(DWIN_LCD_PROUI, LCD_ALERTMESSAGE(MSG_MPC_COOLING_TO_AMBIENT), LCD_MESSAGE(MSG_COOLING)); if (tuner.measure_ambient_temp() != MPC_autotuner::MeasurementState::SUCCESS) return; hotend.modeled_ambient_temp = tuner.get_ambient_temp(); @@ -1300,7 +1282,7 @@ volatile bool Temperature::raw_temps_ready = false; } SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_FINISHED); - TERN_(DWIN_LCD_PROUI, dwinMPCTuning(AUTOTUNE_DONE)); + TERN_(EXTENSIBLE_UI, ExtUI::onMPCTuning(ExtUI::mpcresult_t::MPC_DONE)); SERIAL_ECHOLNPGM("MPC_BLOCK_HEAT_CAPACITY ", mpc.block_heat_capacity); SERIAL_ECHOLNPGM("MPC_SENSOR_RESPONSIVENESS ", p_float_t(mpc.sensor_responsiveness, 4)); @@ -1321,8 +1303,10 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) { #if HAS_COOLER case H_COOLER: return temp_cooler.soft_pwm_amount; #endif - default: - return TERN0(HAS_HOTEND, temp_hotend[heater_id].soft_pwm_amount); + #if HAS_HOTEND + case 0 ... HOTENDS - 1: return temp_hotend[heater_id].soft_pwm_amount; + #endif + default: return 0; } } @@ -1539,15 +1523,17 @@ void Temperature::_temp_error( } void Temperature::maxtemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_TEMP, const celsius_float_t deg)) { - #if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED) - dwinPopupTemperature(1); + #if HAS_HOTEND || HAS_HEATED_BED + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(1)); + TERN_(EXTENSIBLE_UI, ExtUI::onMaxTempError(heater_id)); #endif _TEMP_ERROR(heater_id, F(STR_T_MAXTEMP), MSG_ERR_MAXTEMP, deg); } void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_TEMP, const celsius_float_t deg)) { - #if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED) - dwinPopupTemperature(0); + #if HAS_HOTEND || HAS_HEATED_BED + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); + TERN_(EXTENSIBLE_UI, ExtUI::onMinTempError(heater_id)); #endif _TEMP_ERROR(heater_id, F(STR_T_MINTEMP), MSG_ERR_MINTEMP, deg); } @@ -1772,7 +1758,8 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T if (watch_hotend[e].check(temp)) // Increased enough? start_watching_hotend(e); // If temp reached, turn off elapsed check else { - TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); + TERN_(EXTENSIBLE_UI, ExtUI::onHeatingError(e)); _TEMP_ERROR(e, FPSTR(str_t_heating_failed), MSG_ERR_HEATING_FAILED, temp); } } @@ -1802,7 +1789,8 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T if (watch_bed.check(deg)) // Increased enough? start_watching_bed(); // If temp reached, turn off elapsed check else { - TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); + TERN_(EXTENSIBLE_UI, ExtUI::onHeatingError(H_BED)); _TEMP_ERROR(H_BED, FPSTR(str_t_heating_failed), MSG_ERR_HEATING_FAILED, deg); } } @@ -2033,7 +2021,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T if (watch_cooler.elapsed(ms)) { // Time to check the cooler? const auto deg = degCooler(); if (deg > watch_cooler.target) // Failed to decrease enough? - _TEMP_ERROR(H_COOLER, GET_EN_TEXT_F(MSG_ERR_COOLING_FAILED), MSG_ERR_COOLING_FAILED, deg); + _TEMP_ERROR(H_COOLER, GET_TEXT_F(MSG_ERR_COOLING_FAILED), MSG_ERR_COOLING_FAILED, deg); else start_watching_cooler(); // Start again if the target is still far off } @@ -2278,6 +2266,8 @@ void Temperature::task() { } void Temperature::M305_report(const uint8_t t_index, const bool forReplay/*=true*/) { + TERN_(MARLIN_SMALL_BUILD, return); + gcode.report_heading_etc(forReplay, F(STR_USER_THERMISTORS)); SERIAL_ECHOPGM(" M305 P", AS_DIGIT(t_index)); @@ -3252,13 +3242,15 @@ void Temperature::init() { } // fall through case TRRunaway: - TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); + TERN_(EXTENSIBLE_UI, ExtUI::onHeatingError(heater_id)); _TEMP_ERROR(heater_id, FPSTR(str_t_thermal_runaway), MSG_ERR_THERMAL_RUNAWAY, current); break; #if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR) case TRMalfunction: - TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); + TERN_(DWIN_CREALITY_LCD, dwinPopupTemperature(0)); + TERN_(EXTENSIBLE_UI, ExtUI::onHeatingError(heater_id)); _TEMP_ERROR(heater_id, F(STR_T_THERMAL_MALFUNCTION), MSG_ERR_TEMP_MALFUNCTION, current); break; #endif @@ -4429,6 +4421,7 @@ void Temperature::isr() { #if ENABLED(AUTO_REPORT_TEMPERATURES) AutoReporter Temperature::auto_reporter; void Temperature::AutoReportTemp::report() { + if (wait_for_heatup) return; print_heater_states(active_extruder OPTARG(HAS_TEMP_REDUNDANT, ENABLED(AUTO_REPORT_REDUNDANT))); SERIAL_EOL(); } @@ -4443,7 +4436,7 @@ void Temperature::isr() { #else F("E1 " S_FMT) #endif - , heating ? GET_TEXT(MSG_HEATING) : GET_TEXT(MSG_COOLING) + , heating ? GET_TEXT_F(MSG_HEATING) : GET_TEXT_F(MSG_COOLING) ); if (isM104) { diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 088a17ec1b..15cfeac911 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -43,7 +43,7 @@ //#define ERR_INCLUDE_TEMP -#define HOTEND_INDEX TERN(HAS_MULTI_HOTEND, e, 0) +#define HOTEND_INDEX TERN0(HAS_MULTI_HOTEND, e) #define E_NAME TERN_(HAS_MULTI_HOTEND, e) #if HAS_FAN @@ -204,31 +204,35 @@ typedef struct { float p, i, d, c, f; } raw_pidcf_t; float get_pid_output(const float target, const float current) { const float pid_error = target - current; + float output_pow; if (!target || pid_error < -(PID_FUNCTIONAL_RANGE)) { pid_reset = true; - return 0; + output_pow = 0; } else if (pid_error > PID_FUNCTIONAL_RANGE) { pid_reset = true; - return MAX_POW; + output_pow = MAX_POW; } + else { + if (pid_reset) { + pid_reset = false; + temp_iState = 0.0; + work_d = 0.0; + } - if (pid_reset) { - pid_reset = false; - temp_iState = 0.0; - work_d = 0.0; + const float max_power_over_i_gain = float(MAX_POW) / Ki - float(MIN_POW); + temp_iState = constrain(temp_iState + pid_error, 0, max_power_over_i_gain); + + work_p = Kp * pid_error; + work_i = Ki * temp_iState; + work_d = work_d + PID_K2 * (Kd * (temp_dState - current) - work_d); + + output_pow = constrain(work_p + work_i + work_d + float(MIN_POW), 0, MAX_POW); } - const float max_power_over_i_gain = float(MAX_POW) / Ki - float(MIN_POW); - temp_iState = constrain(temp_iState + pid_error, 0, max_power_over_i_gain); - - work_p = Kp * pid_error; - work_i = Ki * temp_iState; - work_d = work_d + PID_K2 * (Kd * (temp_dState - current) - work_d); - temp_dState = current; - return constrain(work_p + work_i + work_d + float(MIN_POW), 0, MAX_POW); + return output_pow; } }; diff --git a/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h b/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h index 65f734c760..578ccfa849 100644 --- a/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h +++ b/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h @@ -112,8 +112,8 @@ // #define FAN_SOFT_PWM_REQUIRED // check if needed -// Neopixel Rings -#define NEOPIXEL_PIN 14 +// NeoPixel Rings +#define BOARD_NEOPIXEL_PIN 14 #define NEOPIXEL2_PIN 27 // SPI diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 69afcc1aeb..6a8187d792 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -35,7 +35,7 @@ #endif #define BOARD_INFO_NAME "MKS TinyBee" -#define BOARD_WEBSITE_URL "https://github.com/makerbase-mks" +#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-TinyBee" #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME // MAX_EXPANDER_BITS is defined for MKS TinyBee in HAL/ESP32/inc/Conditionals_adv.h @@ -43,15 +43,23 @@ // // Servos // -#define SERVO0_PIN 2 +#define SERVO0_PIN 2 // 3D TOUCH // // Limit Switches // -#define X_STOP_PIN 33 -#define Y_STOP_PIN 32 -#define Z_STOP_PIN 22 -//#define FIL_RUNOUT_PIN 35 +#define X_STOP_PIN 33 // X +#define Y_STOP_PIN 32 // Y +#define Z_STOP_PIN 22 // Z +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 35 // MT_DET +#endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN // 3D TOUCH +#endif // // Enable I2S stepper stream @@ -68,49 +76,44 @@ // // Steppers // -#define X_STEP_PIN 129 +#define X_STEP_PIN 129 // X #define X_DIR_PIN 130 #define X_ENABLE_PIN 128 -#define Y_STEP_PIN 132 +#define Y_STEP_PIN 132 // Y #define Y_DIR_PIN 133 #define Y_ENABLE_PIN 131 -#define Z_STEP_PIN 135 +#define Z_STEP_PIN 135 // Z1 #define Z_DIR_PIN 136 #define Z_ENABLE_PIN 134 -#define E0_STEP_PIN 138 +#define E0_STEP_PIN 138 // E0 #define E0_DIR_PIN 139 #define E0_ENABLE_PIN 137 -#define E1_STEP_PIN 141 +#define E1_STEP_PIN 141 // E1 #define E1_DIR_PIN 142 #define E1_ENABLE_PIN 140 -#define Z2_STEP_PIN 141 -#define Z2_DIR_PIN 142 -#define Z2_ENABLE_PIN 140 - // // Temperature Sensors // -#define TEMP_0_PIN 36 // Analog Input -#define TEMP_1_PIN 34 // Analog Input, you need set R6=0Ω and R7=NC -#define TEMP_BED_PIN 39 // Analog Input +#define TEMP_0_PIN 36 // TH1 / Analog Input +#define TEMP_1_PIN 34 // TH2 / Analog Input, you need set R6=0Ω and R7=NC +#define TEMP_BED_PIN 39 // TB / Analog Input // // Heaters / Fans // -#define HEATER_0_PIN 145 -#define HEATER_1_PIN 146 -#define FAN0_PIN 147 -#define FAN1_PIN 148 -#define HEATER_BED_PIN 144 +#define HEATER_0_PIN 145 // HE0 +#define HEATER_1_PIN 146 // HE1 +#define FAN0_PIN 147 // FAN1 +#define FAN1_PIN 148 // FAN2 +#define HEATER_BED_PIN 144 // H-BED -//#define CONTROLLER_FAN_PIN 148 -//#define E0_AUTO_FAN_PIN 148 // need to update Configuration_adv.h @section extruder -//#define E1_AUTO_FAN_PIN 149 // need to update Configuration_adv.h @section extruder +//#define CONTROLLER_FAN_PIN 148 // FAN2 +//#define E0_AUTO_FAN_PIN 148 // FAN2 // // ADC Reference Voltage @@ -121,7 +124,7 @@ * ------ ------ * (BEEPER) 149 | 1 2 | 13 (BTN_ENC) (SPI MISO) 19 | 1 2 | 18 (SPI SCK) * (LCD_EN) 21 | 3 4 | 4 (LCD_RS) (BTN_EN1) 14 | 3 4 | 5 (SPI CS) - * (LCD_D4) 0 5 6 | 16 (LCD_D5) (BTN_EN2) 12 5 6 | 23 (SPI MOSI) + * (LCD_D4) 0 | 5 6 16 (LCD_D5) (BTN_EN2) 12 | 5 6 23 (SPI MOSI) * (LCD_D6) 15 | 7 8 | 17 (LCD_D7) (SPI_DET) 34 | 7 8 | RESET * GND | 9 10 | 5V GND | 9 10 | 3.3V * ------ ------ @@ -152,6 +155,8 @@ //#define SD_MOSI_PIN EXP2_06_PIN // uses esp32 default 23 //#define SD_MISO_PIN EXP2_01_PIN // uses esp32 default 19 //#define SD_SCK_PIN EXP2_02_PIN // uses esp32 default 18 + +// TODO: Migrate external SD Card to pins/lcd #define SDSS EXP2_04_PIN #define SD_DETECT_PIN EXP2_07_PIN // IO34 default is SD_DET signal (Jump to SDDET) #define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers diff --git a/Marlin/src/pins/esp32/pins_MM_JOKER.h b/Marlin/src/pins/esp32/pins_MM_JOKER.h index b992fe89c3..b74321dbfc 100644 --- a/Marlin/src/pins/esp32/pins_MM_JOKER.h +++ b/Marlin/src/pins/esp32/pins_MM_JOKER.h @@ -219,6 +219,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD //#define LCD_PINS_RS 13 diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index 90ff78487f..bcdb8c4faa 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -121,9 +121,9 @@ #define SDSS 5 #define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers -////////////////////////// -// LCDs and Controllers // -////////////////////////// +// +// LCD / Controller +// #if HAS_WIRED_LCD diff --git a/Marlin/src/pins/esp32/pins_PANDA_common.h b/Marlin/src/pins/esp32/pins_PANDA_common.h index b24babd96b..2cc954940e 100644 --- a/Marlin/src/pins/esp32/pins_PANDA_common.h +++ b/Marlin/src/pins/esp32/pins_PANDA_common.h @@ -86,7 +86,7 @@ * (EN1) 33 | 3 4 | (5 SDSS?) (EN) 26 | 3 4 | 27 (RS) * (EN2) 32 5 6 | (23 MOSI?) (D4) 14 | 5 6 -- * (SDDET 2?) | 7 8 | (RESET) -- | 7 8 | -- - * -- | 9 10 | -- (GND) | 9 10 | (5V) + * -- | 9 10 | -- GND | 9 10 | 5V * ------ ------ * EXP2 EXP1 */ diff --git a/Marlin/src/pins/gd32f1/pins_SOVOL_V131.h b/Marlin/src/pins/gd32f1/pins_SOVOL_V131.h index e92c24b86c..2f6dd12c49 100644 --- a/Marlin/src/pins/gd32f1/pins_SOVOL_V131.h +++ b/Marlin/src/pins/gd32f1/pins_SOVOL_V131.h @@ -62,6 +62,24 @@ #define E0_SERIAL_TX_PIN PC14 #define E0_SERIAL_RX_PIN PC14 + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 3 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 3 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 3 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif + static_assert(X_SLAVE_ADDRESS == 3, "X_SLAVE_ADDRESS must be 3 for BOARD_SOVOL_V131."); + static_assert(Y_SLAVE_ADDRESS == 3, "Y_SLAVE_ADDRESS must be 3 for BOARD_SOVOL_V131."); + static_assert(Z_SLAVE_ADDRESS == 3, "Z_SLAVE_ADDRESS must be 3 for BOARD_SOVOL_V131."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_SOVOL_V131."); + // Reduce baud rate to improve software serial reliability #ifndef TMC_BAUD_RATE #define TMC_BAUD_RATE 19200 diff --git a/Marlin/src/pins/gd32f1/pins_VOXELAB_AQUILA.h b/Marlin/src/pins/gd32f1/pins_VOXELAB_AQUILA.h index 2f3998b45f..c0d9c87baa 100644 --- a/Marlin/src/pins/gd32f1/pins_VOXELAB_AQUILA.h +++ b/Marlin/src/pins/gd32f1/pins_VOXELAB_AQUILA.h @@ -32,8 +32,6 @@ #define DEFAULT_MACHINE_NAME "Aquila" #endif -#define INLINE_USART_IRQ - #define NO_MAPLE_WARNING // Disable warning when compiling with Maple env #include "../stm32f1/pins_CREALITY_V4.h" diff --git a/Marlin/src/pins/hc32f4/env_validate.h b/Marlin/src/pins/hc32f4/env_validate.h index 9bbc999fd6..b2db5e8b83 100644 --- a/Marlin/src/pins/hc32f4/env_validate.h +++ b/Marlin/src/pins/hc32f4/env_validate.h @@ -22,7 +22,7 @@ #ifndef ENV_VALIDATE_H #define ENV_VALIDATE_H -#ifndef ARDUINO_ARCH_HC32 +#if NOT_TARGET(ARDUINO_ARCH_HC32) #error "Oops! Select an HC32F460 board in 'Tools > Board.'" #endif diff --git a/Marlin/src/pins/hc32f4/pins_AQUILA_101.h b/Marlin/src/pins/hc32f4/pins_AQUILA_101.h index 2834d56c96..4716984933 100644 --- a/Marlin/src/pins/hc32f4/pins_AQUILA_101.h +++ b/Marlin/src/pins/hc32f4/pins_AQUILA_101.h @@ -45,10 +45,13 @@ #endif // -// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role +// Release JTAG pins but keep SWD enabled +// - PA15 (JTDI / USART2 RX) +// - PB3 (JTDO / E0_DIR) +// - PB4 (NJTRST / E0_STEP) // //#define DISABLE_DEBUG -//#define DISABLE_JTAG +#define DISABLE_JTAG // // EEPROM diff --git a/Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h b/Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h new file mode 100644 index 0000000000..1d142d87cc --- /dev/null +++ b/Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h @@ -0,0 +1,225 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +// +// Creality Ender 2 Pro v2.4.S4_170 (HC32f460kcta) +// Derived from https://github.com/Klipper3d/klipper/blob/master/config/printer-creality-ender2pro-hc32-2022.cfg +// +#include "env_validate.h" + +#if HAS_MULTI_HOTEND || E_STEPPERS > 1 + #error "Creality v2.4.S4 only supports one hotend and E-stepper" +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Creality v2.4.S4" +#endif +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME "Ender 2 Pro" +#endif + +// +// Onboard crystal oscillator +// +#ifndef BOARD_XTAL_FREQUENCY + #define BOARD_XTAL_FREQUENCY 8000000 // 8 MHz XTAL +#endif + +// +// Release JTAG pins but keep SWD enabled +// - PA15 (JTDI / E0_DIR_PIN) +// - PB3 (JTDO / E0_STEP_PIN) +// - PB4 (NJTRST / E0_ENABLE_PIN) +// +//#define DISABLE_DEBUG +#define DISABLE_JTAG + +// +// EEPROM +// +#if NO_EEPROM_SELECTED + #define IIC_BL24CXX_EEPROM + //#define SDCARD_EEPROM_EMULATION + #undef NO_EEPROM_SELECTED +#endif + +#if ENABLED(IIC_BL24CXX_EEPROM) + #define IIC_EEPROM_SDA PA12 + #define IIC_EEPROM_SCL PA11 + #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16) +#elif ENABLED(SDCARD_EEPROM_EMULATION) + #define MARLIN_EEPROM_SIZE 0x800 // 2K +#endif + +// +// Servos +// +#ifndef SERVO0_PIN + #define SERVO0_PIN PB0 // BLTouch OUT * +#endif + +// +// Limit Switches +// +#define X_STOP_PIN PA5 +#define Y_STOP_PIN PA6 +#define Z_STOP_PIN PB0 // BLTOUCH * + +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PB1 // BLTouch IN * +#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PC15 // "Pulled-high" * +#endif + +// +// Steppers +// +#define X_ENABLE_PIN PC2 +#define X_STEP_PIN PC1 +#define X_DIR_PIN PC0 + +#define Y_ENABLE_PIN PH2 +#define Y_STEP_PIN PB9 +#define Y_DIR_PIN PB8 + +#define Z_ENABLE_PIN PB7 +#define Z_STEP_PIN PB6 +#define Z_DIR_PIN PB5 + +#define E0_ENABLE_PIN PB4 +#define E0_STEP_PIN PB3 +#define E0_DIR_PIN PA15 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC5 // HEATER1 ADC1_IN15 +#define TEMP_BED_PIN PC4 // HOT BED ADC1_IN14 + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA1 // HEATER1 +#define HEATER_BED_PIN PB10 // HOT BED + +#define FAN0_PIN PA0 // FAN0 + +// +// SD Card +// +#define SD_DETECT_PIN PA10 +#define ONBOARD_SPI_DEVICE 1 +#define ONBOARD_SD_CS_PIN PC3 // SDSS +#define ONBOARD_SDIO +#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer + +#ifndef LCD_SERIAL_PORT + #define LCD_SERIAL_PORT 1 +#endif + +// +// SDIO Pins +// +#define BOARD_SDIO_D0 PC8 +#define BOARD_SDIO_D1 PC9 +#define BOARD_SDIO_D2 PC10 +#define BOARD_SDIO_D3 PC11 +#define BOARD_SDIO_CLK PC12 +#define BOARD_SDIO_CMD PD2 +#define BOARD_SDIO_DET PA10 + +// +// USART Pins +// + +// Display +#define BOARD_USART1_TX_PIN PA2 // LCD +#define BOARD_USART1_RX_PIN PA3 + +// Host +#define BOARD_USART2_TX_PIN PA8 // USB +#define BOARD_USART2_RX_PIN PA7 + +// Onboard LED (HIGH = off, LOW = on) +#ifndef LED_BUILTIN + #define LED_BUILTIN PC3 +#endif + +#define BOARD_NO_NATIVE_USB + +// +// SPI3 Pins (LCD) +// +#define SPI_NSS PB15 // SPI3_NSS +#define SPI_SCK PB14 // SPI3_CLK +#define SPI_MISO PB13 // SPI3_MISO +#define SPI_MOSI PB12 // SPI3_MOSI + +// +// LCD / Controller +// + +/** ------ + * PC6 | 1 2 | PC7 + * PA2 | 3 4 | PA3 + * PB13 5 6 | PB14 + * PB15 | 7 8 | PB12 + * GND | 9 10 | 5V + * ------ + * EXP1 + */ +#define EXP1_01_PIN PC6 +#define EXP1_02_PIN PC7 +#define EXP1_03_PIN PA2 +#define EXP1_04_PIN PA3 +#define EXP1_05_PIN PB13 +#define EXP1_06_PIN PB14 +#define EXP1_07_PIN PB15 +#define EXP1_08_PIN PB12 + +#if ENABLED(CR10_STOCKDISPLAY) // LCD used for C2 + /** ------ + * BEEPER | 1 2 | ENC + * EN1 | 3 4 | KILL + * EN2 5 6 | LCD_D4 + * LCD_RS | 7 8 | LCD_EN + * GND | 9 10 | 5V + * ------ + */ + #define BEEPER_PIN EXP1_01_PIN + + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_EN EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + + #define KILL_PIN EXP1_04_PIN +#endif diff --git a/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h index 569c9781d2..6d5a3c70b5 100644 --- a/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h +++ b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h @@ -23,7 +23,6 @@ /** * AZSMZ MINI pin assignments - * Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/AZSMZ%20MINI/AZSMZ.svg * Source: https://raw.githubusercontent.com/Rose-Fish/AZSMZ-mini/master/AZSMZ.sch */ diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h index 008fc3d4a0..be6da885df 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h @@ -23,8 +23,7 @@ /** * BigTreeTech SKR 1.1 pin assignments - * Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20V1.1/SKR-V1.1SchDoc.pdf - * Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.1/blob/master/hardware/SKR-V1.1SchDoc.pdf + * Schematic: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.1/blob/master/hardware/SKR-V1.1SchDoc.pdf */ #define BOARD_INFO_NAME "BTT SKR V1.1" 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 35d9697ba4..210df06d3c 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -23,8 +23,7 @@ /** * BigTreeTech SKR 1.3 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20V1.3/SKR-V1.3-SCH.pdf - * Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.3/hardware/SKR-V1.3-SCH.pdf + * Schematic: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.3/hardware/SKR-V1.3-SCH.pdf */ #define BOARD_INFO_NAME "BTT SKR V1.3" @@ -96,6 +95,13 @@ #define Z_MIN_PROBE_PIN P1_24 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -226,9 +232,7 @@ #elif ENABLED(ANET_FULL_GRAPHICS_LCD) - #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 + CONTROLLER_WARNING("BTT_SKR_V1_3", "ANET_FULL_GRAPHICS_LCD") /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. @@ -262,9 +266,7 @@ #elif ENABLED(WYH_L12864) - #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 + CONTROLLER_WARNING("BTT_SKR_V1_3", "WYH_L12864") /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. @@ -285,9 +287,10 @@ * ------ ------ * LCD LCD */ + #define BTN_ENC EXP1_03_PIN #define BTN_EN1 EXP1_05_PIN #define BTN_EN2 EXP1_07_PIN - #define BTN_ENC EXP1_03_PIN + #define DOGLCD_CS EXP1_08_PIN #define DOGLCD_A0 EXP1_06_PIN #define DOGLCD_SCK EXP1_04_PIN @@ -359,9 +362,7 @@ #elif ENABLED(MKS_TS35_V2_0) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! MKS_TS35_V2_0 requires wiring modifications. The SKR 1.3 EXP ports are rotated 180° from what the MKS_TS35_V2_0 expects. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this error.)" - #endif + CONTROLLER_WARNING("BTT_SKR_V1_3", "MKS_TS35_V2_0", " The SKR 1.3 EXP ports are rotated 180°.") /** ------ ------ * BEEPER | 1 2 | BTN_ENC SPI1_MISO | 1 2 | SPI1_SCK @@ -450,8 +451,6 @@ #define DOGLCD_SCK EXP2_02_PIN #define DOGLCD_MOSI EXP2_06_PIN - #define LCD_BACKLIGHT_PIN -1 - #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 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 829e0edd60..6345001b11 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -23,8 +23,7 @@ /** * BigTreeTech SKR 1.4 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20V1.4%20+%20Turbo/BTT%20SKR%20V1.4-SCH.pdf - * Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/Hardware/BTT%20SKR%20V1.4-SCH.pdf + * Schematic: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/Hardware/BTT%20SKR%20V1.4-SCH.pdf */ #include "env_validate.h" @@ -134,6 +133,13 @@ #define Z_MIN_PROBE_PIN P0_10 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -290,9 +296,7 @@ #elif HAS_WIRED_LCD #if ENABLED(CTC_A10S_A13) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! CTC_A10S_A13 requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_V1_4", "CTC_A10S_A13") /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. @@ -324,9 +328,7 @@ #define BEEPER_PIN EXP1_08_PIN #elif ENABLED(ANET_FULL_GRAPHICS_LCD) - #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 + CONTROLLER_WARNING("BTT_SKR_V1_4", "ANET_FULL_GRAPHICS_LCD") /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. @@ -444,9 +446,7 @@ #elif ENABLED(MKS_TS35_V2_0) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! MKS_TS35_V2_0 requires wiring modifications. The SKR 1.4 EXP ports are rotated 180° from what the MKS_TS35_V2_0 expects. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this error.)" - #endif + CONTROLLER_WARNING("BTT_SKR_V1_4", "MKS_TS35_V2_0", " The SKR 1.4 EXP ports are rotated 180°.") /** ------ ------ * BEEPER | 1 2 | BTN_ENC SPI1_MISO | 1 2 | SPI1_SCK @@ -591,8 +591,8 @@ // // NeoPixel LED // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN P1_24 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN P1_24 #endif /** diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index ee3934a4ef..e6a2abc0f0 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -111,8 +111,9 @@ // // LCD / Controller // + #if !defined(BEEPER_PIN) && HAS_WIRED_LCD && DISABLED(LCD_USE_I2C_BUZZER) - #define BEEPER_PIN P1_30 // (37) not 5V tolerant + #define BEEPER_PIN P1_30 // (EXP1-1) Not 5V-tolerant #endif // diff --git a/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h b/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h index 43a9b786eb..52bf4b0abb 100644 --- a/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h +++ b/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h @@ -23,8 +23,7 @@ /** * eMotion-Tech eMotronic pin assignments - * Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/eMotion-Tech%20eMotronic/eMotronic_brd_sources_1.0.4/eMotronic_sch.pdf - * Origin: https://data.emotion-tech.com/ftp/Datasheets_et_sources/Sources/eMotronic_brd_sources_1.0.4.zip + * Schematic: https://data.emotion-tech.com/ftp/Datasheets_et_sources/Sources/eMotronic_brd_sources_1.0.4.zip * * Board pins<->features assignments are based on the * Micro-Delta Rework printer default connections. @@ -138,6 +137,7 @@ // // LCD / Controller // + #if ENABLED(EMOTION_TECH_LCD) #define BEEPER_PIN EXP2_01_PIN #define DOGLCD_A0 EXP2_06_PIN diff --git a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h index 7aa4aa6423..f785d3b737 100644 --- a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h +++ b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h @@ -23,8 +23,7 @@ /** * GMARSH X6 Rev.1 pin assignments - * Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/GMARSH%20X6%20Rev.1/armprinter_2208_1heater.pdf - * Origin: https://github.com/gmarsh/gmarsh_x6/blob/master/armprinter_2208_1heater.pdf + * Schematic: https://github.com/gmarsh/gmarsh_x6/blob/master/armprinter_2208_1heater.pdf */ #include "env_validate.h" diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h index a4150aa22f..dbacb0fa26 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h @@ -23,8 +23,6 @@ /** * Makerbase MKS SBASE pin assignments - * Schematic (V1.3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS%20SBASE%20V1.3/MKS%20SBASE%20V1.3_002%20SCH.pdf - * Origin (V1.3): http://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS%20SBASE%20V1.3/MKS%20SBASE%20V1.3_002%20SCH.pdf */ #include "env_validate.h" @@ -63,6 +61,13 @@ #define Z_MIN_PROBE_PIN P4_28 // Connector J8 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // @@ -110,31 +115,25 @@ // Note: These pins are all digitally shared with the EXP1/EXP2 Connector. // Using them with an LCD connected or configured will lead to hangs & crashes. // - -// 5V -// NC -// GND -#define PIN_P0_17 P0_17 -#define PIN_P0_16 P0_16 -#define PIN_P0_15 P0_15 +//#define PIN_P0_17 P0_17 // 5V +//#define PIN_P0_16 P0_16 // NC +//#define PIN_P0_15 P0_15 // GND // // Connector J8 // - -// GND -#define PIN_P1_22 P1_22 -#define PIN_P1_23 P1_23 // PWM Capable -#define PIN_P2_12 P2_12 // Interrupt Capable -#define PIN_P2_11 P2_11 // Interrupt Capable +#define PIN_P1_22 P1_22 // GND +#define PIN_P1_23 P1_23 // PWM-capable +#define PIN_P2_12 P2_12 // Interrupt-capable +#define PIN_P2_11 P2_11 // Interrupt-capable // // Průša i3 MMU1 (Multi Material Multiplexer) Support // #if HAS_PRUSA_MMU1 - #define E_MUX0_PIN P1_23 // J8-3 - #define E_MUX1_PIN P2_12 // J8-4 - #define E_MUX2_PIN P2_11 // J8-5 + #define E_MUX0_PIN PIN_P1_23 // J8-3 + #define E_MUX1_PIN PIN_P2_12 // J8-4 + #define E_MUX2_PIN PIN_P2_11 // J8-5 #endif // @@ -170,21 +169,19 @@ #if SD_CONNECTION_IS(CUSTOM_CABLE) /** - * A custom cable is needed. See the README file in the - * Marlin\src\config\examples\Mks\Sbase directory - * P0.27 is on EXP2 and the on-board SD card's socket. That means it can't be - * used as the SD_DETECT for the LCD's SD card. + * A custom cable is needed. + * See https://github.com/MarlinFirmware/Configurations/blob/release-2.1/config/examples/Mks/Sbase/README.md + * P0.27 is on EXP2 and the on-board SD card socket so it can't be used as SD_DETECT for the LCD SD card. * - * The best solution is to use the custom cable to connect the LCD's SD_DETECT - * to a pin NOT on EXP2. + * The best solution is to use the custom cable to connect the LCD SD_DETECT to a pin NOT on EXP2. * - * If you can't find a pin to use for the LCD's SD_DETECT then comment out - * SD_DETECT_PIN entirely and remove that wire from the the custom cable. + * If you can't find a pin to use for the LCD SD_DETECT then comment out SD_DETECT_PIN and remove that wire + * from the the custom cable. */ - #define SD_DETECT_PIN P2_11 // J8-5 (moved from EXP2 P0.27) - #define SD_SCK_PIN P1_22 // J8-2 (moved from EXP2 P0.7) - #define SD_MISO_PIN P1_23 // J8-3 (moved from EXP2 P0.8) - #define SD_MOSI_PIN P2_12 // J8-4 (moved from EXP2 P0.9) + #define SD_DETECT_PIN PIN_P2_11 // J8-5 (moved from EXP2 P0.27) + #define SD_SCK_PIN PIN_P1_22 // J8-2 (moved from EXP2 P0.7) + #define SD_MISO_PIN PIN_P1_23 // J8-3 (moved from EXP2 P0.8) + #define SD_MOSI_PIN PIN_P2_12 // J8-4 (moved from EXP2 P0.9) #define SD_SS_PIN P0_28 #define SOFTWARE_SPI // With a custom cable we need software SPI because the // selected pins are not on a hardware SPI controller @@ -205,41 +202,52 @@ #endif /** - * Smart LCD adapter - * - * The Smart LCD adapter can be used for the two 10 pin LCD controllers such as - * REPRAP_DISCOUNT_SMART_CONTROLLER. It can't be used for controllers that use - * DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7. A custom cable - * is needed to pick up 5V for the EXP1 connection. - * - * SD card on the LCD uses the same SPI signals as the LCD. This results in garbage/lines - * on the LCD display during accesses of the SD card. The menus/code has been arranged so - * that the garbage/lines are erased immediately after the SD card accesses are completed. + * ------ ------ + * 1.31 | 1 2 | 1.30 0.08 | 1 2 | 0.07 + * 0.18 | 3 4 | 0.16 3.25 | 3 4 | 0.28 + * 0.15 | 5 6 -- 3.26 | 5 6 0.09 + * -- | 7 8 | -- 0.27 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- + * ------ ------ + * EXP1 EXP2 */ +#define EXP1_01_PIN P1_31 +#define EXP1_02_PIN P1_30 +#define EXP1_03_PIN P0_18 +#define EXP1_04_PIN P0_16 +#define EXP1_05_PIN P0_15 + +#define EXP2_01_PIN P0_08 +#define EXP2_02_PIN P0_07 +#define EXP2_03_PIN P3_25 +#define EXP2_04_PIN P0_28 +#define EXP2_05_PIN P3_26 +#define EXP2_06_PIN P0_09 +#define EXP2_07_PIN P0_27 // // LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS P3_25 // EXP2.3 + #define TFTGLCD_CS EXP2_03_PIN #endif - #if SD_CONNECTION_IS(LCD) - #define SD_DETECT_PIN P0_28 // EXP2.4 + #define SD_DETECT_PIN EXP2_04_PIN #endif #elif HAS_WIRED_LCD - #define BEEPER_PIN P1_31 // EXP1.1 - #define BTN_ENC P1_30 // EXP1.2 - #define BTN_EN1 P3_26 // EXP2.5 - #define BTN_EN2 P3_25 // EXP2.3 - #define LCD_PINS_RS P0_16 // EXP1.4 - #define LCD_SDSS P0_28 // EXP2.4 - #define LCD_PINS_EN P0_18 // EXP1.3 - #define LCD_PINS_D4 P0_15 // EXP1.5 + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_SDSS EXP2_04_PIN + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if ANY(VIKI2, miniVIKI) #define DOGLCD_SCK SD_SCK_PIN #define DOGLCD_MOSI SD_MOSI_PIN @@ -257,9 +265,9 @@ * Pins 6, 7 & 8 on EXP2 are no connects. That means a second special * cable will be needed if the RGB LEDs are to be active. */ - #define DOGLCD_CS P0_18 // EXP1.3 (LCD_EN on FYSETC schematic) - #define DOGLCD_A0 P0_16 // EXP1.4 (LCD_A0 on FYSETC schematic) - #define DOGLCD_SCK P2_11 // J8-5 (SCK on FYSETC schematic) + #define DOGLCD_CS EXP1_03_PIN // LCD_EN + #define DOGLCD_A0 EXP1_04_PIN // LCD_A0 + #define DOGLCD_SCK PIN_P2_11 // J8-5 (SCK on FYSETC schematic) #define DOGLCD_MOSI P4_28 // J8-6 (MOSI on FYSETC schematic) //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems @@ -267,16 +275,16 @@ #if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN P2_12 // J8-4 (LCD_D6 on FYSETC schematic) + #define RGB_LED_R_PIN PIN_P2_12 // J8-4 (LCD_D6 on FYSETC schematic) #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_23 // J8-3 (LCD_D5 on FYSETC schematic) + #define RGB_LED_G_PIN PIN_P1_23 // J8-3 (LCD_D5 on FYSETC schematic) #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_22 // J8-2 (LCD_D7 on FYSETC schematic) + #define RGB_LED_B_PIN PIN_P1_22 // J8-2 (LCD_D7 on FYSETC schematic) #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P2_12 + #define NEOPIXEL_PIN PIN_P2_12 #endif #elif ENABLED(MINIPANEL) @@ -293,10 +301,10 @@ #if HAS_DRIVER(TMC2130) // J8 - #define X_CS_PIN P1_22 - #define Y_CS_PIN P1_23 - #define Z_CS_PIN P2_12 - #define E0_CS_PIN P2_11 + #define X_CS_PIN PIN_P1_22 + #define Y_CS_PIN PIN_P1_23 + #define Z_CS_PIN PIN_P2_12 + #define E0_CS_PIN PIN_P2_11 #define E1_CS_PIN P4_28 // Hardware SPI is on EXP2. See if you can make it work: @@ -323,13 +331,13 @@ * Worst case you may have to give up the LCD * RX pins need to be interrupt capable */ - #define X_SERIAL_TX_PIN P1_22 // J8-2 - #define X_SERIAL_RX_PIN P2_12 // J8-4 Interrupt Capable + #define X_SERIAL_TX_PIN PIN_P1_22 // J8-2 + #define X_SERIAL_RX_PIN PIN_P2_12 // J8-4 Interrupt Capable - #define Y_SERIAL_TX_PIN P1_23 // J8-3 - #define Y_SERIAL_RX_PIN P2_11 // J8-5 Interrupt Capable + #define Y_SERIAL_TX_PIN PIN_P1_23 // J8-3 + #define Y_SERIAL_RX_PIN PIN_P2_11 // J8-5 Interrupt Capable - #define Z_SERIAL_TX_PIN P2_12 // J8-4 + #define Z_SERIAL_TX_PIN PIN_P2_12 // J8-4 #define Z_SERIAL_RX_PIN P0_25 // TH3 #define E0_SERIAL_TX_PIN P4_28 // J8-6 diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index e507f7b7fa..38c7cac3d4 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -23,8 +23,7 @@ /** * Makerbase MKS SGEN-L pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS_GEN_L_V1_0/MKS%20Gen_L%20V1.0_008%20SCH.pdf - * Origin: https://github.com/makerbase-mks/SGEN_L/blob/master/Hardware/MKS%20SGEN_L%20V1.0_001/MKS%20SGEN_L%20V1.0_001%20SCH.pdf + * Schematic: https://github.com/makerbase-mks/SGEN_L/blob/master/Hardware/MKS%20SGEN_L%20V1.0_001/MKS%20SGEN_L%20V1.0_001%20SCH.pdf */ #include "env_validate.h" @@ -95,6 +94,13 @@ #define Z_MIN_PROBE_PIN P1_24 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index f3b134cd36..14d6178a1a 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -23,8 +23,7 @@ /** * Re-ARM with RAMPS v1.4 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Re-ARM%20RAMPS%201.4/Re_ARM_Schematic.pdf - * Origin: https://reprap.org/mediawiki/images/f/fa/Re_ARM_Schematic.pdf + * Schematic: https://reprap.org/mediawiki/images/f/fa/Re_ARM_Schematic.pdf * * Applies to the following boards: * @@ -167,7 +166,7 @@ #define TEMP_2_PIN P0_26_A3 // A3 - (63) - J5-3 & AUX-2 #define TEMP_3_PIN P1_30_A4 // A4 - (37) - BUZZER_PIN //#define TEMP_4_PIN P1_31_A5 // A5 - (49) - SD_DETECT_PIN -//#define ?? P0_03_A6 // A6 - ( 0) - RXD0 - J4-4 & AUX-1 +//#define PIN_P0_03 P0_03_A6 // A6 - ( 0) - RXD0 - J4-4 & AUX-1 #define FILWIDTH_PIN P0_02_A7 // A7 - ( 1) - TXD0 - J4-5 & AUX-1 // @@ -293,14 +292,13 @@ #if ENABLED(CR10_STOCKDISPLAY) // Re-Arm can support Creality stock display without SD card reader and single cable on EXP3. - // Re-Arm J3 pins 1 (p1.31) & 2 (P3.26) are not used. Stock cable will need to have one + // Re-Arm J3 pins 1 (P1.31) & 2 (P3.26) are not used. Stock cable will need to have one // 10-pin IDC connector trimmed or replaced with a 12-pin IDC connector to fit J3. - // Requires REVERSE_ENCODER_DIRECTION in Configuration.h #define BEEPER_PIN P2_11 // J3-3 & AUX-4 - #define BTN_EN1 P0_16 // J3-7 & AUX-4 - #define BTN_EN2 P1_23 // J3-5 & AUX-4 + #define BTN_EN1 P1_23 // J3-5 & AUX-4 + #define BTN_EN2 P0_16 // J3-7 & AUX-4 #define BTN_ENC P3_25 // J3-4 & AUX-4 #define LCD_PINS_RS P0_15 // J3-9 & AUX-4 (CS) @@ -309,9 +307,7 @@ #elif ENABLED(ZONESTAR_LCD) - #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 + CONTROLLER_WARNING("RAMPS_RE_ARM", "ZONESTAR_LCD", " ADCs are not 5V tolerant.") #elif IS_TFTGLCD_PANEL @@ -325,8 +321,8 @@ #elif HAS_WIRED_LCD #if ENABLED(FYSETC_MINI_12864) - #define BEEPER_PIN P1_01 - #define BTN_ENC P1_04 + #define BEEPER_PIN P1_01 // (79) J12-12 + #define BTN_ENC P1_04 // (77) J12-10 #else #define BEEPER_PIN P1_30 // (37) not 5V tolerant #define BTN_ENC P2_11 // (35) J3-3 & AUX-4 @@ -367,14 +363,14 @@ #else #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_SCK P0_15 - #define DOGLCD_MOSI P0_18 + #define DOGLCD_SCK P0_15 // (52) (SCK) J3-9 & AUX-3 + #define DOGLCD_MOSI P0_18 // (51) (MOSI) J3-10 & AUX-3 // EXP1 on LCD adapter is not usable - using Ethernet connector instead - #define DOGLCD_CS P1_09 - #define DOGLCD_A0 P1_14 - //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems - // results in LCD soft SPI mode 3, SD soft SPI mode 0 + #define DOGLCD_CS P1_09 // (74) J12-7 + #define DOGLCD_A0 P1_14 // (73) J12-6 + //#define FORCE_SOFT_SPI // Use this if Hardware SPI causes display problems. + // Results in LCD Software SPI mode 3, SD Software SPI mode 0. #define LCD_RESET_PIN P0_16 // Must be high or open for LCD to operate normally. @@ -396,24 +392,22 @@ #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 #endif - #define LCD_BACKLIGHT_PIN P0_16 //(16) J3-7 & AUX-4 - only used on DOGLCD controllers + #define LCD_BACKLIGHT_PIN P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers #define LCD_PINS_EN P0_18 // (51) (MOSI) J3-10 & AUX-3 #define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3 #if IS_ULTIPANEL #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1 - #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder #endif - #endif #endif #if ENABLED(MINIPANEL) //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 - #endif + #endif #endif // HAS_WIRED_LCD @@ -421,17 +415,17 @@ // Ethernet pins // #if !IS_ULTIPANEL - #define ENET_MDIO P1_17 // (71) J12-4 - #define ENET_RX_ER P1_14 // (73) J12-6 - #define ENET_RXD1 P1_10 // (75) J12-8 + #define ENET_MDIO P1_17 // (71) J12-4 + #define ENET_RX_ER P1_14 // (73) J12-6 + #define ENET_RXD1 P1_10 // (75) J12-8 #endif -#define ENET_MOC P1_16 // (70) J12-3 -#define REF_CLK P1_15 // (72) J12-5 -#define ENET_RXD0 P1_09 // (74) J12-7 -#define ENET_CRS P1_08 // (76) J12-9 -#define ENET_TX_EN P1_04 // (77) J12-10 -#define ENET_TXD0 P1_00 // (78) J12-11 -#define ENET_TXD1 P1_01 // (79) J12-12 +#define ENET_MOC P1_16 // (70) J12-3 +#define REF_CLK P1_15 // (72) J12-5 +#define ENET_RXD0 P1_09 // (74) J12-7 +#define ENET_CRS P1_08 // (76) J12-9 +#define ENET_TX_EN P1_04 // (77) J12-10 +#define ENET_TXD0 P1_00 // (78) J12-11 +#define ENET_TXD1 P1_01 // (79) J12-12 // // SD Support @@ -441,10 +435,10 @@ #endif #if SD_CONNECTION_IS(LCD) - #define SD_SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 - #define SD_MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3 - #define SD_MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3 - #define SD_SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) - CS used by Marlin + #define SD_SCK_PIN P0_15 // (52) System-defined J3-9 & AUX-3 + #define SD_MISO_PIN P0_17 // (50) System-defined J3-10 & AUX-3 + #define SD_MOSI_PIN P0_18 // (51) System-defined J3-10 & AUX-3 + #define SD_SS_PIN P1_23 // (53) System-defined J3-5 & AUX-3 (aka SDSS, CS) #elif SD_CONNECTION_IS(ONBOARD) #undef SD_DETECT_PIN #define SD_SCK_PIN P0_07 diff --git a/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h index 16858c0b56..2d27b8e0f6 100644 --- a/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h +++ b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h @@ -23,8 +23,7 @@ /** * Selena Compact pin assignments - * Pinout: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Selena%20Compact/Compact%20Pinout.pdf - * Origin: https://github.com/f61/Selena/blob/master/Compact%20Pinout.pdf + * Schematic: https://github.com/f61/Selena/blob/master/Compact%20Pinout.pdf */ #include "env_validate.h" diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h index 8412f1c12d..26f0ff39ce 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h @@ -23,8 +23,7 @@ /** * Azteeg X5 GT pin assignments - * Wiring diagram: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X5%20GT/X5%20GT%20Wiring%20Diagram.pdf - * Origin: https://panucattdevices.freshdesk.com/support/solutions/articles/1000244740-support-files + * Schematic: https://panucattdevices.freshdesk.com/support/solutions/articles/1000244740-support-files */ #include "env_validate.h" diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h index 92e97ca875..5256da2ef2 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h @@ -23,17 +23,14 @@ /** * Azteeg X5 MINI pin assignments - * Schematic (V1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X5%20MINI/x5mini_design_files/X5mini_design_files/V1/X5%20Mini%20PUB%20v1.0.pdf - * Schematic (V2): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X5%20MINI/x5mini_design_files/X5mini_design_files/V2/X5%20Mini%20V2%20SCH%20Pub.pdf - * Schematic (V3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X5%20MINI/x5mini_design_files/X5mini_design_files/V3/X5%20Mini%20V3%20SCH%20Pub.pdf - * Origin: http://files.panucatt.com/datasheets/x5mini_design_files.zip + * Schematic: http://files.panucatt.com/datasheets/x5mini_design_files.zip */ #include "env_validate.h" #ifndef BOARD_INFO_NAME #define BOARD_INFO_NAME "Azteeg X5 MINI" #endif -#define BOARD_WEBSITE_URL "tiny.cc/x5_mini" +#define BOARD_WEBSITE_URL "panucatt.com" // // LED @@ -56,11 +53,11 @@ #define Z_STOP_PIN P1_28 #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN P2_04 + #define FIL_RUNOUT_PIN _EXP1_09 #endif #ifndef FILWIDTH_PIN - #define FILWIDTH_PIN P0_25_A2 // Analog Input (P0_25) + #define FILWIDTH_PIN _EXP1_04 // Analog Input (P0_25) #endif // @@ -109,6 +106,47 @@ #endif #define FAN1_PIN P1_25 +// +// Headers V1.1 - V3.0 +// +//#define _EXP1_01 -1 // GND +#define _EXP1_02 P1_03 +//#define _EXP1_03 -1 // 3.3V +#define _EXP1_04 P0_25_A2 +#define _EXP1_05 P0_27 // SDA0 +#define _EXP1_06 P4_29 +#define _EXP1_07 P0_28 // SCL0 +#define _EXP1_08 P2_08 +#define _EXP1_09 P2_04 +#define _EXP1_10 P1_22 + +#define _EXP2_01 P1_31 +#define _EXP2_02 P3_26 +#define _EXP2_03 P2_11 +#define _EXP2_04 P3_25 +#define _EXP2_05 P1_23 +#define _EXP2_06 P0_17 +#define _EXP2_07 P0_16 +#define _EXP2_08 P2_06 +#define _EXP2_09 P0_15 +#define _EXP2_10 P0_18 + +// +// Only V2.0 +// +//#define _J7_01 -1 // 3.3V +//#define _J7_02 -1 // GND +#define _J7_03 P1_16 +#define _J7_04 P1_17 +#define _J7_05 P1_15 +#define _J7_06 P0_14 +#define _J7_07 P1_09 +#define _J7_08 P1_10 +#define _J7_09 P1_08 +#define _J7_10 P1_04 +#define _J7_11 P1_00 +#define _J7_12 P1_01 + // // Display // @@ -121,61 +159,60 @@ // 10-pin IDC connector trimmed or replaced with a 12-pin IDC connector to fit J3. // Requires REVERSE_ENCODER_DIRECTION in Configuration.h - #define BEEPER_PIN P2_11 // J3-3 & AUX-4 + #define BEEPER_PIN _EXP2_03 - #define BTN_EN1 P0_16 // J3-7 & AUX-4 - #define BTN_EN2 P1_23 // J3-5 & AUX-4 - #define BTN_ENC P3_25 // J3-4 & AUX-4 + #define BTN_EN1 _EXP2_07 + #define BTN_EN2 _EXP2_05 + #define BTN_ENC _EXP2_04 - #define LCD_PINS_RS P0_15 // J3-9 & AUX-4 (CS) - #define LCD_PINS_EN P0_18 // J3-10 & AUX-3 (SID, MOSI) - #define LCD_PINS_D4 P2_06 // J3-8 & AUX-3 (SCK, CLK) + #define LCD_PINS_RS _EXP2_09 + #define LCD_PINS_EN _EXP2_10 + #define LCD_PINS_D4 _EXP2_08 #else - #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4 - #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4 - #define BTN_ENC P2_11 // (35) J3-3 & AUX-4 + #define BTN_EN1 _EXP2_02 + #define BTN_EN2 _EXP2_04 + #define BTN_ENC _EXP2_03 - #define SD_DETECT_PIN P1_31 // (49) not 5V tolerant J3-1 & AUX-3 - #define KILL_PIN P1_22 // (41) J5-4 & AUX-4 - #define LCD_PINS_RS P0_16 // (16) J3-7 & AUX-4 - #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4 - #define LCD_BACKLIGHT_PIN P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers - #define LCD_PINS_EN P0_18 // (51) (MOSI) J3-10 & AUX-3 - #define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3 + #define SD_DETECT_PIN _EXP2_01 + #define KILL_PIN _EXP1_10 + #define LCD_PINS_RS _EXP2_07 + #define LCD_SDSS _EXP2_07 + #define LCD_BACKLIGHT_PIN _EXP2_07 + #define LCD_PINS_EN _EXP2_10 + #define LCD_PINS_D4 _EXP2_09 - #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 + #define DOGLCD_A0 _EXP2_08 #if IS_RRW_KEYPAD - #define SHIFT_OUT_PIN P0_18 // (51) (MOSI) J3-10 & AUX-3 - #define SHIFT_CLK_PIN P0_15 // (52) (SCK) J3-9 & AUX-3 - #define SHIFT_LD_PIN P1_31 // (49) not 5V tolerant J3-1 & AUX-3 + #define SHIFT_OUT_PIN _EXP2_10 + #define SHIFT_CLK_PIN _EXP2_09 + #define SHIFT_LD_PIN _EXP2_01 #elif !IS_NEWPANEL - //#define SHIFT_OUT_PIN P2_11 // (35) J3-3 & AUX-4 - //#define SHIFT_CLK_PIN P3_26 // (31) J3-2 & AUX-4 - //#define SHIFT_LD_PIN P3_25 // (33) J3-4 & AUX-4 - //#define SHIFT_EN_PIN P1_22 // (41) J5-4 & AUX-4 + //#define SHIFT_OUT_PIN _EXP2_03 + //#define SHIFT_CLK_PIN _EXP2_02 + //#define SHIFT_LD_PIN _EXP2_04 + //#define SHIFT_EN_PIN _EXP1_10 #endif #if ANY(VIKI2, miniVIKI) - #define BEEPER_PIN P1_30 // (37) may change if cable changes - #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2 + #define BEEPER_PIN P1_30 + #define DOGLCD_CS P0_26 #define DOGLCD_SCK SD_SCK_PIN #define DOGLCD_MOSI SD_MOSI_PIN - #define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes - #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes + #define STAT_LED_BLUE_PIN P0_26 + #define STAT_LED_RED_PIN P1_21 - //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #else #if IS_ULTIPANEL - #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO - #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER - #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1 + #define LCD_PINS_D5 P1_17 + #define LCD_PINS_D6 P1_14 + #define LCD_PINS_D7 P1_10 #endif - #define BEEPER_PIN P1_30 // (37) not 5V tolerant - #define DOGLCD_CS P0_16 // (16) + #define BEEPER_PIN P1_30 + #define DOGLCD_CS _EXP2_07 #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -183,7 +220,7 @@ #endif - #if ENABLED(MINIPANEL) + #if ANY(VIKI2, miniVIKI, MINIPANEL) //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #endif @@ -199,10 +236,10 @@ #endif #if SD_CONNECTION_IS(LCD) - #define SD_SCK_PIN P0_15 - #define SD_MISO_PIN P0_17 - #define SD_MOSI_PIN P0_18 - #define SD_SS_PIN P1_23 + #define SD_SCK_PIN _EXP2_09 + #define SD_MISO_PIN _EXP2_06 + #define SD_MOSI_PIN _EXP2_10 + #define SD_SS_PIN _EXP2_05 #elif SD_CONNECTION_IS(ONBOARD) #undef SD_DETECT_PIN #define SD_SCK_PIN P0_07 diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h index 74439e4f3d..fd69efa8e8 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h @@ -23,8 +23,7 @@ /** * Azteeg X5 MINI WIFI pin assignments - * Wiring diagram: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X5%20MINI%20WIFI/x5mini_wifi_wiring.pdf - * Origin: http://files.panucatt.com/datasheets/x5mini_wifi_wiring.pdf + * Schematic: http://files.panucatt.com/datasheets/x5mini_wifi_wiring.pdf */ #include "env_validate.h" 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 966ff5ef95..074ee067a6 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -23,8 +23,7 @@ /** * BigTreeTech SKR E3 Turbo pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20E3%20Turbo/BTT%20SKR%20E3%20Turbo-SCH.pdf - * Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-E3-Turbo/blob/master/Hardware/BTT%20SKR%20E3%20Turbo-SCH.pdf + * Schematic: https://github.com/bigtreetech/BIGTREETECH-SKR-E3-Turbo/blob/master/Hardware/BTT%20SKR%20E3%20Turbo-SCH.pdf */ #include "env_validate.h" @@ -66,6 +65,13 @@ #define Z_MIN_PROBE_PIN P1_22 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -80,8 +86,8 @@ #endif // LED driving pin -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN P1_24 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN P1_24 #endif // @@ -212,9 +218,8 @@ #define EXP1_08_PIN P0_18 #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI - #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 + + CONTROLLER_WARNING("BTT_SKR_E3_TURBO", "Ender-3 V2 display", " Requires a custom cable with TX = P0_15, RX = P0_16.") /** * Ender-3 V2 display SKR E3 Turbo (EXP1) Ender-3 V2 display --> SKR E3 Turbo @@ -248,9 +253,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #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 + CONTROLLER_WARNING("BTT_SKR_E3_TURBO", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h index 1bd70d8fb5..2e24197106 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h @@ -23,8 +23,7 @@ /** * BigTreeTech SKR 1.4 Turbo pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20V1.4%20+%20Turbo/BTT%20SKR%20V1.4-SCH.pdf - * Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/Hardware/BTT%20SKR%20V1.4-SCH.pdf + * Schematic: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/Hardware/BTT%20SKR%20V1.4-SCH.pdf */ #define BOARD_INFO_NAME "BTT SKR V1.4 TURBO" diff --git a/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h index 70781cb0b5..485b3109ad 100644 --- a/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h @@ -23,8 +23,7 @@ /** * Cohesion3D Mini pin assignments - * Pinout: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Cohesion3D%20Mini/c3d-pinout.jpg - * Origin: https://lasergods.com/cohesion3d-mini-pinout-diagram/ + * Schematic: https://lasergods.com/cohesion3d-mini-pinout-diagram/ */ #include "env_validate.h" diff --git a/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h index 362aafe12e..d1ecb0e7dd 100644 --- a/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h +++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h @@ -23,8 +23,7 @@ /** * Cohesion3D ReMix pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Cohesion3D%20ReMix/C3D%20ReMix%20rev2.svg - * Origin: https://github.com/Cohesion3D/Cohesion3D-ReMix/blob/master/C3D%20ReMix%20rev2.sch + * Schematic: https://github.com/Cohesion3D/Cohesion3D-ReMix/blob/master/C3D%20ReMix%20rev2.sch */ #include "env_validate.h" @@ -158,6 +157,37 @@ #define SPINDLE_DIR_PIN P2_06 // FET 4 #endif +/** ------ ------ + * (BEEPER) 1.31 | 1 2 | 1.30 (BTN_ENC) (MISO) 0.8 | 1 2 | 0.7 (SD_SCK) + * (EN) 0.18 | 3 4 | 0.16 (RS) (EN1) 3.26 | 3 4 | 0.28 (SD_CS2) + * (D4) 0.15 5 6 | -- (EN2) 3.25 5 6 | 0.9 (SD_MOSI) + * -- | 7 8 | 0.27 (D7) (SD_DET) 0.27 | 7 8 | 2.11 + * GND | 9 10 | 5V GND | 9 10 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_01_PIN P1_31 +#define EXP1_02_PIN P1_30 +#define EXP1_03_PIN P0_18 +#define EXP1_04_PIN P0_16 +#define EXP1_05_PIN P0_15 +#define EXP1_06_PIN -1 +#define EXP1_07_PIN -1 +#define EXP1_08_PIN P0_27 // (also on EXP2-7) +#define EXP1_09_PIN -1 +#define EXP1_10_PIN -1 + +#define EXP2_01_PIN P0_08 +#define EXP2_02_PIN P0_07 +#define EXP2_03_PIN P3_26 +#define EXP2_04_PIN P0_28 +#define EXP2_05_PIN P3_25 +#define EXP2_06_PIN P0_09 +#define EXP2_07_PIN P0_27 // (also on EXP1-8) +#define EXP2_08_PIN P2_11 +#define EXP2_09_PIN -1 +#define EXP2_10_PIN -1 + // // LCD / Controller // @@ -171,54 +201,54 @@ #if ENABLED(FYSETC_MINI_12864) - #define FORCE_SOFT_SPI // REQUIRED - results in LCD soft SPI mode 3 + #define FORCE_SOFT_SPI // REQUIRED. Results in LCD Software SPI mode 3 - #define BEEPER_PIN P1_31 // EXP1-1 - #define BTN_ENC P1_30 // EXP1-2 - #define DOGLCD_CS P0_18 // EXP1-3 - #define DOGLCD_A0 P0_16 // EXP1-4 - #define LCD_RESET_PIN P0_15 // EXP1-5 + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define LCD_RESET_PIN EXP1_05_PIN // A custom cable is REQUIRED for EXP2 cable because the SCK & MOSI on the card's EXP2 are dedicated // to the onboard SD card. All required EXP2 signals come from the Ethernet connector. Pin 1 of this // connector is the one nearest the motor power connector. - #define DOGLCD_SCK P1_17 // EXP2-2 => Ethernet pin 5 (bottom, 3 from left) - #define BTN_EN2 P1_09 // EXP2-3 => Ethernet pin 9 (bottom, 5 from left) - #define BTN_EN1 P1_04 // EXP2-5 => Ethernet pin 11 (bottom, 6 from left) - #define DOGLCD_MOSI P1_01 // EXP2-6 => Ethernet pin 13 (bottom, 7 from left) + #define DOGLCD_SCK P1_17 // LCD2-2 => Ethernet pin 5 (bottom, 3 from left) + #define BTN_EN2 P1_09 // LCD2-3 => Ethernet pin 9 (bottom, 5 from left) + #define BTN_EN1 P1_04 // LCD2-5 => Ethernet pin 11 (bottom, 6 from left) + #define DOGLCD_MOSI P1_01 // LCD2-6 => Ethernet pin 13 (bottom, 7 from left) // A custom EXP1 cable is required colored LEDs. Pins 1-5, 9, 10 of the cable go to pins 1-5, 9, 10 // on the board's EXP1 connector. Pins 6, 7, and 8 of the EXP1 cable go to the Ethernet connector. // Rev 1.2 displays do NOT require the RGB LEDs. 2.0 and 2.1 displays do require RGB. #if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN P1_16 // EXP1-6 => Ethernet pin 6 (top row, 3 from left) + #define RGB_LED_R_PIN P1_16 // LCD1-6 => Ethernet pin 6 (top row, 3 from left) #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_10 // EXP1-7 => Ethernet pin 10 (top row, 5 from left) + #define RGB_LED_G_PIN P1_10 // LCD1-7 => Ethernet pin 10 (top row, 5 from left) #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_00 // EXP1-8 => Ethernet pin 12 (top row, 6 from left) + #define RGB_LED_B_PIN P1_00 // LCD1-8 => Ethernet pin 12 (top row, 6 from left) #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P1_16 // EXP1-6 => Ethernet pin 6 (top row, 3 from left) + #define NEOPIXEL_PIN P1_16 // LCD1-6 => Ethernet pin 6 (top row, 3 from left) #endif #elif HAS_WIRED_LCD - #define BEEPER_PIN P1_31 // EXP1-1 - //#define SD_DETECT_PIN P0_27 // EXP2-7 + #define BEEPER_PIN EXP1_01_PIN + //#define SD_DETECT_PIN EXP2_07_PIN - #define BTN_EN1 P3_26 // EXP2-5 - #define BTN_EN2 P3_25 // EXP2-3 - #define BTN_ENC P1_30 // EXP1-2 + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN - #define LCD_PINS_RS P0_16 // EXP1-4 - #define LCD_SDSS P0_28 // EXP2-4 - #define LCD_PINS_EN P0_18 // EXP1-3 - #define LCD_PINS_D4 P0_15 // EXP1-5 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_SDSS EXP2_04_PIN + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN - #define KILL_PIN P2_11 // EXP2-10 + #define KILL_PIN EXP2_08_PIN #endif // HAS_WIRED_LCD @@ -230,11 +260,11 @@ #endif #if SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD) - #define SD_SCK_PIN P0_07 // (52) system defined J3-9 & AUX-3 - #define SD_MISO_PIN P0_08 // (50) system defined J3-10 & AUX-3 - #define SD_MOSI_PIN P0_09 // (51) system defined J3-10 & AUX-3 + #define SD_SCK_PIN EXP2_02_PIN // (52) System-defined J3-9 & AUX-3 + #define SD_MISO_PIN EXP2_01_PIN // (50) System-defined J3-10 & AUX-3 + #define SD_MOSI_PIN EXP2_06_PIN // (51) System-defined J3-10 & AUX-3 #if SD_CONNECTION_IS(LCD) - #define SD_SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) - CS used by Marlin + #define SD_SS_PIN P1_23 // (53) System-defined J3-5 & AUX-3 (Sometimes called SDSS) - CS used by Marlin #else #undef SD_DETECT_PIN #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card @@ -257,30 +287,3 @@ //#define ENET_TX_EN P1_04 // Ethernet pin 11 (bottom, 6 from left) //#define ENET_TXD0 P1_00 // Ethernet pin 12 (top row, 6 from left) //#define ENET_TXD1 P1_01 // Ethernet pin 13 (bottom, 7 from left) - -/** - * EXP1 pins - * 1 - P1_31 - * 2 - P1_30 - * 3 - P0_18 - * 4 - P0_16 - * 5 - P0_15 - * 6 - N/C - * 7 - N/C - * 8 - P0_27 (also on EXP2-7) - * 9 - GND - * 10 - +5V - * - * - * EXP2 pins - * 1 - P0_08 - * 2 - P0_07 - * 3 - P3_26 - * 4 - P0_28 - * 5 - P3_25 - * 6 - P0_09 - * 7 - P0_27 (also on EXP1_8) - * 8 - P2_11 - * 9 - GND - * 10 - N/C - */ diff --git a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h index d5a7a38c23..9b22214a7a 100644 --- a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h +++ b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h @@ -23,8 +23,7 @@ /** * FLYmaker FLY-CDY pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/FLYmaker%20FLY-CDY%20V1/FLY_CDY%20SCH.pdf - * Origin: https://github.com/Mellow-3D/FLY-CDY/blob/master/Motherboard%20information/FLY_CDY%20SCH.pdf + * Schematic: https://github.com/Mellow-3D/FLY-CDY/blob/master/Motherboard%20information/FLY_CDY%20SCH.pdf */ #include "env_validate.h" diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h index 5e552353cd..64abf5212f 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h @@ -23,8 +23,7 @@ /** * MKS SGen pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS%20SGEN/MKS%20SGEN%20V1.0_001%20SCH.pdf - * Origin: https://github.com/makerbase-mks/MKS-SGen/blob/master/Hardware/MKS%20SGEN%20V1.0_001/MKS%20SGEN%20V1.0_001%20SCH.pdf + * Schematic: https://github.com/makerbase-mks/MKS-SGen/blob/master/Hardware/MKS%20SGEN%20V1.0_001/MKS%20SGEN%20V1.0_001%20SCH.pdf * * Pins diagram: * https://github.com/makerbase-mks/MKS-SGen/blob/master/Hardware/MKS%20SGEN%20V1.0_001/MKS%20SGEN%20V1.0_001%20PIN.pdf 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 b431f33582..aec4240276 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -23,8 +23,7 @@ /** * MKS SGen-L V2 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS%20SGEN_L%20V2/MKS%20SGEN_L%20V2.0_003%20SCH.pdf - * Origin: https://github.com/makerbase-mks/MKS-SGEN_L-V2/blob/master/Hardware/MKS%20SGEN_L%20V2.0_003/MKS%20SGEN_L%20V2.0_003%20SCH.pdf + * Schematic: https://github.com/makerbase-mks/MKS-SGEN_L-V2/blob/master/Hardware/MKS%20SGEN_L%20V2.0_003/MKS%20SGEN_L%20V2.0_003%20SCH.pdf */ #include "env_validate.h" @@ -103,6 +102,13 @@ #define Z_MIN_PROBE_PIN P1_24 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -429,6 +435,9 @@ #endif // HAS_WIRED_LCD +// +// SD Card +// #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif diff --git a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h index 3db18e4acf..8856d69720 100644 --- a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h @@ -23,8 +23,7 @@ /** * Smoothieware Smoothieboard pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Smoothieware%20Smoothieboard%20V1/http.i.imgur.com.oj4zqs3.png - * Origin: http://smoothieware.org/_media///external/http.i.imgur.com.oj4zqs3.png + * Schematic: http://smoothieware.org/_media///external/http.i.imgur.com.oj4zqs3.png */ #include "env_validate.h" @@ -93,6 +92,7 @@ // // LCD / Controller // + #if ANY(VIKI2, miniVIKI) #define BEEPER_PIN P1_31 diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h index 60d68a8607..1c0623aea8 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h @@ -138,6 +138,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define BEEPER_PIN 6 diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h index 5c92f92e29..4864a6d83c 100644 --- a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h +++ b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h @@ -143,6 +143,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define BEEPER_PIN 16 diff --git a/Marlin/src/pins/mega/pins_EINSTART-S.h b/Marlin/src/pins/mega/pins_EINSTART-S.h index 813cbf7dc4..92c85c1211 100644 --- a/Marlin/src/pins/mega/pins_EINSTART-S.h +++ b/Marlin/src/pins/mega/pins_EINSTART-S.h @@ -78,12 +78,8 @@ #define SDSS 53 #define LED_PIN 4 -////////////////////////// -// LCDs and Controllers // -////////////////////////// - // -// LCD Display output pins +// LCD / Controller // // Requires #define U8GLIB_SH1106_EINSTART in Configuration.h diff --git a/Marlin/src/pins/mega/pins_ELEFU_3.h b/Marlin/src/pins/mega/pins_ELEFU_3.h index 71797a30ff..623b7a0d43 100644 --- a/Marlin/src/pins/mega/pins_ELEFU_3.h +++ b/Marlin/src/pins/mega/pins_ELEFU_3.h @@ -23,8 +23,7 @@ /** * Elefu RA Board Pin Assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Elefu%20Ra%20v3/schematic.pdf - * Origin: https://github.com/kiyoshigawa/Elefu-RAv3/blob/master/RA_Circuits.zip + * Schematic: https://github.com/kiyoshigawa/Elefu-RAv3/blob/master/RA_Circuits.zip * ATmega2560 */ diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A.h b/Marlin/src/pins/mega/pins_GT2560_REV_A.h index 55632e97bf..96e3e5c36f 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_A.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A.h @@ -25,8 +25,7 @@ * Geeetech GT2560 Revision A board pin assignments, based on the work of * George Robles (https://georges3dprinters.com) and * Richard Smith - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20Revision%20A/GT2560_sch.pdf - * Origin: https://www.geeetech.com/wiki/images/9/90/GT2560_sch.pdf + * Schematic: https://www.geeetech.com/wiki/images/9/90/GT2560_sch.pdf * ATmega2560 */ diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h b/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h index a90c075be5..a593393f08 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h @@ -23,8 +23,7 @@ /** * Geeetech GT2560 Revision A+ board pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20Revision%20A+/Hardware_GT2560_RevA+.pdf - * Origin: https://www.geeetech.com/wiki/images/d/d3/Hardware_GT2560_RevA%2B.pdf + * Schematic: https://www.geeetech.com/wiki/images/d/d3/Hardware_GT2560_RevA%2B.pdf * ATmega2560 */ diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_B.h b/Marlin/src/pins/mega/pins_GT2560_REV_B.h index 0702d14eb8..24915ce395 100644 --- a/Marlin/src/pins/mega/pins_GT2560_REV_B.h +++ b/Marlin/src/pins/mega/pins_GT2560_REV_B.h @@ -23,8 +23,7 @@ /** * Geeetech GT2560 Rev B Pins - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20Rev%20B/GT2560_REVB.pdf - * Origin: https://www.geeetech.com/wiki/images/7/72/GT2560_REVB.pdf + * Schematic: https://www.geeetech.com/wiki/images/7/72/GT2560_REVB.pdf * ATmega2560 */ diff --git a/Marlin/src/pins/mega/pins_GT2560_V3.h b/Marlin/src/pins/mega/pins_GT2560_V3.h index b684214c69..1323ae3c8e 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V3.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3.h @@ -23,8 +23,7 @@ /** * Geeetech GT2560 3.0/3.1 pin assignments - * Schematic (3.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%203.0/GT2560_V3.0_SCH.pdf - * Origin (3.0): https://github.com/Geeetech3D/Diagram/blob/master/GT2560_V3.0_SCH.pdf + * Schematic (3.0): https://github.com/Geeetech3D/Diagram/blob/master/GT2560_V3.0_SCH.pdf * ATmega2560 * * Also GT2560 RevB and GT2560 4.0/4.1 diff --git a/Marlin/src/pins/mega/pins_GT2560_V4.h b/Marlin/src/pins/mega/pins_GT2560_V4.h index 98f503886f..f931238f92 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V4.h +++ b/Marlin/src/pins/mega/pins_GT2560_V4.h @@ -23,9 +23,7 @@ /** * Geeetech GT2560 V4.X Pins - * Schematic (4.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20V4.x%20+%20A20/GT2560V4.0SCHA20T.pdf - * Schematic (4.1B): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20V4.x%20+%20A20/GT2560V4.1BSCHA20T.pdf - * Origin: https://www.geeetech.com/download.html?spm=a2g0s.imconversation.0.0.22d23e5fXlQBWv&download_id=45 + * Schematic: https://www.geeetech.com/download.html?spm=a2g0s.imconversation.0.0.22d23e5fXlQBWv&download_id=45 */ #define BOARD_INFO_NAME "GT2560 4.x" diff --git a/Marlin/src/pins/mega/pins_GT2560_V41b.h b/Marlin/src/pins/mega/pins_GT2560_V41b.h index 12d45be985..3ffaaabef4 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V41b.h +++ b/Marlin/src/pins/mega/pins_GT2560_V41b.h @@ -23,8 +23,7 @@ /** * Geeetech GT2560 V4.1b Pins - * Schematic (4.1B): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20V4.x%20+%20A20/GT2560V4.1BSCHA20T.pdf - * Origin: https://www.geeetech.com/download.html?spm=a2g0s.imconversation.0.0.22d23e5fXlQBWv&download_id=45 + * Schematic: https://www.geeetech.com/download.html?spm=a2g0s.imconversation.0.0.22d23e5fXlQBWv&download_id=45 * ATmega2560 */ diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h index 512da02834..638465f3b9 100644 --- a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h +++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h @@ -122,6 +122,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define BEEPER_PIN 18 diff --git a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h index 049917b6b6..514f7b255e 100644 --- a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h +++ b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h @@ -23,8 +23,7 @@ /** * Mega controller pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Mega%20Controller/Mega_controller.pdf - * Origin: https://reprap.org/mediawiki/images/b/ba/Mega_controller.pdf + * Schematic: https://reprap.org/mediawiki/images/b/ba/Mega_controller.pdf * ATmega2560 */ @@ -129,31 +128,60 @@ // // Misc. Functions // -#define SDSS 53 +#define SDSS MINI_06 #define LED_PIN 13 #ifndef CASE_LIGHT_PIN #define CASE_LIGHT_PIN 2 #endif +/** + * MegaController LCD/SD Connector + * + * SDD MOSI SDSS -- RESET -- LCDSS A0 KILL ENC + * 49 51 53 | 45 47 12 10 + * PL0 PB2 PB0 | PL4 PL2 PB6 PB4 + * ---------------------------------------------------------- + * | 2 4 6 8 10 12 14 16 18 20 | + * | 1 3 5 7 9 11 13 15 17 19 | + * ---------------------------------------------------------- + * | PB3 PB1 | | PL5 PL3 PL1 PB5 + * | 50 52 | | 44 46 48 11 + * 5V MISO SCK GND 3V3 -- BL BEEP EN1 EN2 + */ +#define MINI_02 49 // SD_DETECT +#define MINI_03 50 // MISO +#define MINI_04 51 // MOSI +#define MINI_05 52 // SCK +#define MINI_06 53 // SDSS +#define MINI_13 44 // BACKLIGHT +#define MINI_14 45 // LCDSS +#define MINI_15 46 // BEEP +#define MINI_16 47 // A0 +#define MINI_17 48 // EN1 +#define MINI_18 12 // KILL +#define MINI_19 11 // EN2 +#define MINI_20 10 // ENC + // // LCD / Controller // + #if ENABLED(MINIPANEL) - #define BEEPER_PIN 46 + #define BEEPER_PIN MINI_15 - #define DOGLCD_A0 47 - #define DOGLCD_CS 45 - #define LCD_BACKLIGHT_PIN 44 // backlight LED on PA3 + #define DOGLCD_A0 MINI_16 + #define DOGLCD_CS MINI_14 + #define LCD_BACKLIGHT_PIN MINI_13 // backlight LED on PA3 - #define KILL_PIN 12 + #define KILL_PIN MINI_18 - #define BTN_EN1 48 - #define BTN_EN2 11 - #define BTN_ENC 10 + #define BTN_ENC MINI_20 + #define BTN_EN1 MINI_17 + #define BTN_EN2 MINI_19 - #define SD_DETECT_PIN 49 + #define SD_DETECT_PIN MINI_02 //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS.h b/Marlin/src/pins/mega/pins_MEGATRONICS.h index 066b577c62..90d128c9fc 100644 --- a/Marlin/src/pins/mega/pins_MEGATRONICS.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS.h @@ -23,8 +23,7 @@ /** * MegaTronics pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MegaTronics/Megatronics_1_0_sch.pdf - * Origin: https://reprap.org/mediawiki/images/a/a3/Megatronics_1_0_sch.pdf + * Schematic: https://reprap.org/mediawiki/images/a/a3/Megatronics_1_0_sch.pdf * ATmega2560 */ diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h index ff118e7323..285a77b636 100644 --- a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h @@ -23,8 +23,7 @@ /** * MegaTronics v2.0 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Megatronics%20v2.0/megatronics%20-%20Project.pdf - * Origin: https://reprap.org/wiki/File:Megatronicsv2PDF.zip + * Schematic: https://reprap.org/wiki/File:Megatronicsv2PDF.zip * ATmega2560 */ diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS_3.h b/Marlin/src/pins/mega/pins_MEGATRONICS_3.h index 5e571d5a3f..5a71994063 100644 --- a/Marlin/src/pins/mega/pins_MEGATRONICS_3.h +++ b/Marlin/src/pins/mega/pins_MEGATRONICS_3.h @@ -23,7 +23,7 @@ /** * MegaTronics v3.0 / v3.1 / v3.2 pin assignments - * Schematic Origin: https://github.com/brupje/Megatronics_3/blob/master/Design%20Files/megatronics.sch + * Schematic: https://github.com/brupje/Megatronics_3/blob/master/Design%20Files/megatronics.sch * ATmega2560 */ diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h index e9a0ddc09d..fb73660815 100644 --- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h @@ -23,8 +23,7 @@ /** * Mightyboard Rev.E pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Mightyboard%20Rev.E/MakerBot%20MightyBoard%20REVE%20Schematic.pdf - * Origin: https://github.com/sciguy14/HelioWatcher/blob/master/HelioWatcher%20Circuit/MakerBot%20MightyBoard%20REVE%20Schematic.pdf + * Schematic: https://github.com/sciguy14/HelioWatcher/blob/master/HelioWatcher%20Circuit/MakerBot%20MightyBoard%20REVE%20Schematic.pdf * also works for Rev D boards. It's all rev E despite what the silk screen says */ @@ -187,6 +186,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #if IS_RRD_FG_SC diff --git a/Marlin/src/pins/mega/pins_MINITRONICS.h b/Marlin/src/pins/mega/pins_MINITRONICS.h index c8828faea7..e6e24f8886 100644 --- a/Marlin/src/pins/mega/pins_MINITRONICS.h +++ b/Marlin/src/pins/mega/pins_MINITRONICS.h @@ -23,10 +23,8 @@ /** * Minitronics v1.0/1.1 pin assignments - * Schematic (1.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Minitronics%20v1.0/minitronics%20-%20Project.pdf - * Origin (1.0): https://reprap.org/wiki/File:MinitronicsPDF.zip - * Datasheet (1.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Minitronics%20v1.1/datasheet%20minitronics%20v1.1.pdf - * Origin (1.1): https://reprapworld.nl/documentation/datasheet%20minitronics%20v1.1.pdf + * Schematic (1.0): https://reprap.org/wiki/File:MinitronicsPDF.zip + * Schematic (1.1): https://reprapworld.nl/documentation/datasheet%20minitronics%20v1.1.pdf * ATmega1281 */ diff --git a/Marlin/src/pins/mega/pins_OVERLORD.h b/Marlin/src/pins/mega/pins_OVERLORD.h index 1ae9e69af0..804aa38e59 100644 --- a/Marlin/src/pins/mega/pins_OVERLORD.h +++ b/Marlin/src/pins/mega/pins_OVERLORD.h @@ -23,8 +23,7 @@ /** * Dreammaker Overlord v1.1 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Dreammaker%20Overlord%20v1.1/Schematic.pdf - * Origin: https://github.com/jdpiercy/Overlord-Pro/blob/master/Motherboard/Schematic.pdf + * Schematic: https://github.com/jdpiercy/Overlord-Pro/blob/master/Motherboard/Schematic.pdf * ATmega2560 */ @@ -122,6 +121,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD // OVERLORD OLED pins #define LCD_PINS_RS 20 diff --git a/Marlin/src/pins/mega/pins_PICA.h b/Marlin/src/pins/mega/pins_PICA.h index 5e9d607a78..63e14d9bf2 100644 --- a/Marlin/src/pins/mega/pins_PICA.h +++ b/Marlin/src/pins/mega/pins_PICA.h @@ -23,8 +23,7 @@ /** * Arduino Mega with PICA pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/PICA/pica_schematic.pdf - * Origin: https://github.com/mjrice/PICA/blob/master/pica_schematic.pdf + * Schematic: https://github.com/mjrice/PICA/blob/master/pica_schematic.pdf * ATmega2560 * * PICA is Power, Interface, and Control Adapter and is open source hardware. @@ -43,15 +42,6 @@ #define BOARD_INFO_NAME "PICA" #endif -/* -// Note that these are the "pins" that correspond to the analog inputs on the arduino mega. -// These are not the same as the physical pin numbers - AD0 = 54; AD1 = 55; AD2 = 56; AD3 = 57; - AD4 = 58; AD5 = 59; AD6 = 60; AD7 = 61; - AD8 = 62; AD9 = 63; AD10 = 64; AD11 = 65; - AD12 = 66; AD13 = 67; AD14 = 68; AD15 = 69; -*/ - // // Servos // @@ -136,25 +126,53 @@ // // SD Support // -#define SD_DETECT_PIN 49 -#define SDSS 53 +#define SD_DETECT_PIN EXP2_07_PIN +#define SDSS EXP2_04_PIN + +/** PICA Expansion Headers + * ------ ------ + * (BEEP) 29 | 1 2 | 31 (ENC) (MISO) 50 | 1 2 | 52 (SCK) + * (LCD_EN) 30 | 3 4 | 33 (LCD_RS) (EN1) 47 | 3 4 | 53 (SDSS) + * (LCD_D4) 35 5 6 | 32 (LCD_D5) (EN2) 48 5 6 | 51 (MOSI) + * (LCD_D6) 37 | 7 8 | 36 (LCD_D7) (SDDET) 49 | 7 8 | 41 (KILL) + * GND | 9 10 | 5V -- | 9 10 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_01_PIN 29 // BEEPER +#define EXP1_02_PIN 31 // ENC +#define EXP1_03_PIN 30 // LCD_EN +#define EXP1_04_PIN 33 // LCD_RS +#define EXP1_05_PIN 35 // LCD_D4 +#define EXP1_06_PIN 32 // LCD_D5 +#define EXP1_07_PIN 37 // LCD_D6 +#define EXP1_08_PIN 36 // LCD_D7 + +#define EXP2_01_PIN 50 // MISO +#define EXP2_02_PIN 52 // SCK +#define EXP2_03_PIN 47 // EN1 +#define EXP2_04_PIN 53 // SDSS +#define EXP2_05_PIN 48 // EN2 +#define EXP2_06_PIN 51 // MOSI +#define EXP2_07_PIN 49 // SDDET +#define EXP2_08_PIN 41 // KILL // // LCD / Controller // -#define BEEPER_PIN 29 +#define BEEPER_PIN EXP1_01_PIN #if HAS_WIRED_LCD - #define LCD_PINS_RS 33 - #define LCD_PINS_EN 30 - #define LCD_PINS_D4 35 - #define LCD_PINS_D5 32 - #define LCD_PINS_D6 37 - #define LCD_PINS_D7 36 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_EN EXP1_03_PIN + #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 - #define BTN_EN1 47 - #define BTN_EN2 48 - #define BTN_ENC 31 + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN - #define LCD_SDSS 53 + #define LCD_SDSS EXP2_04_PIN #endif diff --git a/Marlin/src/pins/mega/pins_PICAOLD.h b/Marlin/src/pins/mega/pins_PICAOLD.h index 3654a45d3f..4a9ab4e6fc 100644 --- a/Marlin/src/pins/mega/pins_PICAOLD.h +++ b/Marlin/src/pins/mega/pins_PICAOLD.h @@ -21,8 +21,7 @@ */ #pragma once -// Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/PICAOLD/pica_schematic.pdf -// Origin: https://github.com/mjrice/PICA/blob/97ab9e7771a8e5eef97788f3adcc17a9fa9de9b9/pica_schematic.pdf +// Schematic: https://github.com/mjrice/PICA/blob/97ab9e7771a8e5eef97788f3adcc17a9fa9de9b9/pica_schematic.pdf // ATmega2560 #define HEATER_0_PIN 9 // E0 diff --git a/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h b/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h index 962fddc192..4b7d1007be 100644 --- a/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h +++ b/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h @@ -23,8 +23,7 @@ /** * Protoneer v3.00 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Protoneer%20CNC%20Shield%20v3.00/Arduino-CNC-Shield-Scematics-V3.XX_.webp - * Origin: https://i0.wp.com/blog.protoneer.co.nz/wp-content/uploads/2013/07/Arduino-CNC-Shield-Scematics-V3.XX_.jpg + * Schematic: https://i0.wp.com/blog.protoneer.co.nz/wp-content/uploads/2013/07/Arduino-CNC-Shield-Scematics-V3.XX_.jpg * ATmega2560 * * This CNC shield has an UNO pinout and fits all Arduino-compatibles. diff --git a/Marlin/src/pins/mega/pins_WEEDO_62A.h b/Marlin/src/pins/mega/pins_WEEDO_62A.h index f3adf5eab8..436529cb35 100644 --- a/Marlin/src/pins/mega/pins_WEEDO_62A.h +++ b/Marlin/src/pins/mega/pins_WEEDO_62A.h @@ -92,6 +92,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define BEEPER_PIN 37 diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/native/pins_RAMPS_NATIVE.h similarity index 68% rename from Marlin/src/pins/linux/pins_RAMPS_LINUX.h rename to Marlin/src/pins/native/pins_RAMPS_NATIVE.h index d1da0336bc..f08dc3c3ed 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/native/pins_RAMPS_NATIVE.h @@ -22,31 +22,11 @@ #pragma once /** - * Arduino Mega with RAMPS v1.4 (or v1.3) pin assignments - * - * Applies to the following boards: - * - * RAMPS_14_EFB (Hotend, Fan, Bed) - * RAMPS_14_EEB (Hotend0, Hotend1, Bed) - * RAMPS_14_EFF (Hotend, Fan0, Fan1) - * RAMPS_14_EEF (Hotend0, Hotend1, Fan) - * RAMPS_14_SF (Spindle, Controller Fan) - * - * RAMPS_13_EFB (Hotend, Fan, Bed) - * RAMPS_13_EEB (Hotend0, Hotend1, Bed) - * RAMPS_13_EFF (Hotend, Fan0, Fan1) - * RAMPS_13_EEF (Hotend0, Hotend1, Fan) - * RAMPS_13_SF (Spindle, Controller Fan) - * - * Other pins_MYBOARD.h files may override these defaults - * - * Differences between - * RAMPS_13 | RAMPS_14 - * 7 | 11 + * Native with a RAMPS like board with additional pins */ #ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "RAMPS 1.4" + #define BOARD_INFO_NAME "RAMPS Native" #endif #ifndef DEFAULT_MACHINE_NAME @@ -60,28 +40,24 @@ // // Servos // -#ifdef IS_RAMPS_13 - #define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI -#else - #define SERVO0_PIN 11 -#endif -#define SERVO1_PIN 6 -#define SERVO2_PIN 5 +#define SERVO0_PIN 151 +#define SERVO1_PIN 152 +#define SERVO2_PIN 153 #ifndef SERVO3_PIN - #define SERVO3_PIN 4 + #define SERVO3_PIN 154 #endif // // Limit Switches // -#define X_MIN_PIN 3 +#define X_MIN_PIN 155 #ifndef X_MAX_PIN - #define X_MAX_PIN 2 + #define X_MAX_PIN 156 #endif -#define Y_MIN_PIN 14 -#define Y_MAX_PIN 15 -#define Z_MIN_PIN 18 -#define Z_MAX_PIN 19 +#define Y_MIN_PIN 157 +#define Y_MAX_PIN 158 +#define Z_MIN_PIN 159 +#define Z_MAX_PIN 160 // // Z Probe (when not Z_MIN_PIN) @@ -128,24 +104,60 @@ #define E1_CS_PIN 44 #endif -#define Z4_STEP_PIN 13 -#define Z4_DIR_PIN 71 -#define Z4_ENABLE_PIN 12 +#define E2_STEP_PIN 100 +#define E2_DIR_PIN 101 +#define E2_ENABLE_PIN 102 +#ifndef E2_CS_PIN + #define E2_CS_PIN 103 +#endif -#define Z2_STEP_PIN 4 -#define Z2_DIR_PIN 5 -#define Z2_ENABLE_PIN 6 +#define E3_STEP_PIN 104 +#define E3_DIR_PIN 105 +#define E3_ENABLE_PIN 106 +#ifndef E3_CS_PIN + #define E3_CS_PIN 107 +#endif -#define Z3_STEP_PIN 12 -#define Z3_DIR_PIN 40 -#define Z3_ENABLE_PIN 44 +#define E4_STEP_PIN 108 +#define E4_DIR_PIN 109 +#define E4_ENABLE_PIN 110 +#ifndef E4_CS_PIN + #define E4_CS_PIN 111 +#endif + +#define E5_STEP_PIN 112 +#define E5_DIR_PIN 113 +#define E5_ENABLE_PIN 114 +#ifndef E5_CS_PIN + #define E5_CS_PIN 115 +#endif + +#define E6_STEP_PIN 116 +#define E6_DIR_PIN 117 +#define E6_ENABLE_PIN 118 +#ifndef E6_CS_PIN + #define E6_CS_PIN 119 +#endif + +#define E7_STEP_PIN 120 +#define E7_DIR_PIN 121 +#define E7_ENABLE_PIN 122 +#ifndef E7_CS_PIN + #define E7_CS_PIN 123 +#endif // // Temperature Sensors // #define TEMP_0_PIN 0 // Analog Input #define TEMP_1_PIN 1 // Analog Input -#define TEMP_BED_PIN 2 // Analog Input +#define TEMP_2_PIN 2 // Analog Input +#define TEMP_3_PIN 3 // Analog Input +#define TEMP_4_PIN 4 // Analog Input +#define TEMP_5_PIN 5 // Analog Input +#define TEMP_6_PIN 6 // Analog Input +#define TEMP_7_PIN 7 // Analog Input +#define TEMP_BED_PIN 8 // Analog Input // SPI for MAX Thermocouple #if !HAS_MEDIA @@ -157,55 +169,33 @@ // // Heaters / Fans // -#ifndef MOSFET_A_PIN - #define MOSFET_A_PIN 10 -#endif -#ifndef MOSFET_B_PIN - #define MOSFET_B_PIN 9 -#endif -#ifndef MOSFET_C_PIN - #define MOSFET_C_PIN 8 -#endif -#ifndef MOSFET_D_PIN - #define MOSFET_D_PIN -1 -#endif - -#define HEATER_0_PIN MOSFET_A_PIN - -#if FET_ORDER_EFB // Hotend, Fan, Bed - #define FAN0_PIN MOSFET_B_PIN - #define HEATER_BED_PIN MOSFET_C_PIN -#elif FET_ORDER_EEF // Hotend, Hotend, Fan - #define HEATER_1_PIN MOSFET_B_PIN - #define FAN0_PIN MOSFET_C_PIN -#elif FET_ORDER_EEB // Hotend, Hotend, Bed - #define HEATER_1_PIN MOSFET_B_PIN - #define HEATER_BED_PIN MOSFET_C_PIN -#elif FET_ORDER_EFF // Hotend, Fan, Fan - #define FAN0_PIN MOSFET_B_PIN - #define FAN1_PIN MOSFET_C_PIN -#elif FET_ORDER_SF // Spindle, Fan - #define FAN0_PIN MOSFET_C_PIN -#else // Non-specific are "EFB" (i.e., "EFBF" or "EFBE") - #define FAN0_PIN MOSFET_B_PIN - #define HEATER_BED_PIN MOSFET_C_PIN - #if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL) - #define FAN1_PIN MOSFET_D_PIN - #else - #define HEATER_1_PIN MOSFET_D_PIN - #endif -#endif +#define HEATER_0_PIN 10 +#define HEATER_1_PIN 9 +#define HEATER_2_PIN 8 +#define HEATER_3_PIN 125 +#define HEATER_4_PIN 126 +#define HEATER_5_PIN 127 +#define HEATER_6_PIN 128 +#define HEATER_7_PIN 129 +#define HEATER_BED_PIN 108 #ifndef FAN0_PIN - #define FAN0_PIN 4 // IO pin. Buffer needed + #define FAN0_PIN 161 // IO pin. Buffer needed #endif +#define FAN1_PIN 162 // IO pin. Buffer needed +#define FAN2_PIN 163 // IO pin. Buffer needed +#define FAN3_PIN 164 // IO pin. Buffer needed +#define FAN4_PIN 165 // IO pin. Buffer needed +#define FAN5_PIN 166 // IO pin. Buffer needed +#define FAN6_PIN 167 // IO pin. Buffer needed +#define FAN7_PIN 168 // IO pin. Buffer needed // // Misc. Functions // #define SDSS 53 #define LED_PIN 13 -#define NEOPIXEL_PIN 71 +#define BOARD_NEOPIXEL_PIN 71 #ifndef FILWIDTH_PIN #define FILWIDTH_PIN 5 // Analog Input on AUX2 @@ -383,9 +373,37 @@ #endif #endif -////////////////////////// -// LCDs and Controllers // -////////////////////////// +/** Faux Expansion Headers + * ------ ------ + * (BEEP) 37 | 1 2 | 35 (ENC) (MISO) 50 | 1 2 | 52 (SCK) + * (LCD_EN) 17 | 3 4 | 16 (LCD_RS) (EN1) 31 | 3 4 | 53 (SDSS) + * (LCD_D4) 23 5 6 | 25 (LCD_D5) (EN2) 33 5 6 | 51 (MOSI) + * (LCD_D6) 27 | 7 8 | 29 (LCD_D7) (SD_DET) 49 | 7 8 | 41 (KILL) + * -- | 9 10 | -- -- | 9 10 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_01_PIN 37 // BEEPER +#define EXP1_02_PIN 35 // ENC +#define EXP1_03_PIN 17 // LCD_EN +#define EXP1_04_PIN 16 // LCD_RS +#define EXP1_05_PIN 23 // LCD_D4 +#define EXP1_06_PIN 25 // LCD_D5 +#define EXP1_07_PIN 27 // LCD_D6 +#define EXP1_08_PIN 29 // LCD_D7 + +#define EXP2_01_PIN 50 // MISO +#define EXP2_02_PIN 52 // SCK +#define EXP2_03_PIN 31 // EN1 +#define EXP2_04_PIN 53 // SDSS +#define EXP2_05_PIN 33 // EN2 +#define EXP2_06_PIN 51 // MOSI +#define EXP2_07_PIN 49 // SD_DET +#define EXP2_08_PIN 41 // KILL + +// +// LCD / Controller +// #if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI) @@ -397,10 +415,11 @@ #define TFT_MOSI_PIN SD_MOSI_PIN #define LCD_USE_DMA_SPI + #define BEEPER_PIN 42 + + #define BTN_ENC 59 #define BTN_EN1 40 #define BTN_EN2 63 - #define BTN_ENC 59 - #define BEEPER_PIN 42 #define TOUCH_CS_PIN 33 @@ -485,9 +504,9 @@ // #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_EN 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock + #define LCD_PINS_RS EXP2_07_PIN // CS chip select /SS chip slave select + #define LCD_PINS_EN EXP2_06_PIN // SID (MOSI) + #define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock #elif ALL(IS_NEWPANEL, PANEL_ONE) @@ -502,12 +521,12 @@ #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS 27 - #define LCD_PINS_EN 29 - #define LCD_PINS_D4 25 + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_EN EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #if !IS_NEWPANEL - #define BEEPER_PIN 37 + #define BEEPER_PIN EXP1_01_PIN #endif #elif ENABLED(ZONESTAR_LCD) @@ -522,38 +541,28 @@ #else #if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 25 // Set as output on init - #define LCD_PINS_RS 27 // Pull low for 1s to init + #define LCD_PINS_DC EXP1_06_PIN // Set as output on init + #define LCD_PINS_RS EXP1_07_PIN // Pull low for 1s to init // DOGM SPI LCD Support - #define DOGLCD_CS 16 - #define DOGLCD_MOSI 17 - #define DOGLCD_SCK 23 + #define DOGLCD_CS EXP1_04_PIN + #define DOGLCD_MOSI EXP1_03_PIN + #define DOGLCD_SCK EXP1_05_PIN #define DOGLCD_A0 LCD_PINS_DC #else - #define LCD_PINS_RS 16 - #define LCD_PINS_EN 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN #endif - #define LCD_PINS_D7 29 + #define LCD_PINS_D7 EXP1_08_PIN #if !IS_NEWPANEL - #define BEEPER_PIN 33 + #define BEEPER_PIN EXP2_05_PIN #endif #endif - - #if !IS_NEWPANEL - // Buttons attached to a shift register - // Not wired yet - //#define SHIFT_CLK_PIN 38 - //#define SHIFT_LD_PIN 42 - //#define SHIFT_OUT_PIN 40 - //#define SHIFT_EN_PIN 17 - #endif - #endif // @@ -563,19 +572,19 @@ #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define BEEPER_PIN 37 + #define BEEPER_PIN EXP1_01_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define BTN_EN1 17 - #define BTN_EN2 23 + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN #else - #define BTN_EN1 31 - #define BTN_EN2 33 + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #endif - #define BTN_ENC 35 - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 + #define BTN_ENC EXP1_02_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #define KILL_PIN EXP2_08_PIN #if ENABLED(BQ_LCD_SMART_CONTROLLER) #define LCD_BACKLIGHT_PIN 39 @@ -625,34 +634,34 @@ #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define DOGLCD_CS 29 - #define DOGLCD_A0 27 + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN - #define BEEPER_PIN 23 - #define LCD_BACKLIGHT_PIN 33 + #define BEEPER_PIN EXP1_05_PIN + #define LCD_BACKLIGHT_PIN EXP2_05_PIN - #define BTN_EN1 35 - #define BTN_EN2 37 - #define BTN_ENC 31 + #define BTN_EN1 EXP1_02_PIN + #define BTN_EN2 EXP1_01_PIN + #define BTN_ENC EXP2_03_PIN #define LCD_SDSS SDSS - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 + #define SD_DETECT_PIN EXP2_07_PIN + #define KILL_PIN EXP2_08_PIN #elif ENABLED(MKS_MINI_12864) - #define DOGLCD_A0 27 - #define DOGLCD_CS 25 + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN - #define BEEPER_PIN 37 + #define BEEPER_PIN EXP1_01_PIN // not connected to a pin #define LCD_BACKLIGHT_PIN 65 // backlight LED on A11/D65 - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN - #define SD_DETECT_PIN 49 + #define SD_DETECT_PIN EXP2_07_PIN #define KILL_PIN 64 //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 @@ -685,7 +694,6 @@ #else - // Beeper on AUX-4 #define BEEPER_PIN 33 // Buttons are directly attached to AUX-2 @@ -701,15 +709,15 @@ #define BTN_EN2 63 // AUX2 PIN 4 #define BTN_ENC 49 // AUX3 PIN 7 #else - #define BTN_EN1 37 - #define BTN_EN2 35 - #define BTN_ENC 31 - #define SD_DETECT_PIN 41 + #define BTN_EN1 EXP1_01_PIN + #define BTN_EN2 EXP1_02_PIN + #define BTN_ENC EXP2_03_PIN + #define SD_DETECT_PIN EXP2_08_PIN #endif #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 - #define KILL_PIN 41 + #define SD_DETECT_PIN EXP2_07_PIN + #define KILL_PIN EXP2_08_PIN #endif #endif @@ -719,3 +727,7 @@ #endif // IS_NEWPANEL #endif // HAS_WIRED_LCD + +#ifndef KILL_PIN + #define KILL_PIN EXP2_08_PIN +#endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 992e6a6814..b03f77fa51 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -123,6 +123,12 @@ #define NOT_TARGET NONE #endif +#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #define CONTROLLER_WARNING(PF,CN,V...) static_assert(false, "\n\nWARNING! " CN " requires wiring modification! See pins_" PF ".h for details." V "\n (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)\n\n"); +#else + #define CONTROLLER_WARNING(...) +#endif + // // RAMPS 1.3 / 1.4 / 1.6+ - ATmega1280, ATmega2560 // @@ -224,6 +230,8 @@ #include "ramps/pins_RAMPS_CREALITY.h" // ATmega2560 env:mega2560 #elif MB(DAGOMA_F5) #include "ramps/pins_DAGOMA_F5.h" // ATmega2560 env:mega2560 +#elif MB(DAGOMA_D6) + #include "ramps/pins_DAGOMA_D6.h" // ATmega2560 env:mega2560ext #elif MB(FYSETC_F6_13) #include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6 #elif MB(FYSETC_F6_14) @@ -711,6 +719,8 @@ #include "gd32f1/pins_VOXELAB_AQUILA.h" // GD32F1, N32G4, STM32F1 env:GD32F103RC_voxelab_maple env:N32G455RE_voxelab_maple env:STM32F103RE_creality_maple env:STM32F103RE_creality #elif MB(SPRINGER_CONTROLLER) #include "stm32f1/pins_ORCA_3D_SPRINGER.h" // STM32F1 env:STM32F103VC_orca3d +#elif MB(CREALITY_CR4NS) + #include "stm32f1/pins_CREALITY_CR4NS.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_maple // // ARM Cortex-M4F @@ -813,8 +823,8 @@ #include "stm32f4/pins_FYSETC_SPIDER_KING407.h" // STM32F4 env:FYSETC_SPIDER_KING407 #elif MB(MKS_SKIPR_V1) #include "stm32f4/pins_MKS_SKIPR_V1_0.h" // STM32F4 env:mks_skipr_v1 env:mks_skipr_v1_nobootloader -#elif MB(TRONXY_V10) - #include "stm32f4/pins_TRONXY_V10.h" // STM32F4 env:STM32F446_tronxy +#elif MB(TRONXY_CXY_446_V10) + #include "stm32f4/pins_TRONXY_CXY_446_V10.h" // STM32F4 env:TRONXY_CXY_446_V10 env:TRONXY_CXY_446_V10_usb_flash_drive #elif MB(CREALITY_F401RE) #include "stm32f4/pins_CREALITY_F401.h" // STM32F4 env:STM32F401RE_creality #elif MB(BLACKPILL_CUSTOM) @@ -907,8 +917,11 @@ // // HC32 ARM Cortex-M4 // + #elif MB(AQUILA_V101) #include "hc32f4/pins_AQUILA_101.h" // HC32F460 env:HC32F460C_aquila_101 +#elif MB(CREALITY_ENDER2P_V24S4) + #include "hc32f4/pins_CREALITY_ENDER2P_V24S4.h" // HC32F460 env:HC32F460C_e2p24s4 // // Custom board (with custom PIO env) @@ -922,7 +935,7 @@ // #elif MB(SIMULATED) - #include "linux/pins_RAMPS_LINUX.h" // Native or Simulation lin:linux_native mac:simulator_macos_debug mac:simulator_macos_release win:simulator_windows lin:simulator_linux_debug lin:simulator_linux_release + #include "native/pins_RAMPS_NATIVE.h" // Native or Simulation lin:linux_native mac:simulator_macos_debug mac:simulator_macos_release win:simulator_windows lin:simulator_linux_debug lin:simulator_linux_release #else @@ -960,6 +973,7 @@ #define BOARD_LINUX_RAMPS 99926 #define BOARD_BTT_MANTA_M4P_V1_0 99927 #define BOARD_VAKE403D 99928 + #define BOARD_TRONXY_V10 99929 #if MB(MKS_13) #error "BOARD_MKS_13 is now BOARD_MKS_GEN_13. Please update your configuration." @@ -1019,6 +1033,8 @@ #error "BOARD_LINUX_RAMPS is now BOARD_SIMULATED. Please update your configuration." #elif MB(BTT_MANTA_M4P_V1_0) #error "BOARD_BTT_MANTA_M4P_V1_0 is now BOARD_BTT_MANTA_M4P_V2_1. Please update your configuration." + #elif MB(TRONXY_V10) + #error "BOARD_TRONXY_V10 is now BOARD_TRONXY_CXY_446_V10. Please update your configuration." #elif MB(VAKE403D) #error "BOARD_VAKE403D is no longer supported in Marlin." #elif defined(MOTHERBOARD) @@ -1057,10 +1073,19 @@ #undef BOARD_LINUX_RAMPS #undef BOARD_BTT_MANTA_M4P_V1_0 #undef BOARD_VAKE403D + #undef BOARD_TRONXY_V10 #endif +// +// LCD / Controller Pins based on board expansion headers with adapters +// +#include "pins_lcd.h" + // // Post-process pins according to configured settings // #include "pins_postprocess.h" + +// Cleanup +#undef CONTROLLER_WARNING diff --git a/Marlin/src/pins/pinsDebug.h b/Marlin/src/pins/pinsDebug.h index 9181a5b9da..c2735d27b8 100644 --- a/Marlin/src/pins/pinsDebug.h +++ b/Marlin/src/pins/pinsDebug.h @@ -81,7 +81,6 @@ #define REPORT_NAME_DIGITAL(COUNTER, NAME) _ADD_PIN(NAME, COUNTER, true) #define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(analogInputToDigitalPin(NAME), COUNTER, false) - typedef struct { PGM_P const name; pin_t pin; diff --git a/Marlin/src/pins/pins_lcd.h b/Marlin/src/pins/pins_lcd.h new file mode 100644 index 0000000000..e5cc880597 --- /dev/null +++ b/Marlin/src/pins/pins_lcd.h @@ -0,0 +1,45 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * pins_lcd.h - Define LCD pins based on the EXP connector / adapter + */ + +/** + * Certain displays use LCD_PINS_RS as LCD_RESET_PIN + */ +#if !defined(LCD_RESET_PIN) && ANY(MKS_12864OLED, MKS_12864OLED_SSD1306, FYSETC_242_OLED_12864, ZONESTAR_12864OLED, K3D_242_OLED_CONTROLLER) + #define LCD_RESET_PIN LCD_PINS_RS +#endif + +/** + * Make sure DOGLCD_SCK and DOGLCD_MOSI are defined. + */ +#if HAS_MARLINUI_U8GLIB + #ifndef DOGLCD_SCK + #define DOGLCD_SCK SD_SCK_PIN + #endif + #ifndef DOGLCD_MOSI + #define DOGLCD_MOSI SD_MOSI_PIN + #endif +#endif diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h index e8c77a08cd..e2db01e27e 100644 --- a/Marlin/src/pins/pins_postprocess.h +++ b/Marlin/src/pins/pins_postprocess.h @@ -519,12 +519,12 @@ #ifdef X_STOP_PIN #if X_HOME_TO_MIN #define X_MIN_PIN X_STOP_PIN - #else + #elif X_HOME_TO_MAX #define X_MAX_PIN X_STOP_PIN #endif #elif X_HOME_TO_MIN #define X_STOP_PIN X_MIN_PIN - #else + #elif X_HOME_TO_MAX #define X_STOP_PIN X_MAX_PIN #endif #if !defined(X2_STOP_PIN) && ENABLED(X_DUAL_ENDSTOPS) && PIN_EXISTS(X_STOP) @@ -536,12 +536,12 @@ #ifdef Y_STOP_PIN #if Y_HOME_TO_MIN #define Y_MIN_PIN Y_STOP_PIN - #else + #elif Y_HOME_TO_MAX #define Y_MAX_PIN Y_STOP_PIN #endif #elif Y_HOME_TO_MIN #define Y_STOP_PIN Y_MIN_PIN - #else + #elif X_HOME_TO_MAX #define Y_STOP_PIN Y_MAX_PIN #endif #if !defined(Y2_STOP_PIN) && ENABLED(Y_DUAL_ENDSTOPS) && PIN_EXISTS(Y_STOP) @@ -553,12 +553,12 @@ #ifdef Z_STOP_PIN #if Z_HOME_TO_MIN #define Z_MIN_PIN Z_STOP_PIN - #else + #elif Z_HOME_TO_MAX #define Z_MAX_PIN Z_STOP_PIN #endif #elif Z_HOME_TO_MIN #define Z_STOP_PIN Z_MIN_PIN - #else + #elif Z_HOME_TO_MAX #define Z_STOP_PIN Z_MAX_PIN #endif #if ENABLED(Z_MULTI_ENDSTOPS) && PIN_EXISTS(Z_STOP) @@ -578,12 +578,12 @@ #ifdef I_STOP_PIN #if I_HOME_TO_MIN #define I_MIN_PIN I_STOP_PIN - #else + #elif I_HOME_TO_MAX #define I_MAX_PIN I_STOP_PIN #endif #elif I_HOME_TO_MIN #define I_STOP_PIN I_MIN_PIN - #else + #elif I_HOME_TO_MAX #define I_STOP_PIN I_MAX_PIN #endif #endif @@ -592,12 +592,12 @@ #ifdef J_STOP_PIN #if J_HOME_TO_MIN #define J_MIN_PIN J_STOP_PIN - #else + #elif J_HOME_TO_MAX #define J_MAX_PIN J_STOP_PIN #endif #elif J_HOME_TO_MIN #define J_STOP_PIN J_MIN_PIN - #else + #elif J_HOME_TO_MAX #define J_STOP_PIN J_MAX_PIN #endif #endif @@ -606,12 +606,12 @@ #ifdef K_STOP_PIN #if K_HOME_TO_MIN #define K_MIN_PIN K_STOP_PIN - #else + #elif K_HOME_TO_MAX #define K_MAX_PIN K_STOP_PIN #endif #elif K_HOME_TO_MIN #define K_STOP_PIN K_MIN_PIN - #else + #elif K_HOME_TO_MAX #define K_STOP_PIN K_MAX_PIN #endif #endif @@ -620,12 +620,12 @@ #ifdef U_STOP_PIN #if U_HOME_TO_MIN #define U_MIN_PIN U_STOP_PIN - #else + #elif U_HOME_TO_MAX #define U_MAX_PIN U_STOP_PIN #endif #elif U_HOME_TO_MIN #define U_STOP_PIN U_MIN_PIN - #else + #elif U_HOME_TO_MAX #define U_STOP_PIN U_MAX_PIN #endif #endif @@ -634,12 +634,12 @@ #ifdef V_STOP_PIN #if V_HOME_TO_MIN #define V_MIN_PIN V_STOP_PIN - #else + #elif V_HOME_TO_MAX #define V_MAX_PIN V_STOP_PIN #endif #elif V_HOME_TO_MIN #define V_STOP_PIN V_MIN_PIN - #else + #elif V_HOME_TO_MAX #define V_STOP_PIN V_MAX_PIN #endif #endif @@ -648,12 +648,12 @@ #ifdef W_STOP_PIN #if W_HOME_TO_MIN #define W_MIN_PIN W_STOP_PIN - #else + #elif W_HOME_TO_MAX #define W_MAX_PIN W_STOP_PIN #endif #elif W_HOME_TO_MIN #define W_STOP_PIN W_MIN_PIN - #else + #elif W_HOME_TO_MAX #define W_STOP_PIN W_MAX_PIN #endif #endif @@ -1247,7 +1247,7 @@ #define J_STEP_PIN _EPIN(J_E_INDEX, STEP) #define J_DIR_PIN _EPIN(J_E_INDEX, DIR) #define J_ENABLE_PIN _EPIN(J_E_INDEX, ENABLE) - #if I_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(J_STEP) + #if J_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(J_STEP) #error "No E stepper plug left for J!" #else #define AUTO_ASSIGNED_J_STEPPER 1 @@ -1417,7 +1417,7 @@ #define U_STEP_PIN _EPIN(U_E_INDEX, STEP) #define U_DIR_PIN _EPIN(U_E_INDEX, DIR) #define U_ENABLE_PIN _EPIN(U_E_INDEX, ENABLE) - #if M_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(U_STEP) + #if U_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(U_STEP) #error "No E stepper plug left for U!" #else #define AUTO_ASSIGNED_U_STEPPER 1 @@ -1727,3 +1727,52 @@ #undef DIAG_REMAPPED #undef _E_DIAG_EXISTS #undef E_DIAG_EXISTS + +// Get a NeoPixel pin from the LCD or board, if provided +#ifndef NEOPIXEL_PIN + #ifdef LCD_NEOPIXEL_PIN + #define NEOPIXEL_PIN LCD_NEOPIXEL_PIN + #elif defined(BOARD_NEOPIXEL_PIN) + #define NEOPIXEL_PIN BOARD_NEOPIXEL_PIN + #endif +#endif + +// Undefine motor PWM pins for nonexistent axes since the existence of a MOTOR_CURRENT_PWM_*_PIN implies its standard use. +// TODO: Allow remapping (e.g., E => Z2). Spec G-codes to use logical axis with index (e.g., to set Z2: Mxxx Z P1 Snnn). +#if !HAS_X_AXIS + #undef MOTOR_CURRENT_PWM_X_PIN +#endif +#if !HAS_Y_AXIS + #undef MOTOR_CURRENT_PWM_Y_PIN +#endif +#if !HAS_X_AXIS && !HAS_Y_AXIS + #undef MOTOR_CURRENT_PWM_XY_PIN +#endif +#if !HAS_Z_AXIS + #undef MOTOR_CURRENT_PWM_Z_PIN +#endif +#if !HAS_I_AXIS + #undef MOTOR_CURRENT_PWM_I_PIN +#endif +#if !HAS_J_AXIS + #undef MOTOR_CURRENT_PWM_J_PIN +#endif +#if !HAS_K_AXIS + #undef MOTOR_CURRENT_PWM_K_PIN +#endif +#if !HAS_U_AXIS + #undef MOTOR_CURRENT_PWM_U_PIN +#endif +#if !HAS_V_AXIS + #undef MOTOR_CURRENT_PWM_V_PIN +#endif +#if !HAS_W_AXIS + #undef MOTOR_CURRENT_PWM_W_PIN +#endif +#if !HAS_EXTRUDERS + #undef MOTOR_CURRENT_PWM_E_PIN + #undef MOTOR_CURRENT_PWM_E0_PIN // Archim 1.0 + #undef MOTOR_CURRENT_PWM_E1_PIN // Kept in sync with E0 +#elif !HAS_MULTI_EXTRUDER + #undef MOTOR_CURRENT_PWM_E1_PIN +#endif diff --git a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h index d73092c2f6..8315de6ee3 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h @@ -23,8 +23,7 @@ /** * Einsy-Rambo pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Einsy-Rambo/Schematic%20Prints_Einsy%20Rambo_1.1a.PDF - * Origin: https://github.com/ultimachine/Einsy-Rambo/blob/1.1a/board/Project%20Outputs/Schematic%20Prints_Einsy%20Rambo_1.1a.PDF + * Schematic: https://github.com/ultimachine/Einsy-Rambo/blob/1.1a/board/Project%20Outputs/Schematic%20Prints_Einsy%20Rambo_1.1a.PDF */ #include "env_validate.h" @@ -208,6 +207,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL #define KILL_PIN 32 diff --git a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h index b4f09b7136..1f5061d4ce 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h @@ -23,10 +23,8 @@ /** * Einsy-Retro pin assignments - * Schematic (1.0b): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Einsy-Retro/Schematic%20Prints_EinsyRetro_1.0b.PDF - * Origin (1.0b): https://github.com/ultimachine/EinsyRetro/blob/master/board/Project%20Outputs/Schematic%20Prints_EinsyRetro_1.0b.PDF - * Schematic (1.0c): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Einsy-Retro/Schematic%20Prints_EinsyRetro_1.0c.PDF - * Origin (1.0c): https://github.com/ultimachine/EinsyRetro/blob/master/board/Project%20Outputs/Schematic%20Prints_EinsyRetro_1.0c.PDF + * Schematic (1.0b): https://github.com/ultimachine/EinsyRetro/blob/master/board/Project%20Outputs/Schematic%20Prints_EinsyRetro_1.0b.PDF + * Schematic (1.0c): https://github.com/ultimachine/EinsyRetro/blob/master/board/Project%20Outputs/Schematic%20Prints_EinsyRetro_1.0c.PDF */ #include "env_validate.h" @@ -169,9 +167,40 @@ #define E_MUX2_PIN 78 // 84 in MK2 Firmware, with BEEPER as 78 #endif +// +// EXP Headers +// +#define EXP1_01_PIN 84 // PH2 +#define EXP1_02_PIN 9 // PH6 +#define EXP1_03_PIN 18 // TX1 +#define EXP1_04_PIN 82 // PD5 +#define EXP1_05_PIN 19 // RX1 +#define EXP1_06_PIN 70 // PG4 +#define EXP1_07_PIN 85 // PH7 +#define EXP1_08_PIN 71 // PG3 + +#define EXP2_01_PIN 50 // MISO +#define EXP2_02_PIN 52 // SCK +#define EXP2_03_PIN 72 // PJ2 +#define EXP2_04_PIN 53 // SDSS +#define EXP2_05_PIN 14 // TX3 +#define EXP2_06_PIN 51 // MOSI +#define EXP2_07_PIN 15 // RX3 +#define EXP2_08_PIN -1 // RESET + +#define EXP3_01_PIN 62 // PK0 (A8) +#define EXP3_02_PIN 76 // PJ5 +#define EXP3_03_PIN 20 // SDA +#define EXP3_04_PIN -1 // GND +#define EXP3_05_PIN 21 // SCL +#define EXP3_06_PIN 16 // RX2 +#define EXP3_07_PIN -1 // GND +#define EXP3_08_PIN 17 // TX2 + // // LCD / Controller // + #if ANY(HAS_WIRED_LCD, TOUCH_UI_ULTIPANEL, TOUCH_UI_FTDI_EVE) #define KILL_PIN 32 @@ -179,26 +208,26 @@ #if ANY(IS_ULTIPANEL, TOUCH_UI_ULTIPANEL, TOUCH_UI_FTDI_EVE) #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS 85 - #define LCD_PINS_EN 71 - #define LCD_PINS_D4 70 - #define BTN_EN1 18 - #define BTN_EN2 19 + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_EN EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN #else - #define LCD_PINS_RS 82 - #define LCD_PINS_EN 18 // On 0.6b, use 61 - #define LCD_PINS_D4 19 // On 0.6b, use 59 - #define LCD_PINS_D5 70 - #define LCD_PINS_D6 85 - #define LCD_PINS_D7 71 - #define BTN_EN1 14 - #define BTN_EN2 72 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_EN EXP1_03_PIN // On 0.6b, use 61 + #define LCD_PINS_D4 EXP1_05_PIN // On 0.6b, use 59 + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_PIN #endif - #define BTN_ENC 9 // AUX-2 - #define BEEPER_PIN 84 // AUX-4 + #define BTN_ENC EXP1_02_PIN // AUX-2 + #define BEEPER_PIN EXP1_01_PIN // AUX-4 - #define SD_DETECT_PIN 15 + #define SD_DETECT_PIN EXP2_07_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder diff --git a/Marlin/src/pins/rambo/pins_MINIRAMBO.h b/Marlin/src/pins/rambo/pins_MINIRAMBO.h index a7b8c8466b..18f73a81d5 100644 --- a/Marlin/src/pins/rambo/pins_MINIRAMBO.h +++ b/Marlin/src/pins/rambo/pins_MINIRAMBO.h @@ -23,18 +23,18 @@ /** * Mini-RAMBo pin assignments - * Schematic (1.3a): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Mini%20RAMBo/Mini-Rambo.PDF - * Origin (1.3a): https://github.com/ultimachine/Mini-Rambo/blob/1.3a/board/Project%20Outputs%20for%20Mini-Rambo/Mini-Rambo.PDF - * Schematic (1.0a): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Mini%20RAMBo%201.0a/Mini-Rambo.PDF - * Origin (1.0a): https://github.com/ultimachine/Mini-Rambo/blob/v1.1b/board/Project%20Outputs%20for%20Mini-Rambo/Mini-Rambo.PDF + * Schematic (1.3a): https://github.com/ultimachine/Mini-Rambo/blob/1.3a/board/Project%20Outputs%20for%20Mini-Rambo/Mini-Rambo.PDF + * Schematic (1.0a): https://github.com/ultimachine/Mini-Rambo/blob/v1.1b/board/Project%20Outputs%20for%20Mini-Rambo/Mini-Rambo.PDF */ #include "env_validate.h" -#if MB(MINIRAMBO_10A) - #define BOARD_INFO_NAME "Mini RAMBo 1.0a" -#else - #define BOARD_INFO_NAME "Mini RAMBo" +#ifndef BOARD_INFO_NAME + #if MB(MINIRAMBO_10A) + #define BOARD_INFO_NAME "Mini RAMBo 1.0a" + #else + #define BOARD_INFO_NAME "Mini RAMBo" + #endif #endif // @@ -47,6 +47,10 @@ #define Z_MIN_PIN 10 #define Z_MAX_PIN 23 +#if HAS_I_AXIS + #define I_STOP_PIN 30 // X_MAX (for now) +#endif + // // Z Probe (when not Z_MIN_PIN) // @@ -128,9 +132,15 @@ // #if HAS_CUTTER // Use P1 connector for spindle pins - #define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM - #define SPINDLE_LASER_ENA_PIN 18 // Pullup! - #define SPINDLE_DIR_PIN 19 + #ifndef SPINDLE_LASER_PWM_PIN + #define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM + #endif + #ifndef SPINDLE_LASER_ENA_PIN + #define SPINDLE_LASER_ENA_PIN 18 // Pullup! + #endif + #ifndef SPINDLE_DIR_PIN + #define SPINDLE_DIR_PIN 19 + #endif #endif // @@ -147,6 +157,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL #if !MB(MINIRAMBO_10A) diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index 494ea547f2..7e46b17151 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -39,8 +39,7 @@ /** * Rambo pin assignments - * Schematic (1.1b): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMBo/Rambo1-1-schematic.png - * Origin (1.1b): https://www.reprap.org/wiki/File:Rambo1-1-schematic.png + * Schematic (1.1b): https://www.reprap.org/wiki/File:Rambo1-1-schematic.png */ #include "env_validate.h" @@ -199,6 +198,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL #define KILL_PIN 80 diff --git a/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h index 2d419e1321..de4b3cfeb9 100644 --- a/Marlin/src/pins/ramps/pins_3DRAG.h +++ b/Marlin/src/pins/ramps/pins_3DRAG.h @@ -24,8 +24,7 @@ /** * 3DRAG (and K8200 / K8400) Arduino Mega with RAMPS v1.4 pin assignments * This may be compatible with the standalone Controller variant. - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/3DRAG%20+%20Controller/Schema_base.jpg - * Origin: https://reprap.org/wiki/File:Schema_base.jpg + * Schematic: https://reprap.org/wiki/File:Schema_base.jpg * ATmega2560, ATmega1280 */ @@ -131,6 +130,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD && IS_NEWPANEL #undef BEEPER_PIN diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h index 17581dca62..39c25a7fd1 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h @@ -23,8 +23,7 @@ /** * AZTEEG_X3 Arduino Mega with RAMPS v1.4 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/AZTEEG_X3/AZTEEG%20X3%20PUB%20v1.12.pdf - * Origin: http://files.panucatt.com/datasheets/azteegx3_designfiles.zip + * Schematic: http://files.panucatt.com/datasheets/azteegx3_designfiles.zip * ATmega2560 */ diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h index ddd56b28e8..76a29930b0 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h @@ -23,8 +23,7 @@ /** * AZTEEG_X3_PRO (Arduino Mega) pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/AZTEEG_X3_PRO/AZTEEG%20X3%20PRO%201.0%20PUB.pdf - * Origin: http://files.panucatt.com/datasheets/x3pro_sch_v1.0.zip + * Schematic: http://files.panucatt.com/datasheets/x3pro_sch_v1.0.zip * ATmega2560 */ diff --git a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h index cf237fb9c1..4f4e31f9a1 100644 --- a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h +++ b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h @@ -23,8 +23,7 @@ /** * BAM&DICE Due (Arduino Mega) pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BAM&DICE%20Due/2PRINTBETA-BAM&DICE-DUE-V1.1-sch.pdf - * Origin: http://www.2printbeta.de/download/2PRINTBETA-BAM&DICE-DUE-V1.1-sch.pdf + * Schematic: http://www.2printbeta.de/download/2PRINTBETA-BAM&DICE-DUE-V1.1-sch.pdf * ATmega2560, ATmega1280 */ diff --git a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h index 08d4492ccb..fb6689c0ce 100644 --- a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h +++ b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h @@ -23,8 +23,7 @@ /** * bq ZUM Mega 3D board definition - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/bq%20ZUM%20Mega%203D/Zum%20Mega%203D.PDF - * Origin: https://github.com/bq/zum/blob/master/zum-mega3d/Zum%20Mega%203D.PDF + * Schematic: https://github.com/bq/zum/blob/master/zum-mega3d/Zum%20Mega%203D.PDF * ATmega2560 */ diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_D6.h b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h new file mode 100644 index 0000000000..2a89647376 --- /dev/null +++ b/Marlin/src/pins/ramps/pins_DAGOMA_D6.h @@ -0,0 +1,119 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "Dagoma3D D6 supports up to 2 hotends / E-steppers." +#endif + +#define BOARD_INFO_NAME "Dagoma3D D6" + +// +// Trinamic Stallguard pins +// +#define X_DIAG_PIN 43 +#define Y_DIAG_PIN 41 +#define Z_DIAG_PIN 47 +#define E0_DIAG_PIN 21 +#define E1_DIAG_PIN 20 + +// +// Endstops +// +#define X_STOP_PIN 2 +#define Y_STOP_PIN 3 +#define Z_STOP_PIN 15 + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 39 +#endif +#if EXTRUDERS > 1 && !defined(FIL_RUNOUT2_PIN) + #define FIL_RUNOUT2_PIN 14 +#endif + +// Alter timing for graphical display +#if IS_U8GLIB_ST7920 + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 0 + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 250 + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 250 + #endif +#endif + +#define KILL_PIN -1 // NC + +#define LCD_CONTRAST_DEFAULT 255 + +// +// Sensorless homing DIAG pin is not directly connected to the MCU. Close +// the jumper next to the limit switch socket when using sensorless homing. +// +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + */ + #define X_SERIAL_RX_PIN 73 + #define X_SERIAL_TX_PIN 73 + #define Y_SERIAL_RX_PIN 73 + #define Y_SERIAL_TX_PIN 73 + #define Z_SERIAL_RX_PIN 73 + #define Z_SERIAL_TX_PIN 73 + #define E0_SERIAL_RX_PIN 73 + #define E0_SERIAL_TX_PIN 73 + #define E1_SERIAL_RX_PIN 12 + #define E1_SERIAL_TX_PIN 12 + + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 1 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 2 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif + #ifndef E1_SLAVE_ADDRESS + #define E1_SLAVE_ADDRESS 3 + #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_DAGOMA_D6."); + static_assert(Y_SLAVE_ADDRESS == 1, "Y_SLAVE_ADDRESS must be 1 for BOARD_DAGOMA_D6."); + static_assert(Z_SLAVE_ADDRESS == 2, "Z_SLAVE_ADDRESS must be 2 for BOARD_DAGOMA_D6."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_DAGOMA_D6."); + static_assert(E1_SLAVE_ADDRESS == 3, "E1_SLAVE_ADDRESS must be 3 for BOARD_DAGOMA_D6."); + +#endif + +// +// Import default RAMPS 1.4 pins +// +#include "pins_RAMPS.h" diff --git a/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h index 90f46fe386..83045bdfe0 100644 --- a/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h +++ b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h @@ -85,8 +85,9 @@ #define SD_SCK_PIN 52 // PB1 // -// LCDs and Controllers +// LCD / Controller // + #if HAS_WIRED_LCD #if ENABLED(ZONESTAR_LCD) #define LCD_PINS_RS 2 diff --git a/Marlin/src/pins/ramps/pins_FELIX2.h b/Marlin/src/pins/ramps/pins_FELIX2.h index 34bd29d19f..746de8581a 100644 --- a/Marlin/src/pins/ramps/pins_FELIX2.h +++ b/Marlin/src/pins/ramps/pins_FELIX2.h @@ -49,6 +49,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD && IS_NEWPANEL #define SD_DETECT_PIN 6 diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 824dbd9f2d..59c4c79884 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -23,8 +23,7 @@ // // FYSETC F6 1.3 (and 1.4) pin assignments -// Schematic (1.3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/FYSETC%20F6%201.3/F6_V13.pdf -// Origin: https://github.com/FYSETC/FYSETC-F6/blob/master/Hardware/V1.3/F6_V13.pdf +// Schematic: https://github.com/FYSETC/FYSETC-F6/blob/master/Hardware/V1.3/F6_V13.pdf // ATmega2560 // @@ -192,7 +191,6 @@ // // Misc. Functions // -#define SDSS 53 #define LED_PIN 13 #define KILL_PIN 41 @@ -201,80 +199,104 @@ #endif /** - * ----- ----- - * 5V/D41 | · · | GND 5V | · · | GND - * RESET | · · | D49 (SD_DETECT) (LCD_D7) D29 | · · | D27 (LCD_D6) - * (MOSI) D51 | · · D33 (BTN_EN2) (LCD_D5) D25 | · · D23 (LCD_D4) - * (SD_SS) D53 | · · | D31 (BTN_EN1) (LCD_RS) D16 | · · | D17 (LCD_EN) - * (SCK) D52 | · · | D50 (MISO) (BTN_ENC) D35 | · · | D37 (BEEPER) - * ----- ----- - * EXP2 EXP1 + * ------ ------ + * (BEEPER) D37 | 1 2 | D35 (BTN_ENC) (MISO) D50 | 1 2 | D52 (SCK) + * (LCD_EN) D17 | 3 4 | D16 (LCD_RS) (BTN_EN1) D31 | 3 4 | D53 (SD_SS) + * (LCD_D4) D23 5 6 | D25 (LCD_D5) (BTN_EN2) D33 5 6 | D51 (MOSI) + * (LCD_D6) D27 | 7 8 | D29 (LCD_D7) (SD_DETECT) D49 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | 5V / D41 + * ------ ------ + * EXP1 EXP2 */ +#define EXP1_01_PIN 37 // BEEPER +#define EXP1_02_PIN 35 // ENC +#define EXP1_03_PIN 17 // LCD_EN +#define EXP1_04_PIN 16 // LCD_RS +#define EXP1_05_PIN 23 // LCD_D4 +#define EXP1_06_PIN 25 // LCD_D5 +#define EXP1_07_PIN 27 // LCD_D6 +#define EXP1_08_PIN 29 // LCD_D7 + +#define EXP2_01_PIN 50 // MISO +#define EXP2_02_PIN 52 // SCK +#define EXP2_03_PIN 31 // EN1 +#define EXP2_04_PIN 53 // SD_SS +#define EXP2_05_PIN 33 // EN2 +#define EXP2_06_PIN 51 // MOSI +#define EXP2_07_PIN 49 // SD_DETECT +#define EXP2_08_PIN -1 // RESET + // -// LCDs and Controllers +// SD Card +// + +#define SDSS EXP2_04_PIN +#define SD_DETECT_PIN EXP2_07_PIN + +// +// LCD / Controller // -#define SD_DETECT_PIN 49 #if ENABLED(FYSETC_242_OLED_12864) - #define BTN_EN1 37 - #define BTN_EN2 29 - #define BTN_ENC 35 - #define BEEPER_PIN 31 + #define BTN_EN1 EXP1_01_PIN + #define BTN_EN2 EXP1_08_PIN + #define BTN_ENC EXP1_02_PIN + #define BEEPER_PIN EXP2_03_PIN - #define LCD_PINS_DC 25 - #define LCD_PINS_RS 33 - #define DOGLCD_CS 16 - #define DOGLCD_MOSI 23 - #define DOGLCD_SCK 17 + #define LCD_PINS_DC EXP1_06_PIN + #define LCD_PINS_RS EXP2_05_PIN + #define DOGLCD_CS EXP1_04_PIN + #define DOGLCD_MOSI EXP1_05_PIN + #define DOGLCD_SCK EXP1_03_PIN #define DOGLCD_A0 LCD_PINS_DC #undef KILL_PIN - #define NEOPIXEL_PIN 27 + #define BOARD_NEOPIXEL_PIN EXP1_07_PIN #else - #define BEEPER_PIN 37 + #define BEEPER_PIN EXP1_01_PIN #if ENABLED(FYSETC_MINI_12864) // // See https://wiki.fysetc.com/Mini12864_Panel/ // - #define DOGLCD_A0 16 - #define DOGLCD_CS 17 + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_03_PIN #if ENABLED(FYSETC_GENERIC_12864_1_1) - #define LCD_BACKLIGHT_PIN 27 + #define LCD_BACKLIGHT_PIN EXP1_07_PIN #endif - #define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally. - // Seems to work best if left open. + #define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally. + // Seems to work best if left open. #if ANY(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 HAS_MARLINUI_U8GLIB || HAS_MARLINUI_HD44780 - #define LCD_PINS_RS 16 - #define LCD_PINS_EN 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 - #define LCD_PINS_D7 29 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_EN EXP1_03_PIN + #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(MKS_MINI_12864) - #define DOGLCD_CS 25 - #define DOGLCD_A0 27 + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_A0 EXP1_07_PIN #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) @@ -284,9 +306,9 @@ #endif #if IS_NEWPANEL - #define BTN_EN1 31 - #define BTN_EN2 33 - #define BTN_ENC 35 + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN #endif #endif diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h index 9604d0ecbf..5fdaa19419 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h @@ -23,8 +23,7 @@ // // FYSETC F6 v1.4 pin assignments -// Schematic (1.4): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/FYSETC%20F6%20v1.4/F6%20V1.4%20Sch.pdf -// Origin (1.4): https://github.com/FYSETC/FYSETC-F6/blob/master/Hardware/V1.4/F6%20V1.4%20Sch.pdf +// Schematic (1.4): https://github.com/FYSETC/FYSETC-F6/blob/master/Hardware/V1.4/F6%20V1.4%20Sch.pdf // ATmega2560 // diff --git a/Marlin/src/pins/ramps/pins_K8200.h b/Marlin/src/pins/ramps/pins_K8200.h index d2557b26c3..b6bed2dc55 100644 --- a/Marlin/src/pins/ramps/pins_K8200.h +++ b/Marlin/src/pins/ramps/pins_K8200.h @@ -24,8 +24,7 @@ /** * K8200 Arduino Mega with RAMPS v1.3 pin assignments * Identical to 3DRAG - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Velleman%20K8200/K8200diagram.jpg - * Origin: https://www.velleman.eu/images/tmp/K8200diagram.jpg + * Schematic: https://www.velleman.eu/images/tmp/K8200diagram.jpg * ATmega2560 */ diff --git a/Marlin/src/pins/ramps/pins_K8400.h b/Marlin/src/pins/ramps/pins_K8400.h index abcffe484d..31912064d0 100644 --- a/Marlin/src/pins/ramps/pins_K8400.h +++ b/Marlin/src/pins/ramps/pins_K8400.h @@ -24,8 +24,7 @@ /** * Velleman K8400 (Vertex) * 3DRAG clone - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Velleman%20K8400/k8400-schema-electronique.jpg - * Origin: https://filimprimante3d.fr/documents/k8400-schema-electronique.jpg + * Schematic: https://filimprimante3d.fr/documents/k8400-schema-electronique.jpg * ATmega2560, ATmega1280 * * K8400 has some minor differences over a normal 3Drag: @@ -58,7 +57,7 @@ // #define FAN0_PIN 8 -#if ANY(BLTOUCH, TOUCH_MI_PROBE) +#if ANY(BLTOUCH, TOUCH_MI_PROBE, BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2) #define INVERTED_PROBE_STATE #endif diff --git a/Marlin/src/pins/ramps/pins_K8600.h b/Marlin/src/pins/ramps/pins_K8600.h index eacaf95b38..170401bf1c 100644 --- a/Marlin/src/pins/ramps/pins_K8600.h +++ b/Marlin/src/pins/ramps/pins_K8600.h @@ -60,6 +60,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD && IS_NEWPANEL #define LCD_PINS_RS 27 diff --git a/Marlin/src/pins/ramps/pins_K8800.h b/Marlin/src/pins/ramps/pins_K8800.h index 826e1b206a..1f477300de 100644 --- a/Marlin/src/pins/ramps/pins_K8800.h +++ b/Marlin/src/pins/ramps/pins_K8800.h @@ -23,8 +23,7 @@ /** * Velleman K8800 (Vertex) - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Velleman%20K8800/K8800-schematic-V1.4.pdf - * Origin: https://www.velleman.eu/downloads/files/vertex-delta/schematics/K8800-schematic-V1.4.pdf + * Schematic: https://www.velleman.eu/downloads/files/vertex-delta/schematics/K8800-schematic-V1.4.pdf * ATmega2560, ATmega1280 */ diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_10.h b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h index 8d46ac36fa..3d58d8ba91 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_10.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h @@ -24,10 +24,7 @@ /** * MKS BASE 1.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments * Schematics: - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20BASE%201.0/PAGE1.pdf - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20BASE%201.0/PAGE2.pdf - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20BASE%201.0/PAGE3.pdf - * Origin: https://reprap.org/wiki/File:MKS_Base_V1.0_source.zip + * Schematic: https://reprap.org/wiki/File:MKS_Base_V1.0_source.zip * ATmega2560 * * Rev B - Override pin definitions for CASE_LIGHT and M3/M4/M5 spindle control diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h index bb6def5ca4..e579749311 100644 --- a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h +++ b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h @@ -23,8 +23,7 @@ /** * MKS BASE v1.6 with A4982 stepper drivers and digital micro-stepping - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20BASE%201.6/MKS%20Base%20V1.6_004%20SCH.pdf - * Origin: https://github.com/makerbase-mks/MKS-BASE/blob/master/hardware/MKS%20Base%20V1.6_004/MKS%20Base%20V1.6_004%20SCH.pdf + * Schematic: https://github.com/makerbase-mks/MKS-BASE/blob/master/hardware/MKS%20Base%20V1.6_004/MKS%20Base%20V1.6_004%20SCH.pdf * ATmega2560 */ diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h index 9afdc62a53..5797424c66 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h @@ -23,8 +23,7 @@ /** * Arduino Mega with RAMPS v1.4 adjusted pin assignments - * Schematic (1.4): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20GEN%20v1.4/MKS%20GEN%20V1.4_004%20SCH.pdf - * Origin (1.4): https://github.com/makerbase-mks/MKS-GEN/blob/master/hardware/MKS%20GEN%20V1.4_004/MKS%20GEN%20V1.4_004%20SCH.pdf + * Schematic (1.4): https://github.com/makerbase-mks/MKS-GEN/blob/master/hardware/MKS%20GEN%20V1.4_004/MKS%20GEN%20V1.4_004%20SCH.pdf * ATmega2560, ATmega1280 * * MKS GEN v1.3 (Extruder, Fan, Bed) @@ -63,6 +62,7 @@ // // LCD / Controller // + #if ANY(VIKI2, miniVIKI) /** * VIKI2 Has two groups of wires with... diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h index 73e7aa577d..dfd8736c81 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h @@ -23,8 +23,7 @@ /** * MKS GEN L – Arduino Mega2560 with RAMPS v1.4 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20GEN%20L%20v1.0/MKS%20Gen_L%20V1.0_008%20SCH.pdf - * Origin: https://github.com/makerbase-mks/MKS-GEN_L/blob/master/hardware/MKS%20Gen_L%20V1.0_008/MKS%20Gen_L%20V1.0_008%20SCH.pdf + * Schematic: https://github.com/makerbase-mks/MKS-GEN_L/blob/master/hardware/MKS%20Gen_L%20V1.0_008/MKS%20Gen_L%20V1.0_008%20SCH.pdf * ATmega2560, ATmega1280 */ 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 931843de7c..54c7393266 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h @@ -23,8 +23,7 @@ /** * MKS GEN L V2 – Arduino Mega2560 with RAMPS v1.4 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20GEN%20L%20V2.0/MKS%20Gen_L%20V2.0_001%20SCH.pdf - * Origin: https://github.com/makerbase-mks/MKS-GEN_L/blob/master/hardware/MKS%20Gen_L%20V2.0_001/MKS%20Gen_L%20V2.0_001%20SCH.pdf + * Schematic: https://github.com/makerbase-mks/MKS-GEN_L/blob/master/hardware/MKS%20Gen_L%20V2.0_001/MKS%20Gen_L%20V2.0_001%20SCH.pdf * ATmega2560 */ 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 6cea92c15b..594be3c5df 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h @@ -23,8 +23,7 @@ /** * MKS GEN L V2 – Arduino Mega2560 with RAMPS v1.4 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20GEN%20L%20V2.1/MKS%20GEN_L%20V2.1_001%20SCH.pdf - * Origin: https://github.com/makerbase-mks/MKS-GEN_L/blob/master/hardware/MKS%20Gen_L%20V2.1_001/MKS%20GEN_L%20V2.1_001%20SCH.pdf + * Schematic: https://github.com/makerbase-mks/MKS-GEN_L/blob/master/hardware/MKS%20Gen_L%20V2.1_001/MKS%20GEN_L%20V2.1_001%20SCH.pdf * ATmega2560 */ diff --git a/Marlin/src/pins/ramps/pins_ORTUR_4.h b/Marlin/src/pins/ramps/pins_ORTUR_4.h index d2adf9971c..e8a87911d1 100644 --- a/Marlin/src/pins/ramps/pins_ORTUR_4.h +++ b/Marlin/src/pins/ramps/pins_ORTUR_4.h @@ -79,6 +79,7 @@ // // LCD / Controller // + #if IS_RRD_FG_SC #define BEEPER_PIN 35 diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 08c059477b..7c641c992d 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -142,18 +142,18 @@ // // Steppers // -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 +#define X_STEP_PIN 54 // (A0) +#define X_DIR_PIN 55 // (A1) #define X_ENABLE_PIN 38 #ifndef X_CS_PIN - #define X_CS_PIN 53 + #define X_CS_PIN AUX3_06 #endif #define Y_STEP_PIN 60 #define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 +#define Y_ENABLE_PIN 56 // (A2) #ifndef Y_CS_PIN - #define Y_CS_PIN 49 + #define Y_CS_PIN AUX3_02 #endif #ifndef Z_STEP_PIN @@ -166,7 +166,7 @@ #define Z_ENABLE_PIN 62 #endif #ifndef Z_CS_PIN - #define Z_CS_PIN 40 + #define Z_CS_PIN AUX2_06 #endif #ifndef E0_STEP_PIN @@ -179,7 +179,7 @@ #define E0_ENABLE_PIN 24 #endif #ifndef E0_CS_PIN - #define E0_CS_PIN 42 + #define E0_CS_PIN AUX2_08 #endif #ifndef E1_STEP_PIN @@ -192,7 +192,7 @@ #define E1_ENABLE_PIN 30 #endif #ifndef E1_CS_PIN - #define E1_CS_PIN 44 + #define E1_CS_PIN AUX2_07 #endif // @@ -212,7 +212,7 @@ // SPI for MAX Thermocouple // #ifndef TEMP_0_CS_PIN - #define TEMP_0_CS_PIN 66 // Don't use 53 if using Display/SD card (SDSS) or 49 (SD_DETECT_PIN) + #define TEMP_0_CS_PIN AUX2_09 // Don't use 53 if using Display/SD card (SDSS) or 49 (SD_DETECT_PIN) #endif // @@ -245,7 +245,9 @@ #define HEATER_BED_PIN MOSFET_C_PIN #endif #elif FET_ORDER_EFF // Hotend, Fan, Fan - #define FAN1_PIN MOSFET_C_PIN + #ifndef FAN1_PIN + #define FAN1_PIN MOSFET_C_PIN + #endif #elif DISABLED(FET_ORDER_SF) // Not Spindle, Fan (i.e., "EFBF" or "EFBE") #ifndef HEATER_BED_PIN #define HEATER_BED_PIN MOSFET_C_PIN @@ -273,12 +275,12 @@ // Misc. Functions // #ifndef SDSS - #define SDSS AUX3_06_PIN + #define SDSS AUX3_06 #endif #define LED_PIN 13 #ifndef FILWIDTH_PIN - #define FILWIDTH_PIN 5 // Analog Input on AUX2 + #define FILWIDTH_PIN 5 // (A5) Analog Input AUX2_03 #endif // RAMPS 1.4 DIO 4 on the servos connector @@ -294,7 +296,7 @@ #if NUM_SERVOS <= 1 // Prefer the servo connector #define CASE_LIGHT_PIN 6 // Hardware PWM #elif HAS_FREE_AUX2_PINS - #define CASE_LIGHT_PIN 44 // Hardware PWM + #define CASE_LIGHT_PIN AUX2_07 // Hardware PWM #endif #endif @@ -303,32 +305,44 @@ // #if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN) #if NUM_SERVOS < 2 // Use servo connector if possible - #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! #ifndef SPINDLE_LASER_PWM_PIN #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM #endif + #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! #define SPINDLE_DIR_PIN 5 #elif HAS_FREE_AUX2_PINS - #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM - #define SPINDLE_LASER_ENA_PIN 40 // Pullup or pulldown! - #define SPINDLE_DIR_PIN 65 + #define SPINDLE_LASER_PWM_PIN AUX2_07 // Hardware PWM + #define SPINDLE_LASER_ENA_PIN AUX2_06 // Pullup or pulldown! + #define SPINDLE_DIR_PIN AUX2_10 #else #error "No auto-assignable Spindle/Laser pins available." #endif #endif // -// TMC software SPI +// TMC SPI // #if HAS_TMC_SPI - #ifndef TMC_SPI_MOSI - #define TMC_SPI_MOSI 66 - #endif - #ifndef TMC_SPI_MISO - #define TMC_SPI_MISO 44 - #endif - #ifndef TMC_SPI_SCK - #define TMC_SPI_SCK 64 + #if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SPI_MOSI + #define TMC_SPI_MOSI AUX2_09 + #endif + #ifndef TMC_SPI_MISO + #define TMC_SPI_MISO AUX2_07 + #endif + #ifndef TMC_SPI_SCK + #define TMC_SPI_SCK AUX2_05 + #endif + #else + #ifndef TMC_SPI_MOSI + #define TMC_SPI_MOSI AUX3_04 + #endif + #ifndef TMC_SPI_MISO + #define TMC_SPI_MISO AUX3_03 + #endif + #ifndef TMC_SPI_SCK + #define TMC_SPI_SCK AUX3_05 + #endif #endif #endif @@ -356,10 +370,10 @@ //#define E4_HARDWARE_SERIAL Serial1 #ifndef X_SERIAL_TX_PIN - #define X_SERIAL_TX_PIN 40 + #define X_SERIAL_TX_PIN AUX2_06 #endif #ifndef X_SERIAL_RX_PIN - #define X_SERIAL_RX_PIN 63 + #define X_SERIAL_RX_PIN AUX2_04 #endif #ifndef X2_SERIAL_TX_PIN #define X2_SERIAL_TX_PIN -1 @@ -369,10 +383,10 @@ #endif #ifndef Y_SERIAL_TX_PIN - #define Y_SERIAL_TX_PIN 59 + #define Y_SERIAL_TX_PIN AUX2_03 #endif #ifndef Y_SERIAL_RX_PIN - #define Y_SERIAL_RX_PIN 64 + #define Y_SERIAL_RX_PIN AUX2_05 #endif #ifndef Y2_SERIAL_TX_PIN #define Y2_SERIAL_TX_PIN -1 @@ -382,10 +396,10 @@ #endif #ifndef Z_SERIAL_TX_PIN - #define Z_SERIAL_TX_PIN 42 + #define Z_SERIAL_TX_PIN AUX2_08 #endif #ifndef Z_SERIAL_RX_PIN - #define Z_SERIAL_RX_PIN 65 + #define Z_SERIAL_RX_PIN AUX2_10 #endif #ifndef Z2_SERIAL_TX_PIN #define Z2_SERIAL_TX_PIN -1 @@ -395,10 +409,10 @@ #endif #ifndef E0_SERIAL_TX_PIN - #define E0_SERIAL_TX_PIN 44 + #define E0_SERIAL_TX_PIN AUX2_07 #endif #ifndef E0_SERIAL_RX_PIN - #define E0_SERIAL_RX_PIN 66 + #define E0_SERIAL_RX_PIN AUX2_09 #endif #ifndef E1_SERIAL_TX_PIN #define E1_SERIAL_TX_PIN -1 @@ -449,13 +463,13 @@ // #if HAS_PRUSA_MMU1 #ifndef E_MUX0_PIN - #define E_MUX0_PIN 40 // Z_CS_PIN + #define E_MUX0_PIN AUX2_06 // Z_CS_PIN #endif #ifndef E_MUX1_PIN - #define E_MUX1_PIN 42 // E0_CS_PIN + #define E_MUX1_PIN AUX2_08 // E0_CS_PIN #endif #ifndef E_MUX2_PIN - #define E_MUX2_PIN 44 // E1_CS_PIN + #define E_MUX2_PIN AUX2_07 // E1_CS_PIN #endif #endif @@ -465,10 +479,10 @@ // 1 3 5 7 // 5V GND A3 A4 // -#define AUX1_05_PIN 57 // (A3) -#define AUX1_06_PIN 2 -#define AUX1_07_PIN 58 // (A4) -#define AUX1_08_PIN 1 +#define AUX1_05 57 // (A3) +#define AUX1_06 2 +#define AUX1_07 58 // (A4) +#define AUX1_08 1 // // AUX2 GND A9 D40 D42 A11 @@ -476,14 +490,14 @@ // 1 3 5 7 9 // VCC A5 A10 D44 A12 // -#define AUX2_03_PIN 59 // (A5) -#define AUX2_04_PIN 63 // (A9) -#define AUX2_05_PIN 64 // (A10) -#define AUX2_06_PIN 40 -#define AUX2_07_PIN 44 -#define AUX2_08_PIN 42 -#define AUX2_09_PIN 66 // (A12) -#define AUX2_10_PIN 65 // (A11) +#define AUX2_03 59 // (A5) +#define AUX2_04 63 // (A9) +#define AUX2_05 64 // (A10) +#define AUX2_06 40 +#define AUX2_07 44 +#define AUX2_08 42 +#define AUX2_09 66 // (A12) +#define AUX2_10 65 // (A11) // // AUX3 GND D52 D50 5V @@ -491,31 +505,31 @@ // 8 6 4 2 // NC D53 D51 D49 // -#define AUX3_02_PIN 49 -#define AUX3_03_PIN 50 -#define AUX3_04_PIN 51 -#define AUX3_05_PIN 52 -#define AUX3_06_PIN 53 +#define AUX3_02 49 +#define AUX3_03 50 +#define AUX3_04 51 +#define AUX3_05 52 +#define AUX3_06 53 // // AUX4 5V GND D32 D47 D45 D43 D41 D39 D37 D35 D33 D31 D29 D27 D25 D23 D17 D16 // -#define AUX4_03_PIN 32 -#define AUX4_04_PIN 47 -#define AUX4_05_PIN 45 -#define AUX4_06_PIN 43 -#define AUX4_07_PIN 41 -#define AUX4_08_PIN 39 -#define AUX4_09_PIN 37 -#define AUX4_10_PIN 35 -#define AUX4_11_PIN 33 -#define AUX4_12_PIN 31 -#define AUX4_13_PIN 29 -#define AUX4_14_PIN 27 -#define AUX4_15_PIN 25 -#define AUX4_16_PIN 23 -#define AUX4_17_PIN 17 -#define AUX4_18_PIN 16 +#define AUX4_03 32 +#define AUX4_04 47 +#define AUX4_05 45 +#define AUX4_06 43 +#define AUX4_07 41 +#define AUX4_08 39 +#define AUX4_09 37 +#define AUX4_10 35 +#define AUX4_11 33 +#define AUX4_12 31 +#define AUX4_13 29 +#define AUX4_14 27 +#define AUX4_15 25 +#define AUX4_16 23 +#define AUX4_17 17 +#define AUX4_18 16 /** * LCD adapters come in different variants. The socket keys can be @@ -523,71 +537,75 @@ */ #ifndef EXP1_08_PIN - #define EXP1_03_PIN AUX4_17_PIN - #define EXP1_04_PIN AUX4_18_PIN - #define EXP1_05_PIN AUX4_16_PIN - #define EXP1_06_PIN AUX4_15_PIN - #define EXP1_07_PIN AUX4_14_PIN - #define EXP1_08_PIN AUX4_13_PIN + #define EXP1_03_PIN AUX4_17 // 17 + #define EXP1_04_PIN AUX4_18 // 16 + #define EXP1_05_PIN AUX4_16 // 23 + #define EXP1_06_PIN AUX4_15 // 25 + #define EXP1_07_PIN AUX4_14 // 27 + #define EXP1_08_PIN AUX4_13 // 29 - #define EXP2_01_PIN AUX3_03_PIN - #define EXP2_02_PIN AUX3_05_PIN - #define EXP2_04_PIN AUX3_06_PIN - #define EXP2_06_PIN AUX3_04_PIN - #define EXP2_07_PIN AUX3_02_PIN + #define EXP2_01_PIN AUX3_03 // 50 (MISO) + #define EXP2_02_PIN AUX3_05 // 52 + #define EXP2_04_PIN AUX3_06 // 53 + #define EXP2_06_PIN AUX3_04 // 51 + #define EXP2_07_PIN AUX3_02 // 49 #if ENABLED(G3D_PANEL) /** Gadgets3D Smart Adapter - * ------ ------ - * 4-11 | 1 2 | 4-12 (MISO) 3-03 | 1 2 | 3-05 (SCK) - * 4-17 | 3 4 | 4-18 4-10 | 3 4 | 3-06 - * 4-16 5 6 | 4-15 4-09 5 6 | 3-04 (MOSI) - * 4-14 | 7 8 | 4-13 3-02 | 7 8 | 4-07 - * (GND) 4-02 | 9 10 | 4-01 (5V) -- | 9 10 | -- - * ------ ------ - * EXP1 EXP2 + * ------ ------ + * 33 4-11 | 1 2 | 4-12 31 (MISO) 50 3-03 | 1 2 | 3-05 52 (SCK) + * 17 4-17 | 3 4 | 4-18 16 35 4-10 | 3 4 | 3-06 53 + * 23 4-16 5 6 | 4-15 25 37 4-09 5 6 | 3-04 51 (MOSI) + * 27 4-14 | 7 8 | 4-13 29 49 3-02 | 7 8 | 4-07 41 + * (GND) 4-02 | 9 10 | 4-01 (5V) -- | 9 10 | -- + * ------ ------ + * EXP1 EXP2 */ - #define EXP1_01_PIN AUX4_11_PIN - #define EXP1_02_PIN AUX4_12_PIN + #define EXP1_01_PIN AUX4_11 // 33 + #define EXP1_02_PIN AUX4_12 // 31 - #define EXP2_03_PIN AUX4_10_PIN - #define EXP2_05_PIN AUX4_09_PIN - #define EXP2_08_PIN AUX4_07_PIN + #define EXP2_03_PIN AUX4_10 // 35 + #define EXP2_05_PIN AUX4_09 // 37 + #define EXP2_08_PIN AUX4_07 // 41 #else /** Smart Adapter (c) RRD * ------ ------ - * 4-09 | 1 2 | 4-10 (MISO) 3-03 | 1 2 | 3-05 (SCK) - * 4-17 | 3 4 | 4-18 4-12 | 3 4 | 3-06 - * 4-16 5 6 | 4-15 4-11 5 6 | 3-04 (MOSI) - * 4-14 | 7 8 | 4-13 3-02 | 7 8 | 4-07 + * 37 4-09 | 1 2 | 4-10 (MISO) 3-03 | 1 2 | 3-05 52 (SCK) + * 17 4-17 | 3 4 | 4-18 31 4-12 | 3 4 | 3-06 53 + * 23 4-16 5 6 | 4-15 33 4-11 5 6 | 3-04 51 (MOSI) + * 27 4-14 | 7 8 | 4-13 49 3-02 | 7 8 | 4-07 41 * (GND) 3-07 | 9 10 | 3-01 (5V) (GND) 3-07 | 9 10 | -- * ------ ------ * EXP1 EXP2 */ - #define EXP1_01_PIN AUX4_09_PIN - #define EXP1_02_PIN AUX4_10_PIN + #define EXP1_01_PIN AUX4_09 // 37 + #define EXP1_02_PIN AUX4_10 // 35 #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #define EXP2_03_PIN AUX4_11_PIN - #define EXP2_05_PIN AUX4_12_PIN + #define EXP2_03_PIN AUX4_11 // 33 + #define EXP2_05_PIN AUX4_12 // 31 #define EXP2_08_PIN -1 // RESET #else - #define EXP2_03_PIN AUX4_12_PIN - #define EXP2_05_PIN AUX4_11_PIN - #define EXP2_08_PIN AUX4_07_PIN + #define EXP2_03_PIN AUX4_12 // 31 + #define EXP2_05_PIN AUX4_11 // 33 + #define EXP2_08_PIN AUX4_07 // 41 #endif #endif #endif -////////////////////////// -// LCDs and Controllers // -////////////////////////// +// +// LCD / Controller +// -#if HAS_WIRED_LCD && DISABLED(LCD_PINS_DEFINED) +#ifdef LCD_PINS_DEFINED + + // LCD pins already defined by including header + +#elif HAS_WIRED_LCD //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 @@ -602,12 +620,12 @@ #elif ALL(IS_NEWPANEL, PANEL_ONE) - #define LCD_PINS_RS AUX2_06_PIN - #define LCD_PINS_EN AUX2_08_PIN - #define LCD_PINS_D4 AUX2_10_PIN - #define LCD_PINS_D5 AUX2_09_PIN - #define LCD_PINS_D6 AUX2_07_PIN - #define LCD_PINS_D7 AUX2_05_PIN + #define LCD_PINS_RS AUX2_06 + #define LCD_PINS_EN AUX2_08 + #define LCD_PINS_D4 AUX2_10 + #define LCD_PINS_D5 AUX2_09 + #define LCD_PINS_D6 AUX2_07 + #define LCD_PINS_D7 AUX2_05 #elif ENABLED(TFTGLCD_PANEL_SPI) @@ -627,16 +645,14 @@ #elif ENABLED(ZONESTAR_LCD) - #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 + CONTROLLER_WARNING("RAMPS", "ZONESTAR_LCD", " Plugs into AUX2 but GND and 5V must be swapped.") - #define LCD_PINS_RS AUX2_05_PIN - #define LCD_PINS_EN AUX2_07_PIN - #define LCD_PINS_D4 AUX2_04_PIN - #define LCD_PINS_D5 AUX2_06_PIN - #define LCD_PINS_D6 AUX2_08_PIN - #define LCD_PINS_D7 AUX2_10_PIN + #define LCD_PINS_RS AUX2_05 + #define LCD_PINS_EN AUX2_07 + #define LCD_PINS_D4 AUX2_04 + #define LCD_PINS_D5 AUX2_06 + #define LCD_PINS_D6 AUX2_08 + #define LCD_PINS_D7 AUX2_10 #elif ENABLED(AZSMZ_12864) @@ -672,8 +688,8 @@ // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK_PIN 38 - //#define SHIFT_LD_PIN AUX2_08_PIN - //#define SHIFT_OUT_PIN AUX2_06_PIN + //#define SHIFT_LD_PIN AUX2_08 + //#define SHIFT_OUT_PIN AUX2_06 //#define SHIFT_EN_PIN EXP1_03_PIN #endif @@ -707,30 +723,30 @@ #endif #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN AUX4_08_PIN + #define LCD_BACKLIGHT_PIN AUX4_08 #endif #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define BTN_EN1 AUX2_05_PIN - #define BTN_EN2 AUX2_03_PIN - #define BTN_ENC AUX2_04_PIN + #define BTN_EN1 AUX2_05 + #define BTN_EN2 AUX2_03 + #define BTN_ENC AUX2_04 #ifndef SD_DETECT_PIN - #define SD_DETECT_PIN AUX2_08_PIN + #define SD_DETECT_PIN AUX2_08 #endif #elif ENABLED(LCD_I2C_PANELOLU2) - #define BTN_EN1 AUX4_04_PIN - #define BTN_EN2 AUX4_06_PIN - #define BTN_ENC AUX4_03_PIN + #define BTN_EN1 AUX4_04 + #define BTN_EN2 AUX4_06 + #define BTN_ENC AUX4_03 #define LCD_SDSS SDSS #define KILL_PIN EXP2_08_PIN #elif ENABLED(LCD_I2C_VIKI) - #define BTN_EN1 AUX2_06_PIN // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains AUX2-06 and AUX2-08. - #define BTN_EN2 AUX2_08_PIN + #define BTN_EN1 AUX2_06 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains AUX2-06 and AUX2-08. + #define BTN_EN2 AUX2_08 #define BTN_ENC -1 #define LCD_SDSS SDSS @@ -740,19 +756,19 @@ #elif ANY(VIKI2, miniVIKI) - #define DOGLCD_CS AUX4_05_PIN - #define DOGLCD_A0 AUX2_07_PIN + #define DOGLCD_CS AUX4_05 + #define DOGLCD_A0 AUX2_07 #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #ifndef BEEPER_PIN #define BEEPER_PIN EXP2_05_PIN #endif - #define STAT_LED_RED_PIN AUX4_03_PIN + #define STAT_LED_RED_PIN AUX4_03 #define STAT_LED_BLUE_PIN EXP1_02_PIN #define BTN_EN1 22 #define BTN_EN2 7 - #define BTN_ENC AUX4_08_PIN + #define BTN_ENC AUX4_08 #ifndef SD_DETECT_PIN #define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board @@ -837,19 +853,19 @@ #ifndef BEEPER_PIN #define BEEPER_PIN AUX2_08_PIN #endif - #define LCD_BACKLIGHT_PIN AUX2_10_PIN + #define LCD_BACKLIGHT_PIN AUX2_10 - #define DOGLCD_A0 AUX2_07_PIN - #define DOGLCD_CS AUX2_09_PIN + #define DOGLCD_A0 AUX2_07 + #define DOGLCD_CS AUX2_09 - #define BTN_EN1 AUX2_06_PIN - #define BTN_EN2 AUX2_04_PIN - #define BTN_ENC AUX2_03_PIN + #define BTN_EN1 AUX2_06 + #define BTN_EN2 AUX2_04 + #define BTN_ENC AUX2_03 #ifndef SD_DETECT_PIN - #define SD_DETECT_PIN AUX3_02_PIN + #define SD_DETECT_PIN AUX3_02 #endif - #define KILL_PIN AUX2_05_PIN + #define KILL_PIN AUX2_05 #elif ENABLED(ZONESTAR_LCD) @@ -883,9 +899,9 @@ #endif #if ENABLED(PANEL_ONE) // Buttons connect directly to AUX-2 - #define BTN_EN1 AUX2_03_PIN - #define BTN_EN2 AUX2_04_PIN - #define BTN_ENC AUX3_02_PIN + #define BTN_EN1 AUX2_03 + #define BTN_EN2 AUX2_04 + #define BTN_ENC AUX3_02 #else #define BTN_EN1 EXP1_01_PIN #define BTN_EN2 EXP1_02_PIN @@ -902,25 +918,23 @@ #endif // HAS_WIRED_LCD && !LCD_PINS_DEFINED #if IS_RRW_KEYPAD && !HAS_ADC_BUTTONS - #define SHIFT_OUT_PIN AUX2_06_PIN - #define SHIFT_CLK_PIN AUX2_07_PIN - #define SHIFT_LD_PIN AUX2_08_PIN + #define SHIFT_OUT_PIN AUX2_06 + #define SHIFT_CLK_PIN AUX2_07 + #define SHIFT_LD_PIN AUX2_08 #ifndef BTN_EN1 - #define BTN_EN1 AUX2_05_PIN + #define BTN_EN1 AUX2_05 #endif #ifndef BTN_EN2 - #define BTN_EN2 AUX2_03_PIN + #define BTN_EN2 AUX2_03 #endif #ifndef BTN_ENC - #define BTN_ENC AUX2_04_PIN + #define BTN_ENC AUX2_04 #endif #endif #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #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 + CONTROLLER_WARNING("RAMPS", "LCD_FYSETC_TFT81050") /** * FYSETC TFT-81050 display pinout diff --git a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h index f93c6919d9..a7f5a79009 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h @@ -22,7 +22,7 @@ #pragma once /** - * Arduino Mega with RAMPS v1.4Plus, also known as 3DYMY version, pin assignments + * Arduino Mega with RAMPS v1.4Plus, aka 3DYMY version * ATmega2560, ATmega1280 * * Applies to the following boards: @@ -64,32 +64,32 @@ #define E1_ENABLE_PIN 24 #define E1_CS_PIN -1 -/** 3DYMY Expansion Headers - * ------ ------ - * 37 | 1 2 | 35 (MISO) 50 | 1 2 | 52 (SCK) - * 31 | 3 4 | 41 29 | 3 4 | 53 - * 33 5 6 | 23 25 5 6 | 51 (MOSI) - * 42 | 7 8 | 44 49 | 7 8 | 27 - * GND | 9 10 | 5V GND | 9 10 | -- - * ------ ------ - * EXP1 EXP2 +/** 3DYMY Expansion Headers + * ------ ------ + * (BEEP) 37 | 1 2 | 35 (ENC) (MISO) 50 | 1 2 | 52 (SCK) + * (LCD_EN) 31 | 3 4 | 41 (LCD_RS) (EN1) 29 | 3 4 | 53 (SDSS) + * (LCD_D4) 33 5 6 | 23 (LCD_D5) (EN2) 25 5 6 | 51 (MOSI) + * (LCD_D6) 42 | 7 8 | 44 (LCD_D7) (SD_DET) 49 | 7 8 | 27 (KILL) + * GND | 9 10 | 5V GND | 9 10 | -- + * ------ ------ + * EXP1 EXP2 */ -#define EXP1_01_PIN 37 -#define EXP1_02_PIN 35 -#define EXP1_03_PIN 31 -#define EXP1_04_PIN 41 -#define EXP1_05_PIN 33 -#define EXP1_06_PIN 23 -#define EXP1_07_PIN 42 -#define EXP1_08_PIN 44 +#define EXP1_01_PIN 37 // BEEPER +#define EXP1_02_PIN 35 // ENC +#define EXP1_03_PIN 31 // LCD_EN +#define EXP1_04_PIN 41 // LCD_RS +#define EXP1_05_PIN 33 // LCD_D4 +#define EXP1_06_PIN 23 // LCD_D5 +#define EXP1_07_PIN 42 // LCD_D6 +#define EXP1_08_PIN 44 // LCD_D7 -#define EXP2_01_PIN 50 -#define EXP2_02_PIN 52 -#define EXP2_03_PIN 29 -#define EXP2_04_PIN 53 -#define EXP2_05_PIN 25 -#define EXP2_06_PIN 51 -#define EXP2_07_PIN 49 -#define EXP2_08_PIN 27 +#define EXP2_01_PIN 50 // MISO +#define EXP2_02_PIN 52 // SCK +#define EXP2_03_PIN 29 // EN1 +#define EXP2_04_PIN 53 // SDSS +#define EXP2_05_PIN 25 // EN2 +#define EXP2_06_PIN 51 // MOSI +#define EXP2_07_PIN 49 // SD_DET +#define EXP2_08_PIN 27 // KILL #include "pins_RAMPS.h" diff --git a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h index 542b3cb816..9565adad2f 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h @@ -244,13 +244,10 @@ #endif #endif -////////////////////////// -// LCDs and Controllers // -////////////////////////// +// +// LCD / Controller +// -// -// LCD Display output pins -// #if HAS_WIRED_LCD #define BEEPER_PIN 45 #define LCD_PINS_RS 19 diff --git a/Marlin/src/pins/ramps/pins_RUMBA.h b/Marlin/src/pins/ramps/pins_RUMBA.h index 1d2aeb4f0f..24cc2bada0 100644 --- a/Marlin/src/pins/ramps/pins_RUMBA.h +++ b/Marlin/src/pins/ramps/pins_RUMBA.h @@ -23,8 +23,7 @@ /** * RUMBA pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/RUMBA/RRD-RUMBA_SCHEMATICS.png - * Origin: https://reprap.org/wiki/File:RRD-RUMBA_SCHEMATICS.png + * Schematic: https://reprap.org/wiki/File:RRD-RUMBA_SCHEMATICS.png * ATmega2560 */ @@ -190,6 +189,7 @@ // // LCD / Controller // + #if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306) #define LCD_PINS_DC 38 // Set as output on init #define LCD_PINS_RS 41 // Pull low for 1s to init diff --git a/Marlin/src/pins/ramps/pins_TANGO.h b/Marlin/src/pins/ramps/pins_TANGO.h index 54dd443399..0f8aaca0e2 100644 --- a/Marlin/src/pins/ramps/pins_TANGO.h +++ b/Marlin/src/pins/ramps/pins_TANGO.h @@ -23,8 +23,7 @@ /** * BIQU Tango pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/BIQU%20Tango/schematic.png - * Origin: https://github.com/bigtreetech/Tango-3D-Printer-Motherboard/blob/master/Schematic/Tango%20V1.0.SchDoc + * Schematic: https://github.com/bigtreetech/Tango-3D-Printer-Motherboard/blob/master/Schematic/Tango%20V1.0.SchDoc * ATmega2560 */ diff --git a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h index 7306272127..d3c921a5f6 100644 --- a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h +++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h @@ -75,33 +75,33 @@ * 5V 5V 5V 5V 5V 5V */ -/** Expansion Headers - * ------ ------ - * 37 | 1 2 | 35 (MISO) 50 | 1 2 | 52 (SCK) - * 17 | 3 4 | 16 31 | 3 4 | 53 - * 23 5 6 | 25 33 5 6 | 51 (MOSI) - * 27 | 7 8 | 29 49 | 7 8 | 41 - * (GND) | 9 10 | (5V) (GND) | 9 10 | RESET - * ------ ------ - * EXP1 EXP2 +/** Expansion Headers + * ------ ------ + * (BEEP) 37 | 1 2 | 35 (ENC) (MISO) 50 | 1 2 | 52 (SCK) + * (LCD_EN) 17 | 3 4 | 16 (LCD_RS) (EN1) 31 | 3 4 | 53 (SDSS) + * (LCD_D4) 23 5 6 | 25 (LCD_D5) (EN2) 33 5 6 | 51 (MOSI) + * (LCD_D6) 27 | 7 8 | 29 (LCD_D7) (SD_DET) 49 | 7 8 | 41 (KILL) + * GND | 9 10 | 5V GND | 9 10 | RESET + * ------ ------ + * EXP1 EXP2 */ -#define EXP1_01_PIN 37 -#define EXP1_02_PIN 35 -#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_01_PIN 37 // BEEPER +#define EXP1_02_PIN 35 // ENC +#define EXP1_03_PIN 17 // LCD_EN +#define EXP1_04_PIN 16 // LCD_RS +#define EXP1_05_PIN 23 // LCD_D4 +#define EXP1_06_PIN 25 // LCD_D5 +#define EXP1_07_PIN 27 // LCD_D6 +#define EXP1_08_PIN 29 // LCD_D7 #define EXP2_01_PIN 50 // MISO #define EXP2_02_PIN 52 // SCK -#define EXP2_03_PIN 31 -#define EXP2_04_PIN 53 -#define EXP2_05_PIN 33 +#define EXP2_03_PIN 31 // EN1 +#define EXP2_04_PIN 53 // SDSS +#define EXP2_05_PIN 33 // EN2 #define EXP2_06_PIN 51 // MOSI -#define EXP2_07_PIN 49 -#define EXP2_08_PIN 41 +#define EXP2_07_PIN 49 // SD_DET +#define EXP2_08_PIN 41 // KILL // // AnyCubic pin mappings diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index 1edeb6b8fe..ed4f373c54 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -21,7 +21,11 @@ */ #pragma once -// ATmega2560 +/** + * TT OSCAR by YM Tech.LTD + * + * ATmega2560 + */ #include "env_validate.h" @@ -73,12 +77,12 @@ #define Z_STEP_PIN 46 #define Z_DIR_PIN 48 #define Z_ENABLE_PIN 62 -#define Z_CS_PIN 53 +#define Z_CS_PIN 53 // EXP2-4 #define E0_STEP_PIN 26 #define E0_DIR_PIN 28 #define E0_ENABLE_PIN 24 -#define E0_CS_PIN 49 +#define E0_CS_PIN 49 // EXP2-7 #define E1_STEP_PIN 36 #define E1_DIR_PIN 34 @@ -209,11 +213,11 @@ // // Misc. Functions // -#define SDSS 53 +#define SDSS 53 // EXP2-4 #define LED_PIN 13 //#ifndef FILWIDTH_PIN -// #define FILWIDTH_PIN 5 // Analog Input +// #define FILWIDTH_PIN 5 // Analog Input //#endif // DIO 4 (Servos plug) for the runout sensor. @@ -257,16 +261,52 @@ #define E_MUX0_PIN 58 // Y_CS_PIN #endif #ifndef E_MUX1_PIN - #define E_MUX1_PIN 53 // Z_CS_PIN + #define E_MUX1_PIN 53 // EXP2-4 #endif #ifndef E_MUX2_PIN - #define E_MUX2_PIN 49 // En_CS_PIN + #define E_MUX2_PIN 49 // EXP2-7 #endif #endif -////////////////////////// -// LCDs and Controllers // -////////////////////////// +/** TT OSCAR Expansion Headers + * ------ + * -- | 1 2 | -- + * -- 3 4 | -- + * -- 5 6 | -- + * 49 | 7 8 | -- + * ------ + * AUX1 + * + * ------ ------ + * 37 | 1 2 | 35 (MISO) 44 | 1 2 | 52 (SCK) + * 17 | 3 4 | 41? 35 | 3 4 | 53 + * 23 5 6 | 25 31 5 6 | 51 (MOSI) + * 27 | 7 8 | 29 49 | 7 8 | 41 + * GND | 9 10 | 5V GND | 9 10 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_01_PIN 37 // BEEPER +#define EXP1_02_PIN 35 // ENC +#define EXP1_03_PIN 17 // ENC1 +#define EXP1_04_PIN 41 // RESET +#define EXP1_05_PIN 23 // ENC2 +#define EXP1_06_PIN 25 // D4 +#define EXP1_07_PIN 27 // RS +#define EXP1_08_PIN 29 // EN + +#define EXP2_01_PIN 44 // MISO +#define EXP2_02_PIN 52 // SCK +#define EXP2_03_PIN 35 // EN2 / EN1 +#define EXP2_04_PIN 53 // SDSS +#define EXP2_05_PIN 31 // EN1 / EN2 +#define EXP2_06_PIN 51 // MOSI +#define EXP2_07_PIN 49 // SD_DET +#define EXP2_08_PIN 41 // KILL / RESET + +// +// LCD / Controller +// #if HAS_WIRED_LCD @@ -275,9 +315,9 @@ // #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_EN 51 // SID (MOSI) - #define LCD_PINS_D4 52 // SCK (CLK) clock + #define LCD_PINS_RS EXP2_07_PIN // CS chip select /SS chip slave select + #define LCD_PINS_EN EXP2_06_PIN // SID (MOSI) + #define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock #elif ALL(IS_NEWPANEL, PANEL_ONE) @@ -369,7 +409,7 @@ #endif #define BTN_ENC 35 - #define SD_DETECT_PIN 49 + #define SD_DETECT_PIN EXP2_07_PIN //#define KILL_PIN 41 #if ENABLED(BQ_LCD_SMART_CONTROLLER) @@ -388,7 +428,7 @@ #define BTN_EN1 47 #define BTN_EN2 43 #define BTN_ENC 32 - #define LCD_SDSS 53 + #define LCD_SDSS EXP2_04_PIN //#define KILL_PIN 41 #elif ENABLED(LCD_I2C_VIKI) @@ -397,8 +437,8 @@ #define BTN_EN2 7 // 22/7 are unused on RAMPS_14. 22 is unused and 7 the SERVO0_PIN on RAMPS_13. #define BTN_ENC -1 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 + #define LCD_SDSS EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #elif ANY(VIKI2, miniVIKI) @@ -413,7 +453,7 @@ #define BTN_EN2 7 #define BTN_ENC 39 - #define SDSS 53 + #define SDSS EXP2_04_PIN #define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board //#define KILL_PIN 31 @@ -431,8 +471,8 @@ #define BTN_EN2 37 #define BTN_ENC 31 - #define LCD_SDSS 53 - #define SD_DETECT_PIN 49 + #define LCD_SDSS EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN //#define KILL_PIN 41 #elif ENABLED(MKS_MINI_12864) @@ -447,8 +487,8 @@ #define BTN_EN1 31 #define BTN_EN2 33 #define BTN_ENC 35 - //#define SDSS 53 - #define SD_DETECT_PIN 49 + //#define SDSS EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN //#define KILL_PIN 64 //#define LCD_CONTRAST_INIT 190 @@ -467,8 +507,8 @@ #define BTN_EN2 63 #define BTN_ENC 59 - #define SDSS 53 - #define SD_DETECT_PIN 49 + #define SDSS EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN //#define KILL_PIN 64 //#define LCD_CONTRAST_INIT 190 @@ -498,7 +538,7 @@ #endif #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN 49 + #define SD_DETECT_PIN EXP2_07_PIN //#define KILL_PIN 41 #endif diff --git a/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h index 049e8bc5d8..ca1b4b883b 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h @@ -24,11 +24,6 @@ /** * Ultiboard v2.0 pin assignments * Schematics (2.1.4): - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%202.1.4/schema1.png - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%202.1.4/schema2.png - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%202.1.4/schema3.png - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%202.1.4/schema4.png - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%202.1.4/schema5.png * Origins (2.1.4): * - https://github.com/Ultimaker/Ultimaker2/blob/master/1546%20ultimainboard%20V2.1.4/schema1.SchDoc * - https://github.com/Ultimaker/Ultimaker2/blob/master/1546%20ultimainboard%20V2.1.4/schema2.SchDoc @@ -36,11 +31,7 @@ * - https://github.com/Ultimaker/Ultimaker2/blob/master/1546%20ultimainboard%20V2.1.4/schema4.SchDoc * - https://github.com/Ultimaker/Ultimaker2/blob/master/1546%20ultimainboard%20V2.1.4/schema5.SchDoc * Schematics (Original+): - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%20Original+/Ultimainboard%20rev.%202.1.1%20altium/schema1.png - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%20Original+/Ultimainboard%20rev.%202.1.1%20altium/schema2.png - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%20Original+/Ultimainboard%20rev.%202.1.1%20altium/schema3.png - * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%20Original+/Ultimainboard%20rev.%202.1.1%20altium/schema4.png - * Origin (Original+): https://github.com/Ultimaker/Ultimaker-Original-Plus/blob/master/1091_Main_board_v2.1.1_(x1)/Ultimainboard%20rev.%202.1.1%20altium.zip + * Schematic (Original+): https://github.com/Ultimaker/Ultimaker-Original-Plus/blob/master/1091_Main_board_v2.1.1_(x1)/Ultimainboard%20rev.%202.1.1%20altium.zip * ATmega2560 */ diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER.h b/Marlin/src/pins/ramps/pins_ULTIMAKER.h index 4e1fb487b5..b4eea9d488 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAKER.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER.h @@ -118,6 +118,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define BEEPER_PIN 18 diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h index 01fc6b416d..c366b15296 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h @@ -23,8 +23,6 @@ /** * Ultimaker pin assignments (Old electronics) - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%201.0/ultipanel%20rev1.1.sch.pdf - * Origin: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%201.0/ultipanel%20rev1.1.sch.pdf * ATmega2560, ATmega1280 */ @@ -166,6 +164,7 @@ // // LCD / Controller // + #if ANY(BOARD_REV_1_0, BOARD_REV_1_1_TO_1_3) #define LCD_PINS_RS 24 diff --git a/Marlin/src/pins/ramps/pins_VORON.h b/Marlin/src/pins/ramps/pins_VORON.h index 4aee2ab142..ee3d7f0185 100644 --- a/Marlin/src/pins/ramps/pins_VORON.h +++ b/Marlin/src/pins/ramps/pins_VORON.h @@ -49,6 +49,6 @@ #include "pins_RAMPS.h" // -// LCDs and Controllers +// LCD / Controller // #undef BEEPER_PIN diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V20.h b/Marlin/src/pins/ramps/pins_ZRIB_V20.h index d1c80f6a4a..8218ba12c5 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V20.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V20.h @@ -24,10 +24,8 @@ /** * ZONESTAR ZRIB V2.0 & V3.0 pin assignments * V2 and V3 Boards only differ in USB controller, nothing affecting the pins. - * Schematic (2.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/ZONESTAR%20ZRIB%20V2.0/ZRIB_V2_Schematic.pdf - * Origin (2.0): https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZRIB/ZRIB_V2/ZRIB_V2_Schematic.pdf - * Schematic (3.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/ZONESTAR%20ZRIB%20V3.0/ZRIB_V3_Schematic.pdf - * Origin (3.0): https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZRIB/ZRIB_V3/ZRIB_V3_Schematic.pdf + * Schematic (2.0): https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZRIB/ZRIB_V2/ZRIB_V2_Schematic.pdf + * Schematic (3.0): https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZRIB/ZRIB_V3/ZRIB_V3_Schematic.pdf * ATmega2560, ATmega1280 */ diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V52.h b/Marlin/src/pins/ramps/pins_ZRIB_V52.h index 5eada31c9c..016501241a 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V52.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V52.h @@ -23,8 +23,7 @@ /** * ZONESTAR ZRIB V5.2 Based on MKS BASE v1.4 with A4982 stepper drivers and digital micro-stepping - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/ZONESTAR%20ZRIB%20V5.2/ZRIB_V52_Schematic.pdf - * Origin: https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZRIB/ZRIB_V5/ZRIB_V52_Schematic.pdf + * Schematic: https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZRIB/ZRIB_V5/ZRIB_V52_Schematic.pdf * ATmega2560, ATmega1280 */ diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V53.h b/Marlin/src/pins/ramps/pins_ZRIB_V53.h index 08585c2c27..85420bdec3 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V53.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V53.h @@ -329,16 +329,16 @@ #define EXP2_08_PIN 41 #endif -////////////////////////// -// LCDs and Controllers // -////////////////////////// +// +// LCD / Controller +// #if ENABLED(ZONESTAR_12864LCD) #define LCDSCREEN_NAME "ZONESTAR LCD12864" #define LCD_SDSS 16 - #define LCD_PINS_RS 16 // ST7920_CS_PIN LCD_PIN_RS (PIN4 of LCD module) - #define LCD_PINS_EN 23 // ST7920_DAT_PIN LCD_PIN_R/W (PIN5 of LCD module) - #define LCD_PINS_D4 17 // ST7920_CLK_PIN LCD_PIN_ENA (PIN6 of LCD module) + #define LCD_PINS_RS 16 // ST7920 CS (LCD-4) + #define LCD_PINS_EN 23 // ST7920 DAT LCD-R/W (LCD-5) + #define LCD_PINS_D4 17 // ST7920 CLK LCD-ENA (LCD-6) #define BTN_EN2 25 #define BTN_EN1 27 #define BTN_ENC 29 @@ -347,9 +347,9 @@ #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define LCDSCREEN_NAME "Reprap LCD12864" // Use EXP1 & EXP2 connector - #define LCD_PINS_RS 16 // ST7920_CS_PIN LCD_PIN_RS - #define LCD_PINS_EN 17 // ST7920_DAT_PIN LCD_PIN_ENA - #define LCD_PINS_D4 23 // ST7920_CLK_PIN LCD_PIN_R/W + #define LCD_PINS_RS 16 // ST7920 CS + #define LCD_PINS_EN 17 // ST7920 DAT + #define LCD_PINS_D4 23 // ST7920 CLK LCD-R/W #define BTN_EN1 31 #define BTN_EN2 33 #define BTN_ENC 35 diff --git a/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h b/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h index 312745f11d..ceaeb8a587 100644 --- a/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h +++ b/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h @@ -148,6 +148,7 @@ // // LCD / Controller // + #if IS_RRD_FG_SC #define LCD_PINS_RS 18 #define LCD_PINS_EN 15 diff --git a/Marlin/src/pins/sam/pins_ARCHIM1.h b/Marlin/src/pins/sam/pins_ARCHIM1.h index a6ac53e5ec..e7530f981b 100644 --- a/Marlin/src/pins/sam/pins_ARCHIM1.h +++ b/Marlin/src/pins/sam/pins_ARCHIM1.h @@ -180,6 +180,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define BEEPER_PIN 23 // D24 PA15_CTS1 #define LCD_PINS_RS 17 // D17 PA12_RXD1 diff --git a/Marlin/src/pins/sam/pins_ARCHIM2.h b/Marlin/src/pins/sam/pins_ARCHIM2.h index 56202cc188..31ed50194c 100644 --- a/Marlin/src/pins/sam/pins_ARCHIM2.h +++ b/Marlin/src/pins/sam/pins_ARCHIM2.h @@ -235,6 +235,7 @@ // // LCD / Controller // + #if ANY(HAS_WIRED_LCD, TOUCH_UI_ULTIPANEL, TOUCH_UI_FTDI_EVE) #define BEEPER_PIN 23 // D24 PA15_CTS1 #define LCD_PINS_RS 17 // D17 PA12_RXD1 diff --git a/Marlin/src/pins/sam/pins_DUE3DOM.h b/Marlin/src/pins/sam/pins_DUE3DOM.h index bd6cb7a6cd..66aa581271 100644 --- a/Marlin/src/pins/sam/pins_DUE3DOM.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM.h @@ -111,6 +111,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define LCD_PINS_RS 42 diff --git a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h index 8ad5e2229c..b9f73adfe9 100644 --- a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h +++ b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h @@ -103,6 +103,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define LCD_PINS_RS 42 diff --git a/Marlin/src/pins/sam/pins_KRATOS32.h b/Marlin/src/pins/sam/pins_KRATOS32.h index 74da7a78f6..bebe2b82a3 100644 --- a/Marlin/src/pins/sam/pins_KRATOS32.h +++ b/Marlin/src/pins/sam/pins_KRATOS32.h @@ -145,6 +145,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define BTN_EN1 48 diff --git a/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h b/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h index 8fd1843ab5..b85150f1ca 100644 --- a/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h +++ b/Marlin/src/pins/sam/pins_PRINTRBOARD_G2.h @@ -62,7 +62,7 @@ // LED defines // //#define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) -//#define NEOPIXEL_PIN 20 // LED driving pin on motherboard +//#define BOARD_NEOPIXEL_PIN 20 // LED driving pin on motherboard //#define NEOPIXEL_PIXELS 3 // Number of LEDs in the strip //#define SDA0 20 // PB12 NeoPixel pin I2C data //#define SCL0 21 // PB13 I2C clock diff --git a/Marlin/src/pins/sam/pins_RADDS.h b/Marlin/src/pins/sam/pins_RADDS.h index 9a3edff0c9..4f713391fc 100644 --- a/Marlin/src/pins/sam/pins_RADDS.h +++ b/Marlin/src/pins/sam/pins_RADDS.h @@ -224,6 +224,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #if ENABLED(RADDS_DISPLAY) diff --git a/Marlin/src/pins/sam/pins_RAMPS_DUO.h b/Marlin/src/pins/sam/pins_RAMPS_DUO.h index b00d215cc7..6b7bf51466 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_DUO.h +++ b/Marlin/src/pins/sam/pins_RAMPS_DUO.h @@ -66,6 +66,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #if ALL(IS_NEWPANEL, PANEL_ONE) diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h index f5587a6cba..2b9c8fd7eb 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h @@ -134,7 +134,9 @@ #define SDSS 4 #define LED_PIN 13 -/** ------ ------ +/** + * RAMPS-FD LCD adapter + * ------ ------ * 37 | 1 2 | 35 (MISO) 50 | 1 2 | 76 (SCK) * 29 | 3 4 | 27 (EN2) 31 | 3 4 | 4 (SD_SS) * 25 5 6 | 23 (EN1) 33 5 6 | 75 (MOSI) @@ -164,8 +166,8 @@ // // LCD / Controller // + #if HAS_WIRED_LCD - // ramps-fd lcd adaptor #define BEEPER_PIN EXP1_01_PIN diff --git a/Marlin/src/pins/sam/pins_RAMPS_SMART.h b/Marlin/src/pins/sam/pins_RAMPS_SMART.h index 2a0733c601..90e9b99697 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_SMART.h +++ b/Marlin/src/pins/sam/pins_RAMPS_SMART.h @@ -95,6 +95,7 @@ // // LCD / Controller // + #if ENABLED(AZSMZ_12864) // Support for AZSMZ 12864 LCD with SD Card 3D printer smart controller control panel diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 64fad0e081..f083f01d4f 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -195,27 +195,28 @@ * ------ ------ * EXP1 EXP2 */ -#define EXP1_01_PIN 62 -#define EXP1_02_PIN 40 -#define EXP1_03_PIN 64 -#define EXP1_04_PIN 63 -#define EXP1_05_PIN 48 -#define EXP1_06_PIN 50 -#define EXP1_07_PIN 52 -#define EXP1_08_PIN 53 +#define EXP1_01_PIN 62 // BEEPER +#define EXP1_02_PIN 40 // ENC +#define EXP1_03_PIN 64 // LCD_EN +#define EXP1_04_PIN 63 // LCD_RS +#define EXP1_05_PIN 48 // LCD_D4 / RESET +#define EXP1_06_PIN 50 // LCD_D5 +#define EXP1_07_PIN 52 // LCD_D6 +#define EXP1_08_PIN 53 // LCD_D7 / ENABLE #define EXP2_01_PIN 74 // MISO #define EXP2_02_PIN 76 // SCK -#define EXP2_03_PIN 44 -#define EXP2_04_PIN 10 -#define EXP2_05_PIN 42 +#define EXP2_03_PIN 44 // EN1 +#define EXP2_04_PIN 10 // SDSS +#define EXP2_05_PIN 42 // EN2 #define EXP2_06_PIN 75 // MOSI -#define EXP2_07_PIN 51 +#define EXP2_07_PIN 51 // SD DET #define EXP2_08_PIN -1 // RESET // // LCD / Controller // + #if HAS_WIRED_LCD #if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC) diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index 1b66b766db..fa27868ff9 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -206,6 +206,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC) diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h index 87f83a5c96..e2cd6f6b55 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h @@ -568,23 +568,6 @@ #endif #if HAS_TMC_UART - /** - * Address for the UART Configuration of the TMC2209. Override in Configuration files. - * To test TMC2209 Steppers enable TMC_DEBUG in Configuration_adv.h and test the M122 command with voltage on the steppers. - */ - #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0b00 - #endif - #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 0b01 - #endif - #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 0b10 - #endif - #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 0b11 - #endif - /** * TMC2208/TMC2209 stepper drivers * It seems to work perfectly fine on Software Serial, if an advanced user wants to test, you could use the SAMD51 Serial1 and Serial 2. Be careful with the Sercom configurations. @@ -594,8 +577,28 @@ //#define Z_HARDWARE_SERIAL Serial1 //#define E0_HARDWARE_SERIAL Serial1 - // This is the stable default value after testing, but, higher UART rates could be configured, remeber to test the Steppers with the M122 command to check if everything works. - #define TMC_BAUD_RATE 250000 + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 1 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 2 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_BRICOLEMON_LITE_V1_0."); + static_assert(Y_SLAVE_ADDRESS == 1, "Y_SLAVE_ADDRESS must be 1 for BOARD_BRICOLEMON_LITE_V1_0."); + static_assert(Z_SLAVE_ADDRESS == 2, "Z_SLAVE_ADDRESS must be 2 for BOARD_BRICOLEMON_LITE_V1_0."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_BRICOLEMON_LITE_V1_0."); + + // Reduce baud rate to improve software serial reliability + #ifndef TMC_BAUD_RATE + #define TMC_BAUD_RATE 19200 // 250000 + #endif // // Software serial diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h index d55669ac90..31997f7fdc 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h @@ -620,27 +620,6 @@ #endif #if HAS_TMC_UART - - /** - * Address for the UART Configuration of the TMC2209. Override in Configuration files. - * To test TMC2209 Steppers enable TMC_DEBUG in Configuration_adv.h and test the M122 command with voltage on the steppers. - */ - #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0b00 - #endif - #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 0b01 - #endif - #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 0b10 - #endif - #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 0b11 - #endif - #ifndef E1_SLAVE_ADDRESS - #define E1_SLAVE_ADDRESS 0b00 - #endif - /** * TMC2208/TMC2209 stepper drivers * It seems to work perfectly fine on Software Serial, if an advanced user wants to test, you could use the SAMD51 Serial1 and Serial 2. Be careful with the Sercom configurations. @@ -653,7 +632,32 @@ //#define E0_HARDWARE_SERIAL Serial1 //#define E1_HARDWARE_SERIAL Serial2 - #define TMC_BAUD_RATE 250000 + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 1 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 2 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif + #ifndef E1_SLAVE_ADDRESS + #define E1_SLAVE_ADDRESS 0 + #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_BRICOLEMON_V1_0."); + static_assert(Y_SLAVE_ADDRESS == 1, "Y_SLAVE_ADDRESS must be 1 for BOARD_BRICOLEMON_V1_0."); + static_assert(Z_SLAVE_ADDRESS == 2, "Z_SLAVE_ADDRESS must be 2 for BOARD_BRICOLEMON_V1_0."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_BRICOLEMON_V1_0."); + static_assert(E1_SLAVE_ADDRESS == 0, "E1_SLAVE_ADDRESS must be 0 for BOARD_BRICOLEMON_V1_0."); + + // Reduce baud rate to improve software serial reliability + #ifndef TMC_BAUD_RATE + #define TMC_BAUD_RATE 19200 // 250000 + #endif // // Software serial diff --git a/Marlin/src/pins/samd/pins_MINITRONICS20.h b/Marlin/src/pins/samd/pins_MINITRONICS20.h index 2a450698d1..dfbc24487d 100644 --- a/Marlin/src/pins/samd/pins_MINITRONICS20.h +++ b/Marlin/src/pins/samd/pins_MINITRONICS20.h @@ -497,27 +497,6 @@ #define SD_DETECT_PIN 22 #if HAS_TMC_UART - - /** - * TMC2209 UART Address. Override in Configuration files. - * To test TMC2209 Steppers enable TMC_DEBUG and test M122 with voltage on the steppers. - */ - #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0b00 - #endif - #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 0b01 - #endif - #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 0b10 - #endif - #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 0b11 - #endif - #ifndef E1_SLAVE_ADDRESS - #define E1_SLAVE_ADDRESS 0b00 - #endif - /** * TMC2208/TMC2209 stepper drivers * Seems to work fine with Software Serial. If you want to test, use SAMD51 Serial1 and Serial2. Be careful with the Sercom configurations. @@ -530,7 +509,32 @@ //#define E0_HARDWARE_SERIAL Serial1 //#define E1_HARDWARE_SERIAL Serial2 - #define TMC_BAUD_RATE 250000 + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 1 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 2 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif + #ifndef E1_SLAVE_ADDRESS + #define E1_SLAVE_ADDRESS 0 + #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_MINITRONICS20."); + static_assert(Y_SLAVE_ADDRESS == 1, "Y_SLAVE_ADDRESS must be 1 for BOARD_MINITRONICS20."); + static_assert(Z_SLAVE_ADDRESS == 2, "Z_SLAVE_ADDRESS must be 2 for BOARD_MINITRONICS20."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_MINITRONICS20."); + static_assert(E1_SLAVE_ADDRESS == 0, "E1_SLAVE_ADDRESS must be 0 for BOARD_MINITRONICS20."); + + // Reduce baud rate to improve software serial reliability + #ifndef TMC_BAUD_RATE + #define TMC_BAUD_RATE 19200 // 250000 + #endif // // Software serial diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h index 3e5d563929..2eaf27d37a 100644 --- a/Marlin/src/pins/samd/pins_RAMPS_144.h +++ b/Marlin/src/pins/samd/pins_RAMPS_144.h @@ -48,6 +48,21 @@ #define I2C_EEPROM // EEPROM on I2C-0 #define MARLIN_EEPROM_SIZE 0x8000 // 32K (24lc256) +// +// Foam Cutter requirements +// + +#if ENABLED(FOAMCUTTER_XYUV) + #define MOSFET_C_PIN -1 + #if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN) && NUM_SERVOS < 2 + #define SPINDLE_LASER_PWM_PIN 8 // Hardware PWM + #endif + #define Z_MIN_PIN -1 + #define Z_MAX_PIN -1 + #define I_STOP_PIN 18 + #define J_STOP_PIN 19 +#endif + // // Limit Switches // @@ -260,79 +275,231 @@ #define SDSS 53 #endif -////////////////////////// -// LCDs and Controllers // -////////////////////////// +// +// Průša i3 MK2 Multiplexer Support +// +#if HAS_PRUSA_MMU1 + #ifndef E_MUX0_PIN + #define E_MUX0_PIN AUX2_06 // Z_CS_PIN + #endif + #ifndef E_MUX1_PIN + #define E_MUX1_PIN AUX2_08 // E0_CS_PIN + #endif + #ifndef E_MUX2_PIN + #define E_MUX2_PIN AUX2_07 // E1_CS_PIN + #endif +#endif -#if HAS_WIRED_LCD +// +// AUX1 VCC GND D2 D1 +// 2 4 6 8 +// 1 3 5 7 +// VCC GND A3 A4 +// +#define AUX1_05 57 // (A3) +#define AUX1_06 2 +#define AUX1_07 58 // (A4) +#define AUX1_08 1 + +// +// AUX2 GND A9 D40 D42 A11 +// 2 4 6 8 10 +// 1 3 5 7 9 +// VCC A5 A10 D44 A12 +// +#define AUX2_03 59 // (A5) +#define AUX2_04 63 // (A9) +#define AUX2_05 64 // (A10) +#define AUX2_06 40 +#define AUX2_07 44 +#define AUX2_08 42 +#define AUX2_09 66 // (A12) +#define AUX2_10 65 // (A11) + +// +// AUX3 +// SCK MISO +// RST GND D52 D50 VCC +// 9 7 5 3 1 +// 10 8 6 4 2 +// NC 5V D53 D51 D49 +// MOSI +// +#define AUX3_02 49 +#define AUX3_03 50 +#define AUX3_04 51 +#define AUX3_05 52 +#define AUX3_06 53 + +// +// AUX4 VCC GND D32 D47 D45 D43 D41 D39 D37 D35 D33 D31 D29 D27 D25 D23 D17 D16 +// +#define AUX4_03 32 +#define AUX4_04 47 +#define AUX4_05 45 +#define AUX4_06 43 +#define AUX4_07 41 +#define AUX4_08 39 +#define AUX4_09 37 +#define AUX4_10 35 +#define AUX4_11 33 +#define AUX4_12 31 +#define AUX4_13 29 +#define AUX4_14 27 +#define AUX4_15 25 +#define AUX4_16 23 +#define AUX4_17 17 +#define AUX4_18 16 + +/** + * LCD adapters come in different variants. The socket keys can be + * on either side, and may be backwards on some boards / displays. + */ +#ifndef EXP1_08_PIN + + #define EXP1_03_PIN AUX4_17 + #define EXP1_04_PIN AUX4_18 + #define EXP1_05_PIN AUX4_16 + #define EXP1_06_PIN AUX4_15 + #define EXP1_07_PIN AUX4_14 + #define EXP1_08_PIN AUX4_13 + + #define EXP2_01_PIN AUX3_03 + #define EXP2_02_PIN AUX3_05 + #define EXP2_04_PIN AUX3_06 + #define EXP2_06_PIN AUX3_04 + #define EXP2_07_PIN AUX3_02 + + #if ENABLED(G3D_PANEL) + /** Gadgets3D Smart Adapter + * ------ ------ + * 4-11 | 1 2 | 4-12 (MISO) 3-03 | 1 2 | 3-05 (SCK) + * 4-17 | 3 4 | 4-18 4-10 | 3 4 | 3-06 + * 4-16 5 6 | 4-15 4-09 5 6 | 3-04 (MOSI) + * 4-14 | 7 8 | 4-13 3-02 | 7 8 | 4-07 + * (GND) 4-02 | 9 10 | 4-01 (5V) -- | 9 10 | -- + * ------ ------ + * EXP1 EXP2 + */ + #define EXP1_01_PIN AUX4_11 + #define EXP1_02_PIN AUX4_12 + + #define EXP2_03_PIN AUX4_10 + #define EXP2_05_PIN AUX4_09 + #define EXP2_08_PIN AUX4_07 + + #else + + /** Smart Adapter (c) RRD + * ------ ------ + * 4-09 | 1 2 | 4-10 (MISO) 3-03 | 1 2 | 3-05 (SCK) + * 4-17 | 3 4 | 4-18 4-12 | 3 4 | 3-06 + * 4-16 5 6 | 4-15 4-11 5 6 | 3-04 (MOSI) + * 4-14 | 7 8 | 4-13 3-02 | 7 8 | 4-07 + * (GND) 3-07 | 9 10 | 3-01 (5V) (GND) 3-07 | 9 10 | -- + * ------ ------ + * EXP1 EXP2 + */ + #define EXP1_01_PIN AUX4_09 + #define EXP1_02_PIN AUX4_10 + + #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) + #define EXP2_03_PIN AUX4_11 + #define EXP2_05_PIN AUX4_12 + #define EXP2_08_PIN -1 // RESET + #else + #define EXP2_03_PIN AUX4_12 + #define EXP2_05_PIN AUX4_11 + #define EXP2_08_PIN AUX4_07 + #endif + + #endif + +#endif + +// +// LCD / Controller +// + +#ifdef LCD_PINS_DEFINED + + // LCD pins already defined by including header + +#elif HAS_WIRED_LCD + + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 // // LCD Display output pins // #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - // TO TEST - //#define LCD_PINS_RS 49 // CS chip select /SS chip slave select - //#define LCD_PINS_EN 51 // SID (MOSI) - //#define LCD_PINS_D4 52 // SCK (CLK) clock + #define LCD_PINS_RS EXP2_07_PIN // CS chip select /SS chip slave select + #define LCD_PINS_EN EXP2_06_PIN // SID (MOSI) + #define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock #elif ALL(IS_NEWPANEL, PANEL_ONE) - // TO TEST - //#define LCD_PINS_RS 40 - //#define LCD_PINS_EN 42 - //#define LCD_PINS_D4 57 // Mega/Due:65 - AGCM4:57 - //#define LCD_PINS_D5 58 // Mega/Due:66 - AGCM4:58 - //#define LCD_PINS_D6 44 - //#define LCD_PINS_D7 56 // Mega/Due:64 - AGCM4:56 + #define LCD_PINS_RS AUX2_06 + #define LCD_PINS_EN AUX2_08 + #define LCD_PINS_D4 AUX2_10 + #define LCD_PINS_D5 AUX2_09 + #define LCD_PINS_D6 AUX2_07 + #define LCD_PINS_D7 AUX2_05 + + #elif ENABLED(TFTGLCD_PANEL_SPI) + + #define TFTGLCD_CS EXP2_05_PIN #else #if ENABLED(CR10_STOCKDISPLAY) - // TO TEST - //#define LCD_PINS_RS 27 - //#define LCD_PINS_EN 29 - //#define LCD_PINS_D4 25 + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_EN EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #if !IS_NEWPANEL - // TO TEST - //#define BEEPER_PIN 37 + #define BEEPER_PIN EXP1_01_PIN #endif #elif ENABLED(ZONESTAR_LCD) - // TO TEST - //#define LCD_PINS_RS 56 // Mega/Due:64 - AGCM4:56 - //#define LCD_PINS_EN 44 - //#define LCD_PINS_D4 55 // Mega/Due:63 - AGCM4:55 - //#define LCD_PINS_D5 40 - //#define LCD_PINS_D6 42 - //#define LCD_PINS_D7 57 // Mega/Due:65 - AGCM4:57 + CONTROLLER_WARNING("RAMPS_144", "ZONESTAR_LCD", " Plugs into AUX2 but GND and 5V must be swapped.") + + #define LCD_PINS_RS AUX2_05 + #define LCD_PINS_EN AUX2_07 + #define LCD_PINS_D4 AUX2_04 + #define LCD_PINS_D5 AUX2_06 + #define LCD_PINS_D6 AUX2_08 + #define LCD_PINS_D7 AUX2_10 + + #elif ENABLED(AZSMZ_12864) + + // TODO #else #if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306) - // TO TEST - //#define LCD_PINS_DC 25 // Set as output on init - //#define LCD_PINS_RS 27 // Pull low for 1s to init + #define LCD_PINS_DC EXP1_06_PIN // Set as output on init + #define LCD_PINS_RS EXP1_07_PIN // Pull low for 1s to init // DOGM SPI LCD Support - //#define DOGLCD_CS 16 - //#define DOGLCD_MOSI 17 - //#define DOGLCD_SCK 23 - //#define DOGLCD_A0 LCD_PINS_DC + #define DOGLCD_A0 LCD_PINS_DC + #define DOGLCD_CS EXP1_04_PIN + #define DOGLCD_MOSI EXP1_03_PIN + #define DOGLCD_SCK EXP1_05_PIN #else - #define LCD_PINS_RS 16 - #define LCD_PINS_EN 17 - #define LCD_PINS_D4 23 - #define LCD_PINS_D5 25 - #define LCD_PINS_D6 27 + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN #endif - #define LCD_PINS_D7 29 + #define LCD_PINS_D7 EXP1_08_PIN #if !IS_NEWPANEL - #define BEEPER_PIN 33 + #define BEEPER_PIN EXP2_05_PIN #endif #endif @@ -341,13 +508,17 @@ // Buttons attached to a shift register // Not wired yet //#define SHIFT_CLK_PIN 38 - //#define SHIFT_LD_PIN 42 - //#define SHIFT_OUT_PIN 40 - //#define SHIFT_EN_PIN 17 + //#define SHIFT_LD_PIN AUX2_08 + //#define SHIFT_OUT_PIN AUX2_06 + //#define SHIFT_EN_PIN EXP1_03_PIN #endif #endif + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + // // LCD Display input pins // @@ -355,215 +526,268 @@ #if IS_RRD_SC - #define BEEPER_PIN 37 + #define BEEPER_PIN EXP1_01_PIN #if ENABLED(CR10_STOCKDISPLAY) - // TO TEST - //#define BTN_EN1 17 - //#define BTN_EN2 23 + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN #else - #define BTN_EN1 31 - #define BTN_EN2 33 - #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder - #endif + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #endif - #define BTN_ENC 35 + #define BTN_ENC EXP1_02_PIN #ifndef SD_DETECT_PIN - #define SD_DETECT_PIN 49 + #define SD_DETECT_PIN EXP2_07_PIN + #endif + #ifndef KILL_PIN + #define KILL_PIN EXP2_08_PIN #endif - #define KILL_PIN 41 #if ENABLED(BQ_LCD_SMART_CONTROLLER) - //#define LCD_BACKLIGHT_PIN 39 // TO TEST + #define LCD_BACKLIGHT_PIN AUX4_08 // Probably a slightly different adapter from RRD SC #endif #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - // TO TEST - //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 - //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 - //#define BTN_ENC 55 - //#define SD_DETECT_PIN 42 + #define BTN_EN1 AUX2_05 + #define BTN_EN2 AUX2_03 + #define BTN_ENC AUX2_04 + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN AUX2_08 + #endif #elif ENABLED(LCD_I2C_PANELOLU2) - // TO TEST - //#define BTN_EN1 47 - //#define BTN_EN2 43 - //#define BTN_ENC 32 - //#define LCD_SDSS SDSS - //#define KILL_PIN 41 + #define BTN_EN1 AUX4_04 + #define BTN_EN2 AUX4_06 + #define BTN_ENC AUX4_03 + #define LCD_SDSS SDSS + #define KILL_PIN AUX4_07 #elif ENABLED(LCD_I2C_VIKI) - // TO TEST - //#define BTN_EN1 40 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - //#define BTN_EN2 42 - //#define BTN_ENC -1 + #define BTN_EN1 AUX2_06 // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains AUX2-06 and AUX2-08. + #define BTN_EN2 AUX2_08 + #define BTN_ENC -1 - //#define LCD_SDSS SDSS - //#define SD_DETECT_PIN 49 + #define LCD_SDSS SDSS + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #endif #elif ANY(VIKI2, miniVIKI) - // TO TEST - //#define DOGLCD_CS 45 - //#define DOGLCD_A0 44 + #define DOGLCD_CS AUX4_05 + #define DOGLCD_A0 AUX2_07 + #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 - //#define BEEPER_PIN 33 - //#define STAT_LED_RED_PIN 32 - //#define STAT_LED_BLUE_PIN 35 + #define BEEPER_PIN EXP2_05_PIN + #define STAT_LED_RED_PIN AUX4_03 + #define STAT_LED_BLUE_PIN EXP1_02_PIN - //#define BTN_EN1 22 - //#define BTN_EN2 7 - //#define BTN_ENC 39 + #define BTN_EN1 22 + #define BTN_EN2 7 + #define BTN_ENC AUX4_08 - //#define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board - //#define KILL_PIN 31 - - //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board + #endif + #define KILL_PIN EXP2_03_PIN #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - // TO TEST - //#define DOGLCD_CS 29 - //#define DOGLCD_A0 27 + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN - //#define BEEPER_PIN 23 - //#define LCD_BACKLIGHT_PIN 33 + #define BEEPER_PIN EXP1_05_PIN + #define LCD_BACKLIGHT_PIN EXP2_05_PIN - //#define BTN_EN1 35 - //#define BTN_EN2 37 - //#define BTN_ENC 31 + #define BTN_EN1 EXP1_02_PIN + #define BTN_EN2 EXP1_01_PIN + #define BTN_ENC EXP2_03_PIN - //#define LCD_SDSS SDSS - //#define SD_DETECT_PIN 49 - //#define KILL_PIN 41 + #define LCD_SDSS SDSS + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #endif + #define KILL_PIN EXP2_08_PIN #elif ANY(MKS_MINI_12864, FYSETC_MINI_12864) - // TO TEST - //#define BEEPER_PIN 37 - //#define BTN_ENC 35 - //#define SD_DETECT_PIN 49 + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #endif - //#ifndef KILL_PIN - // #define KILL_PIN 41 - //#endif + #ifndef KILL_PIN + #define KILL_PIN EXP2_08_PIN + #endif #if ENABLED(MKS_MINI_12864) - // TO TEST - //#define DOGLCD_A0 27 - //#define DOGLCD_CS 25 + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN // not connected to a pin - //#define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) + #define LCD_BACKLIGHT_PIN -1 // 65 (MKS mini12864 can't adjust backlight by software!) - //#define BTN_EN1 31 - //#define BTN_EN2 33 - - //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #elif ENABLED(FYSETC_MINI_12864) - // From https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 + // From https://wiki.fysetc.com/Mini12864_Panel/ - // TO TEST - //#define DOGLCD_A0 16 - //#define DOGLCD_CS 17 + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_03_PIN - //#define BTN_EN1 33 - //#define BTN_EN2 31 + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_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 ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN - // TO TEST - //#define RGB_LED_R_PIN 25 + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - // TO TEST - //#define RGB_LED_G_PIN 27 + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - // TO TEST - //#define RGB_LED_B_PIN 29 + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - // TO TEST - //#define NEOPIXEL_PIN 25 + #define NEOPIXEL_PIN EXP1_06_PIN #endif #endif #elif ENABLED(MINIPANEL) - // TO TEST - //#define BEEPER_PIN 42 - // not connected to a pin - //#define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) + #define BEEPER_PIN AUX2_08 + #define LCD_BACKLIGHT_PIN AUX2_10 - //#define DOGLCD_A0 44 - //#define DOGLCD_CS 58 // Mega/Due:66 - AGCM4:58 + #define DOGLCD_A0 AUX2_07 + #define DOGLCD_CS AUX2_09 - //#define BTN_EN1 40 - //#define BTN_EN2 55 // Mega/Due:63 - AGCM4:55 - //#define BTN_ENC 72 // Mega/Due:59 - AGCM4:72 + #define BTN_EN1 AUX2_06 + #define BTN_EN2 AUX2_04 + #define BTN_ENC AUX2_03 - //#define SD_DETECT_PIN 49 - //#define KILL_PIN 56 // Mega/Due:64 - AGCM4:56 - - //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN AUX3_02 + #endif + #define KILL_PIN AUX2_05 #elif ENABLED(ZONESTAR_LCD) - // TO TEST - //#define ADC_KEYPAD_PIN 12 + #define ADC_KEYPAD_PIN 12 #elif ENABLED(AZSMZ_12864) - // TO TEST + // TODO + + #elif ENABLED(G3D_PANEL) + + #define BEEPER_PIN EXP1_01_PIN + + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #endif + #define KILL_PIN EXP2_08_PIN + + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_PIN + #define BTN_ENC EXP1_02_PIN + + #elif IS_TFTGLCD_PANEL + + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #endif #else - // Beeper on AUX-4 - //#define BEEPER_PIN 33 + #define BEEPER_PIN EXP2_05_PIN - // Buttons are directly attached to AUX-2 - #if IS_RRW_KEYPAD - // TO TEST - //#define SHIFT_OUT_PIN 40 - //#define SHIFT_CLK_PIN 44 - //#define SHIFT_LD_PIN 42 - //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 - //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 - //#define BTN_ENC 55 // Mega/Due:63 - AGCM4:55 - #elif ENABLED(PANEL_ONE) - // TO TEST - //#define BTN_EN1 72 // AUX2 PIN 3 (Mega/Due:59 - AGCM4:72) - //#define BTN_EN2 55 // AUX2 PIN 4 (Mega/Due:63 - AGCM4:55) - //#define BTN_ENC 49 // AUX3 PIN 7 + #if ENABLED(PANEL_ONE) // Buttons connect directly to AUX-2 + #define BTN_EN1 AUX2_03 + #define BTN_EN2 AUX2_04 + #define BTN_ENC AUX3_02 #else - // TO TEST - //#define BTN_EN1 37 - //#define BTN_EN2 35 - //#define BTN_ENC 31 - #endif - - #if ENABLED(G3D_PANEL) - // TO TEST - //#define SD_DETECT_PIN 49 - //#define KILL_PIN 41 + #define BTN_EN1 EXP1_01_PIN + #define BTN_EN2 EXP1_02_PIN + #define BTN_ENC EXP2_03_PIN #endif #endif #endif // IS_NEWPANEL -#endif // HAS_WIRED_LCD +#endif // HAS_WIRED_LCD && !LCD_PINS_DEFINED + +#if IS_RRW_KEYPAD && !HAS_ADC_BUTTONS + #define SHIFT_OUT_PIN AUX2_06 + #define SHIFT_CLK_PIN AUX2_07 + #define SHIFT_LD_PIN AUX2_08 + #ifndef BTN_EN1 + #define BTN_EN1 AUX2_05 + #endif + #ifndef BTN_EN2 + #define BTN_EN2 AUX2_03 + #endif + #ifndef BTN_ENC + #define BTN_ENC AUX2_04 + #endif +#endif + +#if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) + + CONTROLLER_WARNING("RAMPS_144", "LCD_FYSETC_TFT81050") + + /** + * FYSETC TFT-81050 display pinout + * + * Board Display + * ------ ------ + * (MISO) 50 | 1 2 | 52 (SCK) 5V |10 9 | GND + * (LCD_CS) 33 | 3 4 | 53 (SD_CS) RESET | 8 7 | (SD_DET) + * 31 5 6 | 51 (MOSI) (MOSI) 6 5 | (LCD_CS) + * (SD_DET) 49 | 7 8 | RESET (SD_CS) | 4 3 | (MOD_RESET) + * GND | 9 10 | -- (SCK) | 2 1 | (MISO) + * ------ ------ + * EXP2 EXP1 + * + * Needs custom cable: + * + * Board Adapter Display + * ---------------------------------- + * EXP2-1 <--diode--- EXP1-1 MISO + * EXP2-2 ----------- EXP1-2 SCK + * EXP2-4 ----------- EXP1-3 MOD_RST + * EXP2-4 ----------- EXP1-4 SD_CS + * EXP2-3 ----------- EXP1-5 LCD_CS + * EXP2-6 ----------- EXP1-6 MOSI + * EXP2-7 ----------- EXP1-7 SD DET + * EXP2-8 ----------- EXP1-8 RESET + * EXP2-1 ----------- EXP1-9 MISO->GND + * EXP1-10 ---------- EXP1-10 5V + * + * NOTE: The MISO pin should not get a 5V signal. + * To fix, insert a 1N4148 diode in the MISO line. + */ + + #define BEEPER_PIN EXP1_01_PIN + + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #endif + + #define CLCD_MOD_RESET EXP2_05_PIN + #define CLCD_SPI_CS EXP2_03_PIN + +#endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050 diff --git a/Marlin/src/pins/sanguino/pins_ANET_10.h b/Marlin/src/pins/sanguino/pins_ANET_10.h index 9a217d9b4e..ee9fa32774 100644 --- a/Marlin/src/pins/sanguino/pins_ANET_10.h +++ b/Marlin/src/pins/sanguino/pins_ANET_10.h @@ -23,8 +23,7 @@ /** * Anet V1.0 board pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Anet%20V1.0/ANET3D_Board_Schematic.pdf - * Origin: https://github.com/ralf-e/ANET-3D-Board-V1.0/blob/master/ANET3D_Board_Schematic.pdf + * Schematic: https://github.com/ralf-e/ANET-3D-Board-V1.0/blob/master/ANET3D_Board_Schematic.pdf */ /** @@ -162,31 +161,29 @@ * Connector pinouts * * ------ ------ ---- - * (SDA) D17 | 1 2 | (A1) D30 3V3 | 1 2 | D4 (SS) J3_RX |1 2| J3_TX - * (SCL) D16 | 3 4 | (A2) D29 GND | 3 4 | RESET (TXO) D9 |3 4| D8 (RX0) D8 - * D11 | 5 6 (A3) D28 (MOSI) D5 | 5 6 D7 (SCK) USB_RX |5 6| USB_TX - * D10 | 7 8 | (A4) D27 D10 5V | 7 8 | D6 (MISO) ---- - * 5V | 9 10 | GND J3_RX | 9 10 | J3_TX + * (SDA) 17 | 1 2 | 30 (A1) 3V3 | 1 2 | 4 (SS) J3_RX |1 2| J3_TX + * (SCL) 16 | 3 4 | 29 (A2) GND | 3 4 | RESET (TXO) 9 |3 4| 8 (RX0) + * 11 | 5 6 28 (A3) (MOSI) 5 | 5 6 7 (SCK) USB_RX |5 6| USB_TX + * 10 | 7 8 | 27 (A4) 5V | 7 8 | 6 (MISO) ---- + * 5V | 9 10 | GND J3_RX | 9 10 | J3_TX USB_BLE * ------ ------ - * LCD J3 USB_BLE + * LCD J3 */ - -#define EXP1_01_PIN 17 -#define EXP1_02_PIN 30 -#define EXP1_03_PIN 16 -#define EXP1_04_PIN 29 -#define EXP1_05_PIN 11 -#define EXP1_06_PIN 28 -#define EXP1_07_PIN 10 -#define EXP1_08_PIN 27 -#define EXP1_09_PIN -1 // 5V -#define EXP1_10_PIN -1 // GND +#define EXP1_01_PIN 17 // BEEPER / ENC +#define EXP1_02_PIN 30 // LCD_D4 / SERVO +#define EXP1_03_PIN 16 // ENC / LCD_EN +#define EXP1_04_PIN 29 // SERVO / LCD_RS +#define EXP1_05_PIN 11 // EN1 / LCD_D4 +#define EXP1_06_PIN 28 // LCD_EN / EN1 +#define EXP1_07_PIN 10 // EN2 +#define EXP1_08_PIN 27 // LCD_RS / BEEPER /** * LCD / Controller * * Only the following displays are supported: * ZONESTAR_LCD + * ANET_FULL_GRAPHICS_LCD * CTC_A10S_A13 * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER */ diff --git a/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h b/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h index 1cbafab432..c88b666f6c 100644 --- a/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h +++ b/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h @@ -23,8 +23,7 @@ /** * Azteeg X1 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X1/Azteeg_X1_schematics.pdf - * Origin: https://reprap.org/mediawiki/images/0/07/Azteeg_X1_schematics.pdf + * Schematic: https://reprap.org/mediawiki/images/0/07/Azteeg_X1_schematics.pdf */ #define BOARD_INFO_NAME "Azteeg X1" diff --git a/Marlin/src/pins/sanguino/pins_GEN6.h b/Marlin/src/pins/sanguino/pins_GEN6.h index 4a6136e081..3fb1671b73 100644 --- a/Marlin/src/pins/sanguino/pins_GEN6.h +++ b/Marlin/src/pins/sanguino/pins_GEN6.h @@ -23,8 +23,7 @@ /** * Gen6 pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen6/GEN6_Mendel_Circuit.pdf - * Origin: https://reprap.org/mediawiki/images/0/0f/GEN6_Mendel_Circuit.pdf + * Schematic: https://reprap.org/mediawiki/images/0/0f/GEN6_Mendel_Circuit.pdf */ /** diff --git a/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h b/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h index 9c63570620..476375203c 100644 --- a/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h +++ b/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h @@ -48,7 +48,6 @@ * Once installed select the SANGUINO board and then select the CPU. */ - #define BOARD_INFO_NAME "Gen6 Deluxe" #include "pins_GEN6.h" diff --git a/Marlin/src/pins/sanguino/pins_GEN7_12.h b/Marlin/src/pins/sanguino/pins_GEN7_12.h index 0bf65c37cd..5030666245 100644 --- a/Marlin/src/pins/sanguino/pins_GEN7_12.h +++ b/Marlin/src/pins/sanguino/pins_GEN7_12.h @@ -23,14 +23,10 @@ /** * Gen7 v1.1, v1.2, v1.3 pin assignments - * Schematic (1.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.1/Gen7Board%20Schematic.pdf - * Origin (1.1): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.1/release%20documents/Gen7Board%20Schematic.pdf - * Schematic (1.2): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.2/Gen7Board%20Schematic.pdf - * Origin (1.2): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.2/release%20documents/Gen7Board%20Schematic.pdf - * Schematic (1.3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.3/Gen7Board%20Schematic.pdf - * Origin (1.3): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.3/release%20documents/Gen7Board%20Schematic.pdf - * Schematic (1.3.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.3.1/Gen7Board%20Schematic.pdf - * Origin (1.3.1): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.3.1/release%20documents/Gen7Board%20Schematic.pdf + * Schematic (1.1): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.1/release%20documents/Gen7Board%20Schematic.pdf + * Schematic (1.2): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.2/release%20documents/Gen7Board%20Schematic.pdf + * Schematic (1.3): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.3/release%20documents/Gen7Board%20Schematic.pdf + * Schematic (1.3.1): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.3.1/release%20documents/Gen7Board%20Schematic.pdf */ /** diff --git a/Marlin/src/pins/sanguino/pins_GEN7_14.h b/Marlin/src/pins/sanguino/pins_GEN7_14.h index db80c45eee..10e5784966 100644 --- a/Marlin/src/pins/sanguino/pins_GEN7_14.h +++ b/Marlin/src/pins/sanguino/pins_GEN7_14.h @@ -23,10 +23,8 @@ /** * Gen7 v1.4 pin assignments - * Schematic (1.4): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.4/Gen7Board%201.4%20Schematic.pdf - * Origin (1.4): https://github.com/Traumflug/Generation_7_Electronics/blob/Gen7Board-1.4/release%20documents/Gen7Board%201.4%20Schematic.pdf - * Schematic (1.4.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.4.1/Gen7Board%201.4.1%20Schematic.pdf - * Origin (1.4.1): https://github.com/Traumflug/Generation_7_Electronics/blob/Gen7Board-1.4.1/release%20documents/Gen7Board%201.4.1%20Schematic.pdf + * Schematic (1.4): https://github.com/Traumflug/Generation_7_Electronics/blob/Gen7Board-1.4/release%20documents/Gen7Board%201.4%20Schematic.pdf + * Schematic (1.4.1): https://github.com/Traumflug/Generation_7_Electronics/blob/Gen7Board-1.4.1/release%20documents/Gen7Board%201.4.1%20Schematic.pdf */ /** diff --git a/Marlin/src/pins/sanguino/pins_MELZI.h b/Marlin/src/pins/sanguino/pins_MELZI.h index a0c7050a91..27df72d922 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI.h +++ b/Marlin/src/pins/sanguino/pins_MELZI.h @@ -23,8 +23,7 @@ /** * Melzi pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Melzi/schematic.pdf - * Origin: https://github.com/mosfet/melzi/blob/master/melzi.sch + * Schematic: https://github.com/mosfet/melzi/blob/master/melzi.sch */ #ifndef BOARD_INFO_NAME diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index e391cd1020..ba3c6767b2 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -23,8 +23,7 @@ /** * Melzi (Creality) pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Melzi%20(Creality)/CR-10%20Schematic.pdf - * Origin: https://github.com/Creality3DPrinting/CR10-Melzi-1.1.2/blob/master/Circuit%20diagram/Motherboard/CR-10%20Schematic.pdf + * Schematic: https://github.com/Creality3DPrinting/CR10-Melzi-1.1.2/blob/master/Circuit%20diagram/Motherboard/CR-10%20Schematic.pdf * ATmega1284P * * The Creality board needs a bootloader installed before Marlin can be uploaded. @@ -38,6 +37,50 @@ #define BOARD_INFO_NAME "Melzi (Creality)" +/** ------ + * 27 | 1 2 | 16 + * 11 | 3 4 | RESET + * 10 5 6 | 30 + * 28 | 7 8 | 17 + * GND | 9 10 | 5V + * ------ + * EXP1 + */ +#define EXP1_01_PIN 27 // BEEP +#define EXP1_02_PIN 16 // ENC +#define EXP1_03_PIN 11 // EN1 +#define EXP1_04_PIN -1 // RESET +#define EXP1_05_PIN 10 // EN2 +#define EXP1_06_PIN 30 // A0 / ST9720 CLK +#define EXP1_07_PIN 28 // CS / ST9720 CS +#define EXP1_08_PIN 17 // ST9720 DAT + +// +// LCD / Controller +// + +#if ANY(MKS_MINI_12864, CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) + #if ANY(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) + #define LCD_PINS_RS EXP1_07_PIN // ST9720 CS + #define LCD_PINS_EN EXP1_08_PIN // ST9720 DAT + #define LCD_PINS_D4 EXP1_06_PIN // ST9720 CLK + #endif + #if ANY(MKS_MINI_12864, ENDER2_STOCKDISPLAY) + #define DOGLCD_CS EXP1_07_PIN + #define DOGLCD_A0 EXP1_06_PIN + #endif + + #define LCD_SDSS 31 // Controller's SD card + + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + #define BEEPER_PIN EXP1_01_PIN + + #define LCD_PINS_DEFINED + +#endif + // Alter timing for graphical display #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 125 @@ -45,115 +88,65 @@ #define BOARD_ST7920_DELAY_3 125 #endif -/** - * EXP1 EXP1 as ENDER2 STOCKDISPLAY EXP1 as CR10 STOCKDISPLAY - * ------ ------ ------ - * D27 | 1 2 | D16 SCK | 1 2 | BTN_E BEEPER_PIN | 1 2 | BTN_ENC - * D11 | 3 4 | RESET BTN_EN1 | 3 4 | RESET BTN_EN1 | 3 4 | RESET - * D10 5 6 | D30 BTN_EN2 5 6 | LCD_A0 BTN_EN2 5 6 | LCD_D4 (ST9720 CLK) - * D28 | 7 8 | D17 LCD_CS | 7 8 | MOSI (ST9720 CS) LCD_RS | 7 8 | LCD_EN (ST9720 DAT) - * GND | 9 10 | 5V GND | 9 10 | 5V GND | 9 10 | 5V - * ------ ------ ------ - */ -#define EXP1_01_PIN 27 -#define EXP1_02_PIN 16 -#define EXP1_03_PIN 11 -#define EXP1_04_PIN -1 // RESET -#define EXP1_05_PIN 10 -#define EXP1_06_PIN 30 -#define EXP1_07_PIN 28 -#define EXP1_08_PIN 17 - -// -// LCD / Controller -// -#if ANY(MKS_MINI_12864, CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) - #if ENABLED(MKS_MINI_12864) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! MKS_MINI_12864 on MELZI_CREALITY requires wiring modifications. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif - #define DOGLCD_CS EXP1_07_PIN - #define DOGLCD_A0 EXP1_06_PIN - #elif ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_07_PIN // ST9720 CS - #define LCD_PINS_EN EXP1_08_PIN // ST9720 DAT - #define LCD_PINS_D4 EXP1_06_PIN // ST9720 CLK - #define BEEPER_PIN EXP1_01_PIN - #elif ENABLED(ENDER2_STOCKDISPLAY) - #define DOGLCD_CS EXP1_07_PIN - #define DOGLCD_A0 EXP1_06_PIN - #define DOGLCD_SCK EXP1_01_PIN - #define DOGLCD_MOSI EXP1_08_PIN - #define FORCE_SOFT_SPI - #endif - #define BTN_ENC EXP1_02_PIN - #define BTN_EN1 EXP1_03_PIN - #define BTN_EN2 EXP1_05_PIN - #define LCD_SDSS 31 // Controller's SD card - #define LCD_PINS_DEFINED -#endif - #include "pins_MELZI.h" // ... SANGUINOLOLU_12 ... SANGUINOLOLU_11 #if ENABLED(BLTOUCH) #ifndef SERVO0_PIN #define SERVO0_PIN EXP1_01_PIN #endif - #if SERVO0_PIN == BEEPER_PIN - #undef BEEPER_PIN - #endif #elif HAS_FILAMENT_SENSOR #ifndef FIL_RUNOUT_PIN #define FIL_RUNOUT_PIN EXP1_01_PIN #endif - #if FIL_RUNOUT_PIN == BEEPER_PIN - #undef BEEPER_PIN - #endif +#endif +#if PIN_EXISTS(BEEPER) && (SERVO0_PIN == BEEPER_PIN || FIL_RUNOUT_PIN == BEEPER_PIN) + #undef BEEPER_PIN + #define BEEPER_PIN -1 #endif /** - PIN: 0 Port: B0 E0_DIR_PIN protected - PIN: 1 Port: B1 E0_STEP_PIN protected - PIN: 2 Port: B2 Z_DIR_PIN protected - PIN: 3 Port: B3 Z_STEP_PIN protected - PIN: 4 Port: B4 AVR_SS_PIN protected - . FAN0_PIN protected - . SD_SS_PIN protected - PIN: 5 Port: B5 AVR_MOSI_PIN Output = 1 - . SD_MOSI_PIN Output = 1 - PIN: 6 Port: B6 AVR_MISO_PIN Input = 0 TIMER3A PWM: 0 WGM: 1 COM3A: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 - . SD_MISO_PIN Input = 0 - PIN: 7 Port: B7 AVR_SCK_PIN Output = 0 TIMER3B PWM: 0 WGM: 1 COM3B: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 - . SD_SCK_PIN Output = 0 - PIN: 8 Port: D0 RXD Input = 1 - PIN: 9 Port: D1 TXD Input = 0 - PIN: 10 Port: D2 BTN_EN2 Input = 1 - PIN: 11 Port: D3 BTN_EN1 Input = 1 - PIN: 12 Port: D4 HEATER_BED_PIN protected - PIN: 13 Port: D5 HEATER_0_PIN protected - PIN: 14 Port: D6 E0_ENABLE_PIN protected - . X_ENABLE_PIN protected - . Y_ENABLE_PIN protected - PIN: 15 Port: D7 X_STEP_PIN protected - PIN: 16 Port: C0 BTN_ENC Input = 1 - . SCL Input = 1 - PIN: 17 Port: C1 LCD_PINS_EN Output = 0 - . SDA Output = 0 - PIN: 18 Port: C2 X_MIN_PIN protected - . X_STOP_PIN protected - PIN: 19 Port: C3 Y_MIN_PIN protected - . Y_STOP_PIN protected - PIN: 20 Port: C4 Z_MIN_PIN protected - . Z_STOP_PIN protected - PIN: 21 Port: C5 X_DIR_PIN protected - PIN: 22 Port: C6 Y_STEP_PIN protected - PIN: 23 Port: C7 Y_DIR_PIN protected - PIN: 24 Port: A7 TEMP_0_PIN protected - PIN: 25 Port: A6 TEMP_BED_PIN protected - PIN: 26 Port: A5 Z_ENABLE_PIN protected - PIN: 27 Port: A4 BEEPER_PIN Output = 0 - PIN: 28 Port: A3 LCD_PINS_RS Output = 0 - PIN: 29 Port: A2 Input = 0 - PIN: 30 Port: A1 LCD_PINS_D4 Output = 1 - PIN: 31 Port: A0 SDSS Output = 1 + PIN: 0 Port: B0 E0_DIR_PIN protected + PIN: 1 Port: B1 E0_STEP_PIN protected + PIN: 2 Port: B2 Z_DIR_PIN protected + PIN: 3 Port: B3 Z_STEP_PIN protected + PIN: 4 Port: B4 AVR_SS_PIN protected + . FAN0_PIN protected + . SD_SS_PIN protected + PIN: 5 Port: B5 AVR_MOSI_PIN Output = 1 + . SD_MOSI_PIN Output = 1 + PIN: 6 Port: B6 AVR_MISO_PIN Input = 0 TIMER3A PWM: 0 WGM: 1 COM3A: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 + . SD_MISO_PIN Input = 0 + PIN: 7 Port: B7 AVR_SCK_PIN Output = 0 TIMER3B PWM: 0 WGM: 1 COM3B: 0 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0 + . SD_SCK_PIN Output = 0 + PIN: 8 Port: D0 RXD Input = 1 + PIN: 9 Port: D1 TXD Input = 0 + PIN: 10 Port: D2 BTN_EN2 Input = 1 + PIN: 11 Port: D3 BTN_EN1 Input = 1 + PIN: 12 Port: D4 HEATER_BED_PIN protected + PIN: 13 Port: D5 HEATER_0_PIN protected + PIN: 14 Port: D6 E0_ENABLE_PIN protected + . X_ENABLE_PIN protected + . Y_ENABLE_PIN protected + PIN: 15 Port: D7 X_STEP_PIN protected + PIN: 16 Port: C0 BTN_ENC Input = 1 + . SCL Input = 1 + PIN: 17 Port: C1 LCD_PINS_EN Output = 0 + . SDA Output = 0 + PIN: 18 Port: C2 X_MIN_PIN protected + . X_STOP_PIN protected + PIN: 19 Port: C3 Y_MIN_PIN protected + . Y_STOP_PIN protected + PIN: 20 Port: C4 Z_MIN_PIN protected + . Z_STOP_PIN protected + PIN: 21 Port: C5 X_DIR_PIN protected + PIN: 22 Port: C6 Y_STEP_PIN protected + PIN: 23 Port: C7 Y_DIR_PIN protected + PIN: 24 Port: A7 TEMP_0_PIN protected + PIN: 25 Port: A6 TEMP_BED_PIN protected + PIN: 26 Port: A5 Z_ENABLE_PIN protected + PIN: 27 Port: A4 BEEPER_PIN Output = 0 + PIN: 28 Port: A3 LCD_PINS_RS Output = 0 + PIN: 29 Port: A2 Input = 0 + PIN: 30 Port: A1 LCD_PINS_D4 Output = 1 + PIN: 31 Port: A0 SDSS Output = 1 */ diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h index b36c7140c4..dd557265c4 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h @@ -56,6 +56,7 @@ // // LCD / Controller // + #if ANY(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) #if ENABLED(CR10_STOCKDISPLAY) #if HAS_MEDIA diff --git a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h index 323ecaa029..dc1ea950a7 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h @@ -29,12 +29,13 @@ #define BOARD_INFO_NAME "Melzi (Malyan)" #if ENABLED(CR10_STOCKDISPLAY) + #define BTN_ENC 28 + #define BTN_EN1 30 + #define BTN_EN2 29 + #define LCD_PINS_RS 17 // ST9720 CS #define LCD_PINS_EN 16 // ST9720 DAT #define LCD_PINS_D4 11 // ST9720 CLK - #define BTN_EN1 30 - #define BTN_EN2 29 - #define BTN_ENC 28 #define LCD_PINS_DEFINED #endif diff --git a/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h index 7e4cc22bbe..99cdfd0b42 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h @@ -33,15 +33,17 @@ #define LCD_SDSS -1 #if ANY(CR10_STOCKDISPLAY, LCD_FOR_MELZI) + #define BTN_ENC 26 + #define BTN_EN1 10 + #define BTN_EN2 11 + #define LCD_PINS_RS 30 #define LCD_PINS_EN 28 #define LCD_PINS_D4 16 + #define LCD_PINS_D5 17 #define LCD_PINS_D6 27 #define LCD_PINS_D7 29 - #define BTN_EN1 10 - #define BTN_EN2 11 - #define BTN_ENC 26 #define LCD_PINS_DEFINED #endif diff --git a/Marlin/src/pins/sanguino/pins_MELZI_V2.h b/Marlin/src/pins/sanguino/pins_MELZI_V2.h index 2cd949e095..d90cd01af2 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_V2.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_V2.h @@ -23,8 +23,9 @@ /** * Melzi V2.0 as found at https://www.reprap.org/wiki/Melzi - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Melzi%20V2/Melzi-circuit.png - * Origin: https://www.reprap.org/mediawiki/images/7/7d/Melzi-circuit.png + * Schematic: https://www.reprap.org/mediawiki/images/7/7d/Melzi-circuit.png + * + * ATmega644P */ #define BOARD_INFO_NAME "Melzi V2" diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h index 05c3022994..74d2b5549b 100644 --- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h @@ -23,16 +23,11 @@ /** * Sanguinololu board pin assignments - * Schematic (0.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v0.1/schematic.png - * Origin (0.1): https://github.com/mosfet/Sanguinololu/blob/master/rev0.1/sanguinololu.sch - * Schematic (0.6): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v0.6/schematic.jpg - * Origin (0.6): https://github.com/mosfet/Sanguinololu/blob/master/rev0.6/images/schematic.jpg - * Schematic (0.7): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v0.7/schematic.jpg - * Origin (0.7): https://github.com/mosfet/Sanguinololu/blob/master/rev0.7/images/schematic.jpg - * Schematic (1.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v1.0/Sanguinololu-schematic.jpg - * Origin (1.0): https://reprap.org/wiki/File:Sanguinololu-schematic.jpg - * Schematic (1.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v1.1/schematic.png - * Origin (1.1): https://github.com/mosfet/Sanguinololu/blob/master/rev1.1/sanguinololu.sch + * Schematic (0.1): https://github.com/mosfet/Sanguinololu/blob/master/rev0.1/sanguinololu.sch + * Schematic (0.6): https://github.com/mosfet/Sanguinololu/blob/master/rev0.6/images/schematic.jpg + * Schematic (0.7): https://github.com/mosfet/Sanguinololu/blob/master/rev0.7/images/schematic.jpg + * Schematic (1.0): https://reprap.org/wiki/File:Sanguinololu-schematic.jpg + * Schematic (1.1): https://github.com/mosfet/Sanguinololu/blob/master/rev1.1/sanguinololu.sch */ /** @@ -112,6 +107,10 @@ #define Z_ENABLE_PIN 4 #endif #define E0_ENABLE_PIN 4 +#else + #if !HAS_CUTTER && !ALL(HAS_WIRED_LCD, IS_NEWPANEL) // Use IO Header + #define CASE_LIGHT_PIN 4 // Hardware PWM - see if IO Header is available + #endif #endif // @@ -125,16 +124,12 @@ * Sanguino libraries! See #368. */ //#define SDSS 24 -#define SDSS 31 +#define SDSS AUX1_09 #if IS_MELZI - #define LED_PIN 27 + #define LED_PIN AUX1_01 #elif MB(STB_11) - #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED -#endif - -#if !HAS_CUTTER && ENABLED(SANGUINOLOLU_V_1_2) && !ALL(HAS_WIRED_LCD, IS_NEWPANEL) // try to use IO Header - #define CASE_LIGHT_PIN 4 // Hardware PWM - see if IO Header is available + #define LCD_BACKLIGHT_PIN AUX1_04 // LCD backlight LED #endif /** @@ -145,11 +140,26 @@ * GND GND D31 D30 D29 D28 D27 * A4 A3 A2 A1 A0 */ +#define AUX1_01 27 // A0 +#define AUX1_02 16 // SCL +#define AUX1_03 28 // A1 +#define AUX1_04 17 // SDA +#define AUX1_05 29 // A2 +#define AUX1_06 10 // RX1 +#define AUX1_07 30 // A3 +#define AUX1_08 11 // TX1 +#define AUX1_09 31 // A4 +#define AUX1_10 12 // PWM // // LCD / Controller // -#if HAS_WIRED_LCD && DISABLED(LCD_PINS_DEFINED) + +#ifdef LCD_PINS_DEFINED + + // LCD pins already defined by including header + +#elif HAS_WIRED_LCD #define SD_DETECT_PIN -1 @@ -157,49 +167,53 @@ #if ENABLED(LCD_FOR_MELZI) - #define LCD_PINS_RS 17 - #define LCD_PINS_EN 16 - #define LCD_PINS_D4 11 - #define KILL_PIN 10 - #define BEEPER_PIN 27 + #define LCD_PINS_RS AUX1_04 + #define LCD_PINS_EN AUX1_02 + #define LCD_PINS_D4 AUX1_08 + #define KILL_PIN AUX1_06 + #define BEEPER_PIN AUX1_01 #elif IS_U8GLIB_ST7920 // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0 #if IS_MELZI - #define LCD_PINS_RS 30 // CS chip select /SS chip slave select - #define LCD_PINS_EN 29 // SID (MOSI) - #define LCD_PINS_D4 17 // SCK (CLK) clock + #define LCD_PINS_RS AUX1_07 // CS chip select /SS chip slave select + #define LCD_PINS_EN AUX1_05 // SID (MOSI) + #define LCD_PINS_D4 AUX1_04 // SCK (CLK) clock // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with // Marlin so this can be used for BEEPER_PIN. You can use this pin // with M42 instead of BEEPER_PIN. - #define BEEPER_PIN 27 + #define BEEPER_PIN AUX1_01 #else // Sanguinololu >=1.3 #define LCD_PINS_RS 4 - #define LCD_PINS_EN 17 - #define LCD_PINS_D4 30 - #define LCD_PINS_D5 29 - #define LCD_PINS_D6 28 - #define LCD_PINS_D7 27 + #define LCD_PINS_EN AUX1_04 + #define LCD_PINS_D4 AUX1_07 + #define LCD_PINS_D5 AUX1_05 + #define LCD_PINS_D6 AUX1_03 + #define LCD_PINS_D7 AUX1_01 #endif #else - #define DOGLCD_A0 30 + #define DOGLCD_A0 AUX1_07 #if ENABLED(MAKRPANEL) - #define BEEPER_PIN 29 - #define DOGLCD_CS 17 - #define LCD_BACKLIGHT_PIN 28 // PA3 + #define BEEPER_PIN AUX1_05 + #define DOGLCD_CS AUX1_04 + #define LCD_BACKLIGHT_PIN AUX1_03 // PA3 #elif IS_MELZI - #define BEEPER_PIN 27 - #define DOGLCD_CS 28 + #define BEEPER_PIN AUX1_01 + #ifndef DOGLCD_CS + #define DOGLCD_CS AUX1_03 + #endif - #else // !MAKRPANEL + #else - #define DOGLCD_CS 29 + #ifndef DOGLCD_CS + #define DOGLCD_CS AUX1_05 + #endif #endif @@ -209,29 +223,29 @@ #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards - #define LCD_PINS_RS 28 - #define LCD_PINS_EN 29 - #define LCD_PINS_D4 10 - #define LCD_PINS_D5 11 - #define LCD_PINS_D6 16 - #define LCD_PINS_D7 17 + #define LCD_PINS_RS AUX1_03 + #define LCD_PINS_EN AUX1_05 + #define LCD_PINS_D4 AUX1_06 + #define LCD_PINS_D5 AUX1_08 + #define LCD_PINS_D6 AUX1_02 + #define LCD_PINS_D7 AUX1_04 #else #define LCD_PINS_RS 4 - #define LCD_PINS_EN 17 - #define LCD_PINS_D4 30 - #define LCD_PINS_D5 29 - #define LCD_PINS_D6 28 - #define LCD_PINS_D7 27 + #define LCD_PINS_EN AUX1_04 + #define LCD_PINS_D4 AUX1_07 + #define LCD_PINS_D5 AUX1_05 + #define LCD_PINS_D6 AUX1_03 + #define LCD_PINS_D7 AUX1_01 #endif #if ENABLED(LCD_FOR_MELZI) - #define BTN_ENC 28 - #define BTN_EN1 29 - #define BTN_EN2 30 + #define BTN_ENC AUX1_03 + #define BTN_EN1 AUX1_05 + #define BTN_EN2 AUX1_07 #elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards @@ -242,26 +256,26 @@ #elif ENABLED(LCD_I2C_PANELOLU2) #if IS_MELZI - #define BTN_ENC 29 + #define BTN_ENC AUX1_05 #ifndef LCD_SDSS - #define LCD_SDSS 30 // Panelolu2 SD card reader rather than the Melzi + #define LCD_SDSS AUX1_07 // Panelolu2 SD card reader rather than the Melzi #endif #else - #define BTN_ENC 30 + #define BTN_ENC AUX1_07 #endif #else // !LCD_FOR_MELZI && !ZONESTAR_LCD && !LCD_I2C_PANELOLU2 - #define BTN_ENC 16 + #define BTN_ENC AUX1_02 #ifndef LCD_SDSS - #define LCD_SDSS 28 // Smart Controller SD card reader rather than the Melzi + #define LCD_SDSS AUX1_03 // Smart Controller SD card reader rather than the Melzi #endif #endif #if IS_NEWPANEL && !defined(BTN_EN1) - #define BTN_EN1 11 - #define BTN_EN2 10 + #define BTN_EN1 AUX1_08 + #define BTN_EN2 AUX1_06 #endif #endif // HAS_WIRED_LCD @@ -273,8 +287,8 @@ #if !MB(AZTEEG_X1) && ENABLED(SANGUINOLOLU_V_1_2) && !ALL(HAS_WIRED_LCD, IS_NEWPANEL) // try to use IO Header #define SPINDLE_LASER_PWM_PIN 4 // Hardware PWM - #define SPINDLE_LASER_ENA_PIN 10 // Pullup or pulldown! - #define SPINDLE_DIR_PIN 11 + #define SPINDLE_LASER_ENA_PIN AUX1_06 // Pullup or pulldown! + #define SPINDLE_DIR_PIN AUX1_08 #elif !MB(MELZI) // use X stepper motor socket @@ -300,7 +314,7 @@ * /RESET O| |O 1A * /SLEEP O| |O 1B * SPINDLE_LASER_PWM_PIN STEP O| |O VDD - * SPINDLE_LASER_ENA_PIN DIR O| |O GND + * SPINDLE_LASER_ENA_PIN DIR O| |O GND * ------- * * Note: Socket names vary from vendor to vendor. diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h index 37d1e7030b..a86f2382db 100644 --- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h @@ -23,12 +23,9 @@ /** * Sanguinololu V1.2 pin assignments - * Schematic (1.2): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v1.2/schematic.png - * Origin (1.2): https://github.com/mosfet/Sanguinololu/blob/master/rev1.2/sanguinololu.sch - * Schematic (1.3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v1.3/schematic.png - * Origin (1.3): https://github.com/mosfet/Sanguinololu/blob/master/rev1.3/sanguinololu.sch - * Schematic (1.3a): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v1.3a/schematic.png - * Origin (1.3a): https://github.com/mosfet/Sanguinololu/blob/master/rev1.3a/sanguinololu.sch + * Schematic (1.2): https://github.com/mosfet/Sanguinololu/blob/master/rev1.2/sanguinololu.sch + * Schematic (1.3): https://github.com/mosfet/Sanguinololu/blob/master/rev1.3/sanguinololu.sch + * Schematic (1.3a): https://github.com/mosfet/Sanguinololu/blob/master/rev1.3a/sanguinololu.sch * * Applies to the following boards: * diff --git a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h index 438acb79c7..39d55d1b28 100644 --- a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h +++ b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h @@ -31,8 +31,7 @@ /** * ZMIB pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/ZONESTAR%20ZMIB%20V2/ZMIB_V2_Schmatic.pdf - * Origin: https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZMIB/ZMIB%20V2/ZMIB_V2_Schmatic.pdf + * Schematic: https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZMIB/ZMIB%20V2/ZMIB_V2_Schmatic.pdf * * The ZMIB board needs a bootloader installed before Marlin can be uploaded. * If you don't have a chip programmer you can use a spare Arduino plus a few @@ -170,7 +169,7 @@ * (CS) D11 | 3 4 | D10 (DC/D4) * (EN2) D12 5 6 | D4 or D3 (EN/RS) * (ENC) D29 | 7 8 | D2 (EN1) - * (GND) | 9 10 | (5V) + * GND | 9 10 | 5V * ------ */ #define EXP1_01_PIN 5 @@ -193,9 +192,9 @@ #define LCDSCREEN_NAME "ZONESTAR_12864LCD" #define FORCE_SOFT_SPI //#define LCD_SDSS EXP1_03_PIN - #define LCD_PINS_RS EXP1_03_PIN // ST7920_CS_PIN (LCD module pin 4) - #define LCD_PINS_EN EXP1_06_PIN // ST7920_DAT_PIN (LCD module pin 5) - #define LCD_PINS_D4 EXP1_04_PIN // ST7920_CLK_PIN (LCD module pin 6) + #define LCD_PINS_RS EXP1_03_PIN // ST7920 CS (LCD-4) + #define LCD_PINS_EN EXP1_06_PIN // ST7920 DAT (LCD-5) + #define LCD_PINS_D4 EXP1_04_PIN // ST7920 CLK (LCD-6) #define BOARD_ST7920_DELAY_1 DELAY_2_NOP #define BOARD_ST7920_DELAY_2 DELAY_2_NOP diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h index 06646e2e59..725a3f9914 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h @@ -25,8 +25,9 @@ * BigTreeTech SKR CR-6 (STM32F103RET6) board pin assignments */ -#define DEFAULT_MACHINE_NAME "Creality3D" +#define DEFAULT_MACHINE_NAME "Creality CR-6 SE" #define BOARD_INFO_NAME "BTT SKR CR-6" +#define BOARD_WEBSITE_URL "github.com/bigtreetech/BIGTREETECH-SKR-CR6" #include "env_validate.h" @@ -120,6 +121,7 @@ // // LCD / Controller // + #if ENABLED(CR10_STOCKDISPLAY) #define BTN_ENC PA15 #define BTN_EN1 PA9 @@ -144,17 +146,21 @@ // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0 + #define X_SLAVE_ADDRESS 0 #endif #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 1 + #define Y_SLAVE_ADDRESS 1 #endif #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 2 + #define Z_SLAVE_ADDRESS 2 #endif #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 3 + #define E0_SLAVE_ADDRESS 3 #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_BTT_SKR_CR6."); + static_assert(Y_SLAVE_ADDRESS == 1, "Y_SLAVE_ADDRESS must be 1 for BOARD_BTT_SKR_CR6."); + static_assert(Z_SLAVE_ADDRESS == 2, "Z_SLAVE_ADDRESS must be 2 for BOARD_BTT_SKR_CR6."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_BTT_SKR_CR6."); #endif // @@ -176,8 +182,8 @@ // #define CASE_LIGHT_PIN PA13 -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PA8 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PA8 #endif #define SUICIDE_PIN PC13 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 b36ef2287a..a3794bf448 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -55,6 +55,13 @@ // #define Z_MIN_PROBE_PIN PC14 // PROBE +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -176,6 +183,19 @@ #define EXP1_07_PIN PB8 #define EXP1_08_PIN PB7 +/* ----- + * | 1 | RST + * | 2 | PA3 RX2 + * | 3 | PA2 TX2 + * | 4 | GND + * | 5 | 5V + * ----- + * TFT + */ + +#define TFT_02 PA3 +#define TFT_03 PA2 + #if HAS_WIRED_LCD #if ENABLED(CR10_STOCKDISPLAY) @@ -192,9 +212,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #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 + CONTROLLER_WARNING("BTT_SKR_E3_DIP", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN @@ -230,9 +248,8 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! FYSETC_MINI_12864_2_1 and it's clones require wiring modifications. See 'pins_BTT_SKR_MINI_E3_DIP.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_E3_DIP", "FYSETC_MINI_12864_2_1 and clones") + #if SD_CONNECTION_IS(LCD) #error "The LCD SD Card is not supported with this configuration." #endif @@ -298,9 +315,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #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 + CONTROLLER_WARNING("BTT_SKR_E3_DIP", "LCD_FYSETC_TFT81050") /** FYSETC TFT TFT81050 display pinout * @@ -340,9 +355,8 @@ #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050 // -// SD Support +// SD Card // - #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h index a09da02e15..7b780f7c9f 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h @@ -24,6 +24,7 @@ #include "pins_BTT_SKR_MINI_E3_common.h" #define BOARD_INFO_NAME "BTT SKR Mini E3 V1.0" +#define BOARD_WEBSITE_URL "github.com/bigtreetech/BIGTREETECH-SKR-mini-E3/tree/master/hardware/BIGTREETECH-SKR-mini-E3%20V1.0" /** * TMC220x stepper drivers @@ -37,15 +38,19 @@ // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0 + #define X_SLAVE_ADDRESS 0 #endif #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 2 + #define Y_SLAVE_ADDRESS 2 #endif #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 1 + #define Z_SLAVE_ADDRESS 1 #endif #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 3 + #define E0_SLAVE_ADDRESS 3 #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_BTT_SKR_MINI_E3_V1_0."); + static_assert(Y_SLAVE_ADDRESS == 2, "Y_SLAVE_ADDRESS must be 2 for BOARD_BTT_SKR_MINI_E3_V1_0."); + static_assert(Z_SLAVE_ADDRESS == 1, "Z_SLAVE_ADDRESS must be 1 for BOARD_BTT_SKR_MINI_E3_V1_0."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_BTT_SKR_MINI_E3_V1_0."); #endif diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h index c345a27b76..9209515b1a 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h @@ -25,8 +25,8 @@ #define BOARD_INFO_NAME "BTT SKR Mini E3 V1.2" -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PC7 // LED driving pin +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PC7 // LED driving pin #endif /** diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h index 7e6798deaf..d0f856b123 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h @@ -55,7 +55,13 @@ * ------ * EXP1 */ +#define EXP1_01_PIN PB5 #define EXP1_02_PIN PA15 +#define EXP1_03_PIN PA9 +#define EXP1_04_PIN -1 // RESET +#define EXP1_05_PIN PA10 +#define EXP1_06_PIN PB9 +#define EXP1_07_PIN PB8 #define EXP1_08_PIN PB15 #include "pins_BTT_SKR_MINI_E3_common.h" @@ -63,8 +69,8 @@ // Release PA13/PA14 (led, usb control) from SWD pins #define DISABLE_DEBUG -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PA8 // LED driving pin +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PA8 // LED driving pin #endif #ifndef PS_ON_PIN @@ -89,15 +95,34 @@ // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0 + #define X_SLAVE_ADDRESS 0 #endif #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 2 + #define Y_SLAVE_ADDRESS 2 #endif #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 1 + #define Z_SLAVE_ADDRESS 1 #endif #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 3 + #define E0_SLAVE_ADDRESS 3 #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_SKR_MINI_E3_V2_0."); + static_assert(Y_SLAVE_ADDRESS == 2, "Y_SLAVE_ADDRESS must be 2 for BOARD_SKR_MINI_E3_V2_0."); + static_assert(Z_SLAVE_ADDRESS == 1, "Z_SLAVE_ADDRESS must be 1 for BOARD_SKR_MINI_E3_V2_0."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_SKR_MINI_E3_V2_0."); #endif + +// Pins for documentation and sanity checks only. +// Changing these will not change the pin they are on. + +// Hardware UART pins +#define UART1_TX_PIN PA9 // default usage LCD connector +#define UART1_RX_PIN PA10 // default usage LCD connector +#define UART2_TX_PIN PA2 // default usage TFT connector +#define UART2_RX_PIN PA3 // default usage TFT connector +#define UART3_TX_PIN PB10 // default usage Y_STEP_PIN +#define UART3_RX_PIN PB11 // default usage Y_ENABLE_PIN +#define UART4_TX_PIN PC10 // default usage TMC UART +#define UART4_RX_PIN PC11 // default usage TMC UART +#define UART5_TX_PIN PC12 // default usage POWER_LOSS_PIN +#define UART5_RX_PIN PD2 // default usage E0_ENABLE_PIN 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 4ab1e15cdd..4c5cccfab1 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 @@ -55,6 +55,13 @@ // #define Z_MIN_PROBE_PIN PC14 // PROBE +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -124,18 +131,34 @@ * ------ ------ * EXP1 EXP1 */ -#ifndef EXP1_02_PIN +#ifndef EXP1_08_PIN + #define EXP1_01_PIN PB5 #define EXP1_02_PIN PB6 + #define EXP1_03_PIN PA9 + #define EXP1_04_PIN -1 // RESET + #define EXP1_05_PIN PA10 + #define EXP1_06_PIN PB9 + #define EXP1_07_PIN PB8 #define EXP1_08_PIN PB7 #endif -#define EXP1_01_PIN PB5 -#define EXP1_03_PIN PA9 -#define EXP1_04_PIN -1 // RESET -#define EXP1_05_PIN PA10 -#define EXP1_06_PIN PB9 -#define EXP1_07_PIN PB8 + +/* ----- + * | 1 | RST + * | 2 | PA3 RX2 + * | 3 | PA2 TX2 + * | 4 | GND + * | 5 | 5V + * ----- + * TFT + */ + +#define TFT_02 PA3 +#define TFT_03 PA2 #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI + + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "Ender-3 V2 display") + /** * ------ ------ ------ * (ENT) | 1 2 | (BEEP) |10 9 | |10 9 | @@ -149,10 +172,6 @@ * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on. */ - #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_02_PIN #define BTN_EN1 EXP1_08_PIN #define BTN_EN2 EXP1_07_PIN @@ -174,9 +193,7 @@ #elif ENABLED(LCD_FOR_MELZI) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! LCD for Melzi v4 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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "LCD for Melzi v4", " Requires a custom cable.") /** * LCD for Melzi v4 needs a custom cable with reversed GND/5V pins; plugging in a standard cable may damage the board or LCD! @@ -205,9 +222,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN @@ -235,9 +250,7 @@ #if ENABLED(TFTGLCD_PANEL_SPI) - #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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "TFTGLCD_PANEL_SPI") /** * TFTGLCD_PANEL_SPI display pinout @@ -274,9 +287,7 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 / BEEZ_MINI_12864 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "FYSETC_MINI_12864_2_1 and clones") /** * FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 / BEEZ_MINI_12864 display pinout @@ -291,14 +302,14 @@ * ------ ------ * EXP1 EXP1 * - * --- ------ - * RST | 1 | (MISO) |10 9 | SCK - * (RX2) PA3 | 2 | BTN_EN1 | 8 7 | (SS) - * (TX2) PA2 | 3 | BTN_EN2 | 6 5 | MOSI - * GND | 4 | (CD) | 4 3 | (RST) - * 5V | 5 | (GND) | 2 1 | (KILL) - * --- ------ - * TFT EXP2 + * --- ------ + * RST | 1 | (MISO) |10 9 | SCK + * (RX2) PA3 | 2 | BTN_EN1 | 8 7 | (SS) + * (TX2) PA2 | 3 | BTN_EN2 | 6 5 | MOSI + * GND | 4 | (CD) | 4 3 | (RST) + * 5V | 5 | GND | 2 1 | (KILL) + * --- ------ + * TFT EXP2 * * Needs custom cable: * @@ -344,9 +355,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "LCD_FYSETC_TFT81050") /** * FYSETC TFT TFT81050 display pinout diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h index fad09daf79..d0bd2944bc 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h @@ -142,6 +142,7 @@ // // LCD / Controller // + #if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI) #define BEEPER_PIN EXP1_01_PIN #define BTN_ENC EXP1_02_PIN diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h index 1d501e512b..e8f9cf0235 100644 --- a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h +++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h @@ -121,7 +121,7 @@ #define FAN2_PIN PB9 // FAN (fan1 on board) controller cool fan // One NeoPixel onboard and a connector for other NeoPixels -#define NEOPIXEL_PIN PC7 // The NEOPIXEL LED driving pin +#define BOARD_NEOPIXEL_PIN PC7 // The NEOPIXEL LED driving pin /** * ------ @@ -145,6 +145,7 @@ // // LCD / Controller // + #if ENABLED(CR10_STOCKDISPLAY) #define BEEPER_PIN EXP1_01_PIN #define BTN_EN1 EXP1_03_PIN diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_CR4NS.h b/Marlin/src/pins/stm32f1/pins_CREALITY_CR4NS.h new file mode 100644 index 0000000000..5ff033e684 --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_CR4NS.h @@ -0,0 +1,135 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Creality CREALITY_CR4NS (GD32F303RET6) board pin assignments + * Sold as "Creality Ender-3 V3 SE CR4NS200320C13 Motherboard" + * Preliminary support for the Professional Firmwware + */ + +#include "env_validate.h" + +#if HOTENDS > 1 || E_STEPPERS > 1 + #error "CR4NS200320C13 only supports one hotend / E-stepper." +#endif + +// Validate stepper driver selections. +//#if !AXIS_DRIVER_TYPE_X(TMC2208) || !AXIS_DRIVER_TYPE_Y(TMC2208) || !AXIS_DRIVER_TYPE_Z(TMC2208) || !AXIS_DRIVER_TYPE_E0(TMC2208) +// #error "This board has onboard TMC2208 drivers for X, Y, Z, and E0." +//#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "CR4NS200320C13" +#endif +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME "Ender-3 V3 SE" +#endif +#define BOARD_WEBSITE_URL "www.creality.com" + +// +// Servos +// +#ifndef SERVO0_PIN + #define SERVO0_PIN PC14 +#endif + +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PC13 // BLTouch IN +#endif + +// +// Limit Switches +// +//#ifndef Z_STOP_PIN +// #define Z_STOP_PIN PA15 // else PA7 +//#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PC15 // "Pulled-high" +#endif + +// +// Heaters / Fans +// +#define HEATER_BED_PIN PB2 // HOT BED +#define FAN1_PIN PC1 // extruder fan +//#define FAN2_PIN PB1 // Controller fan FET + +// +// Auto fans +// +//#ifndef CONTROLLER_FAN_PIN +// #define CONTROLLER_FAN_PIN FAN2_PIN +//#endif + +#if HAS_TMC_UART + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 + + // Software serial + #define X_SERIAL_TX_PIN PB12 + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + + #define Y_SERIAL_TX_PIN PB13 + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + + #define Z_SERIAL_TX_PIN PB14 + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + +#endif // HAS_TMC_UART + +#if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI) + + /** + * LCD PIN OUT + * ------ + * NC | 1 2 | NC + * RX | 3 4 | TX + * EN 5 6 | BEEP + * B | 7 8 | A + * GND | 9 10 | +5V + * ------ + */ + #define EXP3_01_PIN -1 + #define EXP3_02_PIN -1 + #define EXP3_03_PIN PA2 + #define EXP3_04_PIN PA3 + #define EXP3_05_PIN PB1 + #define EXP3_06_PIN -1 + #define EXP3_07_PIN PA12 + #define EXP3_08_PIN PA11 + + #ifndef BEEPER_PIN + #define BEEPER_PIN EXP1_06_PIN // BEEP + #endif + + #define BTN_ENC EXP1_05_PIN // EN + #define BTN_EN1 EXP1_08_PIN // A + #define BTN_EN2 EXP1_07_PIN // B + +#endif + +#include "pins_CREALITY_V4.h" diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h index a99143bad9..584d7661f8 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h @@ -60,6 +60,13 @@ #define Z_MIN_PROBE_PIN PC14 // BLTouch IN #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h index 61207f90b0..6f178c7581 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h @@ -63,11 +63,16 @@ #define Y_STOP_PIN PC5 #define Z_STOP_PIN PC15 +// +// Probe +// #if ENABLED(BLTOUCH) #define SERVO0_PIN PC14 // BLTouch OUT PIN #elif ENABLED(PROBE_ACTIVATION_SWITCH) #define PROBE_TARE_PIN PC14 #define PROBE_ACTIVATION_SWITCH_PIN PB2 +#elif ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN PC14 #endif // diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index 96b3007ca6..9ae858f2d0 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -92,6 +92,13 @@ #define Z_MIN_PROBE_PIN PB1 // BLTouch IN #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -162,6 +169,18 @@ #define ONBOARD_SDIO #define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer +/** Debug port + * ----- + * | 1 | VCC + * | 2 | PA13 + * | 3 | PA14 + * | 4 | GND + * ----- + */ + +#define DEBUG_02_PIN PA13 +#define DEBUG_03_PIN PA14 + #if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI) /** @@ -234,9 +253,7 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_CREALITY_V4.h' for details. Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning." - #endif + CONTROLLER_WARNING("CREALITY_V4", "FYSETC_MINI_12864_2_1 and clones") #if SD_CONNECTION_IS(LCD) #error "The LCD SD Card is not connected with this configuration." diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h index 2e0de87641..21503bd1e0 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h @@ -76,6 +76,13 @@ #define Z_MIN_PROBE_PIN PA5 // BLTouch IN #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V521.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V521.h index 2660b6e505..2116aad8e9 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V521.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V521.h @@ -77,6 +77,13 @@ #define Z_MIN_PROBE_PIN PD12 // BLTouch IN #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // diff --git a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h index b18bd09de8..1a43f2e414 100644 --- a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h @@ -135,6 +135,8 @@ #define Y_HARDWARE_SERIAL MSerial4 #define Z_HARDWARE_SERIAL MSerial4 #define E0_HARDWARE_SERIAL MSerial4 + + // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS #define X_SLAVE_ADDRESS 2 #endif @@ -147,6 +149,10 @@ #ifndef E0_SLAVE_ADDRESS #define E0_SLAVE_ADDRESS 0 #endif + static_assert(X_SLAVE_ADDRESS == 2, "X_SLAVE_ADDRESS must be 2 for BOARD_ERYONE_ERY32_MINI."); + static_assert(Y_SLAVE_ADDRESS == 3, "Y_SLAVE_ADDRESS must be 3 for BOARD_ERYONE_ERY32_MINI."); + static_assert(Z_SLAVE_ADDRESS == 1, "Z_SLAVE_ADDRESS must be 1 for BOARD_ERYONE_ERY32_MINI."); + static_assert(E0_SLAVE_ADDRESS == 0, "E0_SLAVE_ADDRESS must be 0 for BOARD_ERYONE_ERY32_MINI."); #endif // diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 027bfd71b5..2853796738 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -241,8 +241,8 @@ #if ENABLED(NEOPIXEL_LED) #define LED_PWM PC7 // IO1 - #ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN LED_PWM // USED WIFI IO0/IO1 PIN + #ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN LED_PWM // USED WIFI IO0/IO1 PIN #endif #endif @@ -272,6 +272,7 @@ // // LCD / Controller // + #ifndef BEEPER_PIN #define BEEPER_PIN PC5 #endif diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index 69e11be20c..e31d11f408 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -150,6 +150,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define SPI_DEVICE 2 // Maple diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h index 93ef7b75d4..fc9e24b790 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h @@ -24,13 +24,13 @@ #include "env_validate.h" #define BOARD_INFO_NAME "FYSETC AIO II" -#define BOARD_WEBSITE_URL "fysetc.com" +#define BOARD_WEBSITE_URL "github.com/FYSETC/FYSETC-AIO_II" #define BOARD_NO_NATIVE_USB #define RESET_STEPPERS_ON_MEDIA_INSERT #define DISABLE_JTAG -#define pins_v2_20190128 // new pins define +#define PINS_V2_20190128 // new pins define // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 @@ -55,7 +55,7 @@ // // Filament runout // -#ifdef pins_v2_20190128 +#ifdef PINS_V2_20190128 #define FIL_RUNOUT_PIN PB15 #else #define FIL_RUNOUT_PIN PB5 @@ -69,7 +69,7 @@ #define X_ENABLE_PIN PA8 #define Y_STEP_PIN PB2 -#ifdef pins_v2_20190128 +#ifdef PINS_V2_20190128 #define Y_DIR_PIN PB3 #else #define Y_DIR_PIN PB0 @@ -97,20 +97,22 @@ // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0 + #define X_SLAVE_ADDRESS 0 #endif #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 1 + #define Y_SLAVE_ADDRESS 1 #endif #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 2 + #define Z_SLAVE_ADDRESS 2 #endif #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 3 + #define E0_SLAVE_ADDRESS 3 #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_FYSETC_AIO_II."); + static_assert(Y_SLAVE_ADDRESS == 1, "Y_SLAVE_ADDRESS must be 1 for BOARD_FYSETC_AIO_II."); + static_assert(Z_SLAVE_ADDRESS == 2, "Z_SLAVE_ADDRESS must be 2 for BOARD_FYSETC_AIO_II."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_FYSETC_AIO_II."); - // The 4xTMC2209 module doesn't have a serial multiplexer and - // needs to set *_SLAVE_ADDRESS in Configuration_adv.h for X,Y,Z,E0 #if HAS_DRIVER(TMC2208) #define TMC_SERIAL_MULTIPLEXER #define SERIAL_MUL_PIN1 PB13 @@ -162,7 +164,7 @@ #if HAS_MARLINUI_U8GLIB #define DOGLCD_A0 PA15 - #ifdef pins_v2_20190128 + #ifdef PINS_V2_20190128 #define DOGLCD_CS PB5 #else #define DOGLCD_CS PB7 @@ -183,7 +185,7 @@ #define BTN_ENC PC12 #endif - #ifdef pins_v2_20190128 + #ifdef PINS_V2_20190128 #define LCD_RESET_PIN PB4 #ifndef RGB_LED_R_PIN #define RGB_LED_R_PIN PB0 diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h index 49b6f25a47..042966cb3a 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h @@ -23,10 +23,8 @@ #include "env_validate.h" -#define DEFAULT_MACHINE_NAME "3D Printer" - #define BOARD_INFO_NAME "FYSETC Cheetah" -#define BOARD_WEBSITE_URL "fysetc.com" +#define BOARD_WEBSITE_URL "github.com/FYSETC/FYSETC-Cheetah" // Ignore temp readings during development. //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 @@ -86,17 +84,21 @@ // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0 + #define X_SLAVE_ADDRESS 0 #endif #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 1 + #define Y_SLAVE_ADDRESS 1 #endif #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 2 + #define Z_SLAVE_ADDRESS 2 #endif #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 3 + #define E0_SLAVE_ADDRESS 3 #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_FYSETC_CHEETAH."); + static_assert(Y_SLAVE_ADDRESS == 1, "Y_SLAVE_ADDRESS must be 1 for BOARD_FYSETC_CHEETAH."); + static_assert(Z_SLAVE_ADDRESS == 2, "Z_SLAVE_ADDRESS must be 2 for BOARD_FYSETC_CHEETAH."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_FYSETC_CHEETAH."); #endif // diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h index b97ccc8ec7..94c6dc2bfa 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h @@ -134,6 +134,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #if IS_RRD_SC diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h index 4bb8c5dee6..5f66f9bc3b 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h @@ -134,6 +134,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #if IS_RRD_SC diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h index 57abf7aca7..9f7efa99c4 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h @@ -139,6 +139,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #if IS_RRD_SC diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h index 34f7dba91f..3f6ae1414b 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h @@ -134,6 +134,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #if IS_RRD_SC diff --git a/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h b/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h index 4ac0a24d1c..000548ee53 100644 --- a/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h +++ b/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h @@ -180,6 +180,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define BEEPER_PIN EXP1_10_PIN #define BTN_ENC EXP1_09_PIN diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index a1ca477857..49c28c57bf 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -76,6 +76,13 @@ #define Z_MIN_PIN PA4 #define Z_MAX_PIN PF7 +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index b934e06b60..ae4ee3268e 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -80,6 +80,13 @@ #define Z_MIN_PIN PA11 #define Z_MAX_PIN PC4 +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // @@ -194,10 +201,14 @@ #define WIFI_IO1_PIN PC7 #define WIFI_RESET_PIN PE9 + // + // MKS Testing for code in lcd/extui/mks_ui + // #if ENABLED(MKS_TEST) #define MKS_TEST_POWER_LOSS_PIN PA2 // PW_DET #define MKS_TEST_PS_ON_PIN PB0 // PW_OFF #endif + #else //#define POWER_LOSS_PIN PA2 // PW_DET //#define PS_ON_PIN PB2 // PW_OFF @@ -265,6 +276,17 @@ * to let the bootloader init the screen. */ +#if ENABLED(TFT_CLASSIC_UI) + // Emulated DOGM SPI + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN +#elif ENABLED(TFT_COLOR_UI) + #define TFT_BUFFER_WORDS 14400 +#endif + #if HAS_SPI_TFT // Shared SPI TFT @@ -295,27 +317,16 @@ #define LCD_USE_DMA_SPI -#endif +#elif HAS_WIRED_LCD -#if ENABLED(TFT_CLASSIC_UI) - // Emulated DOGM SPI - #define LCD_PINS_EN EXP1_03_PIN - #define LCD_PINS_RS EXP1_04_PIN - #define BTN_ENC EXP1_02_PIN - #define BTN_EN1 EXP2_03_PIN - #define BTN_EN2 EXP2_05_PIN -#elif ENABLED(TFT_COLOR_UI) - #define TFT_BUFFER_WORDS 14400 -#endif - -#if HAS_WIRED_LCD && !HAS_SPI_TFT #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN - #define LCD_PINS_EN EXP1_03_PIN - #define LCD_PINS_RS EXP1_04_PIN #define BTN_EN1 EXP2_03_PIN #define BTN_EN2 EXP2_05_PIN - #define LCD_BACKLIGHT_PIN -1 + + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN #if ENABLED(MKS_MINI_12864) @@ -356,7 +367,7 @@ #endif //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 - #else // !MKS_MINI_12864 + #else // !FYSETC_MINI_12864_2_1 #define LCD_PINS_D4 EXP1_05_PIN #if IS_ULTIPANEL @@ -374,10 +385,14 @@ #define BOARD_ST7920_DELAY_2 125 #define BOARD_ST7920_DELAY_3 125 - #endif // !MKS_MINI_12864 + #endif // !FYSETC_MINI_12864_2_1 #endif // HAS_WIRED_LCD && !HAS_SPI_TFT +#ifndef BEEPER_PIN + #define BEEPER_PIN EXP1_01_PIN +#endif + #define SPI_FLASH #if ENABLED(SPI_FLASH) #define SPI_FLASH_SIZE 0x1000000 // 16MB @@ -387,10 +402,6 @@ #define SPI_FLASH_MOSI_PIN PB15 #endif -#ifndef BEEPER_PIN - #define BEEPER_PIN EXP1_01_PIN -#endif - #if ENABLED(SPEAKER) && BEEPER_PIN == PC5 #error "MKS Robin nano default BEEPER_PIN is not a SPEAKER." #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h index c3becd3fa1..49f14866c0 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -64,6 +64,13 @@ #define Z_MIN_PROBE_PIN PB1 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // @@ -213,7 +220,7 @@ #define SOFTWARE_SPI //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 - #else + #else // !FYSETC_MINI_12864_2_1 #define LCD_PINS_D4 EXP1_05_PIN #if IS_ULTIPANEL @@ -227,7 +234,7 @@ #endif - #endif // !MKS_MINI_12864 + #endif // !FYSETC_MINI_12864_2_1 #endif // HAS_WIRED_LCD @@ -245,19 +252,18 @@ #endif // LED driving pin -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PA2 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PA2 #endif // // SD Card // #define SDCARD_CONNECTION ONBOARD -#define SPI_DEVICE 2 // Maple -#define ONBOARD_SPI_DEVICE 2 +#define ONBOARD_SPI_DEVICE 2 // Maple #define SDSS SD_SS_PIN #define ONBOARD_SD_CS_PIN SD_SS_PIN -#define SD_DETECT_PIN PC10 // EXP2_07_PIN +#define SD_DETECT_PIN EXP2_07_PIN #define NO_SD_HOST_DRIVE // TODO: This is the only way to set SPI for SD on STM32 (for now) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index 10ddc76a01..50e2419018 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -80,9 +80,9 @@ #define FIL_RUNOUT_PIN PB8 // MT_DET /** ------ - * (BEEPER) PD2 | 1 2 | PB3 (BTN_ENC) - * (BTN_EN1) PB5 | 3 4 | PA11 (RESET?) - * (BTN_EN2) PB4 5 6 | PC1 (LCD_D4) + * (BEEPER) PD2 | 1 2 | PB3 (ENC) + * (EN1) PB5 | 3 4 | PA11 (RESET?) + * (EN2) PB4 5 6 | PC1 (LCD_D4) * (LCD_RS) PC3 | 7 8 | PC2 (LCD_EN) * GND | 9 10 | 5V * ------ diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h index 03be44bba6..1b3d80bef2 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h @@ -54,6 +54,13 @@ #define Z_MIN_PIN PC6 #define Z_MAX_PIN PB1 +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index a4c5ca767e..2d1bd7c8ca 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -71,6 +71,13 @@ #define FIL_RUNOUT_PIN PA4 // MT_DET #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // 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 c28c3d4b89..ea82c13fba 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -83,6 +83,13 @@ #define Z_MIN_PIN PA11 #define Z_MAX_PIN PC4 +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // @@ -221,10 +228,14 @@ #define WIFI_IO1_PIN PC7 #define WIFI_RESET_PIN PE9 + // + // MKS Testing for code in lcd/extui/mks_ui + // #if ENABLED(MKS_TEST) #define MKS_TEST_POWER_LOSS_PIN PA2 // PW_DET #define MKS_TEST_PS_ON_PIN PB2 // PW_OFF #endif + #else //#define POWER_LOSS_PIN PA2 // PW_DET //#define PS_ON_PIN PB2 // PW_OFF @@ -248,13 +259,41 @@ #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_04_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif +/** + * ------ ------ + * PC5 | 1 2 | PE13 PA6 | 1 2 | PA5 + * PD13 | 3 4 | PC6 PE8 | 3 4 | PE10 + * PE14 | 5 6 PE15 PE11 | 5 6 PA7 + * PD11 | 7 8 | PD10 PE12 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | 3.3V + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_01_PIN PC5 +#define EXP1_02_PIN PE13 +#define EXP1_03_PIN PD13 +#define EXP1_04_PIN PC6 +#define EXP1_05_PIN PE14 +#define EXP1_06_PIN PE15 +#define EXP1_07_PIN PD11 +#define EXP1_08_PIN PD10 + +#define EXP2_01_PIN PA6 +#define EXP2_02_PIN PA5 +#define EXP2_03_PIN PE8 +#define EXP2_04_PIN PE10 +#define EXP2_05_PIN PE11 +#define EXP2_06_PIN PA7 +#define EXP2_07_PIN PE12 +#define EXP2_08_PIN -1 // RESET + // // LCD / Controller // @@ -265,29 +304,40 @@ * to let the bootloader init the screen. */ +#if ENABLED(TFT_CLASSIC_UI) + // Emulated DOGM SPI + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN +#elif ENABLED(TFT_COLOR_UI) + #define TFT_BUFFER_WORDS 14400 +#endif + #if HAS_SPI_TFT // Shared SPI TFT - #define LCD_BACKLIGHT_PIN PD13 + #define LCD_BACKLIGHT_PIN EXP1_03_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_05_PIN // SPI1_NSS + #define TOUCH_SCK_PIN EXP2_02_PIN // SPI1_SCK + #define TOUCH_MISO_PIN EXP2_01_PIN // SPI1_MISO + #define TOUCH_MOSI_PIN EXP2_06_PIN // SPI1_MOSI - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 - #define BTN_ENC PE13 + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_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_CS_PIN EXP1_07_PIN + #define TFT_SCK_PIN EXP2_02_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_MOSI_PIN EXP2_06_PIN + #define TFT_DC_PIN EXP1_08_PIN #define TFT_A0_PIN TFT_DC_PIN - #define TFT_RESET_PIN PC6 + #define TFT_RESET_PIN EXP1_04_PIN #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI @@ -295,27 +345,16 @@ #define LCD_USE_DMA_SPI -#endif +#elif HAS_WIRED_LCD -#if ENABLED(TFT_CLASSIC_UI) - // Emulated DOGM SPI - #define LCD_PINS_EN PD13 - #define LCD_PINS_RS PC6 - #define BTN_ENC PE13 - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 -#elif ENABLED(TFT_COLOR_UI) - #define TFT_BUFFER_WORDS 14400 -#endif + #define BEEPER_PIN EXP1_01_PIN -#if HAS_WIRED_LCD && !HAS_SPI_TFT - #define BEEPER_PIN PC5 - #define BTN_ENC PE13 - #define LCD_PINS_EN PD13 - #define LCD_PINS_RS PC6 - #define BTN_EN1 PE8 - #define BTN_EN2 PE11 - #define LCD_BACKLIGHT_PIN -1 + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN #if ENABLED(MKS_MINI_12864) @@ -324,18 +363,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_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_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_02_PIN + #define PIN_TFT_MISO EXP2_01_PIN + #define PIN_TFT_MOSI EXP2_06_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif #ifndef BEEPER_PIN @@ -343,26 +382,26 @@ #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define LCD_PINS_DC PC6 - #define DOGLCD_CS PD13 + #define LCD_PINS_DC EXP1_04_PIN + #define DOGLCD_CS EXP1_03_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_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN + #define DOGLCD_MOSI EXP2_06_PIN + #define DOGLCD_SCK EXP2_02_PIN #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 - #else // !MKS_MINI_12864 + #else // !FYSETC_MINI_12864_2_1 - #define LCD_PINS_D4 PE14 + #define LCD_PINS_D4 EXP1_05_PIN #if IS_ULTIPANEL - #define LCD_PINS_D5 PE15 - #define LCD_PINS_D6 PD11 - #define LCD_PINS_D7 PD10 + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -376,7 +415,7 @@ #define BOARD_ST7920_DELAY_3 125 #endif - #endif // !MKS_MINI_12864 + #endif // !FYSETC_MINI_12864_2_1 #endif // HAS_WIRED_LCD && !HAS_SPI_TFT @@ -390,7 +429,7 @@ #endif #ifndef BEEPER_PIN - #define BEEPER_PIN PC5 + #define BEEPER_PIN EXP1_01_PIN #endif #if ENABLED(SPEAKER) && BEEPER_PIN == PC5 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 28c96e9070..c280915405 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h @@ -69,6 +69,13 @@ #define Z_MIN_PIN PB11 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index 47863d3ffa..d5689c1e71 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -22,7 +22,8 @@ #pragma once /** - * MKS Robin pro (STM32F103ZET6) board pin assignments + * MKS Robin Pro (STM32F103ZET6) board pin assignments + * Schematic: https://github.com/makerbase-mks/MKS-Robin-Pro/blob/master/hardware/MKS%20Robin%20Pro%20V1.0_001/MKS%20Robin%20Pro%20V1.0_001%20SCH.pdf */ #include "env_validate.h" @@ -40,6 +41,15 @@ // #define DISABLE_DEBUG +// +// Onboard I2C EEPROM +// +#define IIC_BL24CXX_EEPROM // Use I2C EEPROM onboard IC (AT24C04C, Size 4K, PageSize 16B) +#define MARLIN_EEPROM_SIZE 0x1000 // 4K +#define IIC_EEPROM_SDA PB7 +#define IIC_EEPROM_SCL PB6 +#define EEPROM_DEVICE_ADDRESS 0xA0 + // // SPI // @@ -60,6 +70,13 @@ #define Z_MIN_PIN PA11 #define Z_MAX_PIN PC4 +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // @@ -104,6 +121,7 @@ #ifndef E2_CS_PIN #define E2_CS_PIN PG9 #endif + // // SPI pins for TMC2130 stepper drivers // @@ -204,11 +222,11 @@ #endif #if SD_CONNECTION_IS(LCD) - #define SD_DETECT_PIN PG3 - #define SD_SCK_PIN PB13 - #define SD_MISO_PIN PB14 - #define SD_MOSI_PIN PB15 - #define SD_SS_PIN PG6 + #define SD_DETECT_PIN EXP2_07_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_SS_PIN EXP2_04_PIN #elif SD_CONNECTION_IS(ONBOARD) #define ONBOARD_SDIO #define SD_DETECT_PIN PD12 @@ -217,6 +235,88 @@ #error "No custom SD drive cable defined for this board." #endif +/** ------ ------ + * (BEEPER) PC5 | 1 2 | PG2 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SCK) + * (LCD_EN) PG0 | 3 4 | PG1 (LCD_RS) (BTN_EN1) PG5 | 3 4 | PG6 (SD_SS) + * (LCD_D4) PF14 5 6 | PF15 (LCD_D5) (BTN_EN2) PG4 5 6 | PB15 (MOSI) + * (LCD_D6) PF12 | 7 8 | PF13 (LCD_D7) (SD_DETECT) PG3 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_01_PIN PC5 +#define EXP1_02_PIN PG2 +#define EXP1_03_PIN PG0 +#define EXP1_04_PIN PG1 +#define EXP1_05_PIN PF14 +#define EXP1_06_PIN PF15 +#define EXP1_07_PIN PF12 +#define EXP1_08_PIN PF13 + +#define EXP2_01_PIN PB14 +#define EXP2_02_PIN PB13 +#define EXP2_03_PIN PG5 +#define EXP2_04_PIN PG6 +#define EXP2_05_PIN PG4 +#define EXP2_06_PIN PB15 +#define EXP2_07_PIN PG3 +#define EXP2_08_PIN -1 // RESET + +/** ------- + * | 0 | DGND-| + * 3V3 | 1 2 | DGND-| + * (D0) PD14 | 3 4 | PD15 (D1) + * (D2) PD0 | 5 6 | PD1 (D3) + * (D4) PE7 | 7 8 | PE8 (D5) + * (D6) PE9 | 9 10 | PE10 (D7) + * (D8) PE11 | 11 12 | PE12 (D9) + * (D10) PE13 | 13 14 | PE14 (D11) + * (D12) PE15 | 15 16 | PD8 (D13) + * (D14) PD9 | 17 18 | PD10 (D15) + * (NE4) PD7 | 19 20 | PD11 (A0) + * (NWE) PD5 | 21 22 | PD4 (NOE) + * (RST) PC6? | 23 24 | PD13?(LIGHT) + * (MISO2) PB14 | 25 26 | --- (INT) + * (MOSI2) PB15 | 27 28 | PC5 (BEEPER) + * (SCK2) PB13 | 29 30 | VCC + * (NSS2) PA7 | 31 32 | DGND + * ------- + * FSMC + */ +//#define FSMC_00_PIN -1 // GND +//#define FSMC_01_PIN -1 // 3.3V +//#define FSMC_02_PIN -1 // GND +#define FSMC_03_PIN PD14 // D0 +#define FSMC_04_PIN PD15 // D1 +#define FSMC_05_PIN PD0 // D2 +#define FSMC_06_PIN PD1 // D3 +#define FSMC_07_PIN PE7 // D4 +#define FSMC_08_PIN PE8 // D5 +#define FSMC_09_PIN PE9 // D6 +#define FSMC_10_PIN PE10 // D7 +#define FSMC_11_PIN PE11 // D8 +#define FSMC_12_PIN PE12 // D9 +#define FSMC_13_PIN PE13 // D10 +#define FSMC_14_PIN PE14 // D11 +#define FSMC_15_PIN PE15 // D12 +#define FSMC_16_PIN PD8 // D13 +#define FSMC_17_PIN PD9 // D14 +#define FSMC_18_PIN PD10 // D15 +#define FSMC_19_PIN PD7 // NE4 +#define FSMC_20_PIN PD11 // A0 +#define FSMC_21_PIN PD5 // NWE +#define FSMC_22_PIN PD4 // NOE +#define FSMC_23_PIN PC6 // RST +#define FSMC_24_PIN PD13 // LIGHT +#define FSMC_25_PIN PB14 // MISO2 +#define FSMC_26_PIN -1 // INT +#define FSMC_27_PIN PB15 // MOSI2 +#define FSMC_28_PIN PC5 // BEEPER +#define FSMC_29_PIN PB13 // SCK2 +//#define FSMC_30_PIN -1 // VCC +#define FSMC_31_PIN PA7 // NSS2 +//#define FSMC_32_PIN -1 // GND + // // TFT with FSMC interface // @@ -229,29 +329,29 @@ #define TFT_RESET_PIN LCD_RESET_PIN #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN - #define FSMC_CS_PIN PD7 // NE4 - #define FSMC_RS_PIN PD11 // A0 + #define FSMC_CS_PIN FSMC_19_PIN // NE4 + #define FSMC_RS_PIN FSMC_20_PIN // A0 #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT #define TFT_CS_PIN FSMC_CS_PIN #define TFT_RS_PIN FSMC_RS_PIN - #define LCD_RESET_PIN PC6 - #define LCD_BACKLIGHT_PIN PD13 + #define LCD_RESET_PIN FSMC_23_PIN + #define LCD_BACKLIGHT_PIN FSMC_24_PIN #define TFT_BUFFER_WORDS 14400 #if NEED_TOUCH_PINS #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 2 - #define TOUCH_CS_PIN PA7 // SPI2_NSS - #define TOUCH_SCK_PIN PB13 // SPI2_SCK - #define TOUCH_MISO_PIN PB14 // SPI2_MISO - #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI + #define TOUCH_CS_PIN FSMC_31_PIN // SPI2_NSS + #define TOUCH_SCK_PIN FSMC_29_PIN // SPI2_SCK + #define TOUCH_MISO_PIN FSMC_25_PIN // SPI2_MISO + #define TOUCH_MOSI_PIN FSMC_27_PIN // SPI2_MOSI #else - #define BEEPER_PIN PC5 - #define BTN_ENC PG2 - #define BTN_EN1 PG5 - #define BTN_EN2 PG4 + #define BEEPER_PIN FSMC_28_PIN + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #endif #elif IS_TFTGLCD_PANEL @@ -262,30 +362,30 @@ #elif HAS_WIRED_LCD - #define BEEPER_PIN PC5 - #define BTN_ENC PG2 - #define LCD_PINS_EN PG0 - #define LCD_PINS_RS PG1 - #define BTN_EN1 PG5 - #define BTN_EN2 PG4 + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN // MKS MINI12864 and MKS LCD12864B. If using MKS LCD12864A (Need to remove RPK2 resistor) - #if ENABLED(MKS_MINI_12864) + #if ANY(ENDER2_STOCKDISPLAY, MKS_MINI_12864) #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN -1 - #define DOGLCD_A0 PF12 - #define DOGLCD_CS PF15 - #define DOGLCD_SCK PB13 - #define DOGLCD_MOSI PB15 + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN - #else // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY + #else // !ENDER2_STOCKDISPLAY && !MKS_MINI_12864 - #define LCD_PINS_D4 PF14 + #define LCD_PINS_D4 EXP1_05_PIN #if IS_ULTIPANEL - #define LCD_PINS_D5 PF15 - #define LCD_PINS_D6 PF12 - #define LCD_PINS_D7 PF13 + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -293,9 +393,9 @@ #endif - #endif // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY + #endif -#endif +#endif // HAS_WIRED_LCD // Alter timing for graphical display #if IS_U8GLIB_ST7920 @@ -312,3 +412,13 @@ #define SPI_FLASH_MISO_PIN PB14 #define SPI_FLASH_MOSI_PIN PB15 #endif + +// +// MKS WIFI pins +// +#if ENABLED(MKS_WIFI_MODULE) + #define WIFI_RESET_PIN PA5 + #define WIFI_SERIAL_PORT 1 // USART1 + #define WIFI_IO1_PIN PC7 + #define WIFI_IO0_PIN -1 // N.C. +#endif diff --git a/Marlin/src/pins/stm32f1/pins_ORCA_3D_SPRINGER.h b/Marlin/src/pins/stm32f1/pins_ORCA_3D_SPRINGER.h index b2afe6de9b..a376feb93a 100644 --- a/Marlin/src/pins/stm32f1/pins_ORCA_3D_SPRINGER.h +++ b/Marlin/src/pins/stm32f1/pins_ORCA_3D_SPRINGER.h @@ -251,6 +251,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define BEEPER_PIN EXP1_01_PIN // NC #define BTN_ENC EXP1_02_PIN @@ -299,7 +300,7 @@ //#define LED_PIN EXP1_07_PIN // green //#define LED_PIN EXP1_08_PIN // blue - //#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + //#if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) // #ifndef RGB_LED_R_PIN // #define RGB_LED_R_PIN EXP1_06_PIN // #endif diff --git a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h index 4c65ce9f64..8be9f5db83 100644 --- a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h +++ b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h @@ -168,6 +168,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define BTN_ENC PA0 #define BTN_EN1 PC4 @@ -180,9 +181,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #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 + CONTROLLER_WARNING("PANDA_PI_V29", "LCD_FYSETC_TFT81050") /** FYSETC TFT TFT81050 display pinout * diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h index 06f697e270..c1e5a46f70 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h @@ -278,6 +278,7 @@ // // LCD / Controller // + #if ENABLED(ZONESTAR_12864LCD) #define LCDSCREEN_NAME "ZONESTAR LCD12864" #define LCD_PINS_RS EXP1_03_PIN // 7 CS make sure for zonestar zm3e4! diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h index edfee05166..c2b2512f4a 100644 --- a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h @@ -133,6 +133,7 @@ // // LCD / Controller // + #if HAS_SPI_TFT || HAS_FSMC_TFT #define TFT_RESET_PIN PE6 #define TFT_CS_PIN PD7 diff --git a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h index 02ad9bb4ad..502ec19bed 100644 --- a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h +++ b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h @@ -125,6 +125,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306) #define LCD_PINS_DC PB8 // Set as output on init diff --git a/Marlin/src/pins/stm32f4/pins_BLACKBEEZMINI.h b/Marlin/src/pins/stm32f4/pins_BLACKBEEZMINI.h index 33b2219655..ead1ee5e05 100644 --- a/Marlin/src/pins/stm32f4/pins_BLACKBEEZMINI.h +++ b/Marlin/src/pins/stm32f4/pins_BLACKBEEZMINI.h @@ -29,8 +29,8 @@ #include "env_validate.h" -#ifndef DEFAULT_MACHINE_NAME - #define DEFAULT_MACHINE_NAME "I3DBEE BP_01" +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "I3DBEE BP_01" #endif #define TEMP_TIMER 5 @@ -97,7 +97,7 @@ #define HEATER_0_PIN PA2 // HOTEND MOSFET #define HEATER_BED_PIN PA0 // BED MOSFET -#define FAN1_PIN PA1 // FAN1 header on board - PRINT FAN +#define FAN0_PIN PA1 // FAN1 header on board - PRINT FAN // // SD Card @@ -140,6 +140,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD #define BEEPER_PIN EXP1_01_PIN 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 d7196b75fc..2abbf3452b 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -238,8 +238,9 @@ #define SDSS EXP2_04_PIN // -// LCDs and Controllers +// LCD / Controller // + #if HAS_WIRED_LCD #define BEEPER_PIN EXP1_01_PIN #define BTN_ENC EXP1_02_PIN diff --git a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h index 4350fad7f7..1ec7e75163 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h @@ -59,6 +59,13 @@ // #define Z_MIN_PROBE_PIN PC5 // PROBE +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -174,17 +181,15 @@ // // Misc. Functions // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PB7 // LED driving pin +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PB7 // LED driving pin #endif #ifndef PS_ON_PIN #define PS_ON_PIN PE1 // Power Supply Control #endif -/** - * BTT E3 RRF - * ------ +/** ------ * (BEEPER) PE8 | 1 2 | PE9 (BTN_ENC) * (BTN_EN1) PE7 | 3 4 | RESET * (BTN_EN2) PB2 5 6 | PE10 (LCD_D4) @@ -193,26 +198,32 @@ * ------ * EXP1 */ +#define EXP1_01_PIN PE8 +#define EXP1_02_PIN PE9 +#define EXP1_03_PIN PE7 +#define EXP1_04_PIN -1 // RESET +#define EXP1_05_PIN PB2 +#define EXP1_06_PIN PE10 +#define EXP1_07_PIN PB1 +#define EXP1_08_PIN PE11 #if HAS_WIRED_LCD #if ANY(CR10_STOCKDISPLAY, LCD_FOR_MELZI) - #define BEEPER_PIN PE8 + #define BEEPER_PIN EXP1_01_PIN - #define BTN_ENC PE9 - #define BTN_EN1 PE7 - #define BTN_EN2 PB2 + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN - #define LCD_PINS_RS PB1 - #define LCD_PINS_EN PE11 - #define LCD_PINS_D4 PE10 + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_EN EXP1_08_PIN #if ENABLED(LCD_FOR_MELZI) - #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 + CONTROLLER_WARNING("BTT_E3_RRF", "LCD_FOR_MELZI") /** LCD_FOR_MELZI display pinout * @@ -246,28 +257,26 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #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 + CONTROLLER_WARNING("BTT_E3_RRF", "ZONESTAR_LCD") - #define LCD_PINS_RS PE10 - #define LCD_PINS_EN PE9 - #define LCD_PINS_D4 PB1 - #define LCD_PINS_D5 PB2 - #define LCD_PINS_D6 PE7 - #define LCD_PINS_D7 PE8 + #define LCD_PINS_RS EXP1_06_PIN + #define LCD_PINS_EN EXP1_02_PIN + #define LCD_PINS_D4 EXP1_07_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_03_PIN + #define LCD_PINS_D7 EXP1_01_PIN #define ADC_KEYPAD_PIN PB0 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD! #elif ANY(MKS_MINI_12864, ENDER2_STOCKDISPLAY) - #define BTN_ENC PE9 - #define BTN_EN1 PE7 - #define BTN_EN2 PB2 + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN - #define DOGLCD_CS PB1 - #define DOGLCD_A0 PE10 - #define DOGLCD_SCK PE8 - #define DOGLCD_MOSI PE11 + #define DOGLCD_CS EXP1_07_PIN + #define DOGLCD_A0 EXP1_06_PIN + #define DOGLCD_SCK EXP1_01_PIN + #define DOGLCD_MOSI EXP1_08_PIN #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 @@ -276,9 +285,7 @@ #if ENABLED(TFTGLCD_PANEL_SPI) - #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 + CONTROLLER_WARNING("BTT_E3_RRF", "TFTGLCD_PANEL_SPI") /** * TFTGLCD_PANEL_SPI display pinout @@ -309,7 +316,7 @@ * EXP1-1 ----------- EXP1-7 SD_DET */ - #define TFTGLCD_CS PE7 + #define TFTGLCD_CS EXP1_03_PIN #endif @@ -332,9 +339,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #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 + CONTROLLER_WARNING("BTT_E3_RRF", "LCD_FYSETC_TFT81050") /** FYSETC TFT TFT81050 display pinout * @@ -366,10 +371,10 @@ #define CLCD_SPI_BUS 1 // SPI1 connector - #define BEEPER_PIN PE9 + #define BEEPER_PIN EXP1_02_PIN - #define CLCD_MOD_RESET PE7 - #define CLCD_SPI_CS PB1 + #define CLCD_MOD_RESET EXP1_03_PIN + #define CLCD_SPI_CS EXP1_07_PIN #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050 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 2414c07ae3..cd5755539b 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -31,7 +31,7 @@ #define BOARD_INFO_NAME "BTT GTR V1.0" -#define USES_DIAG_JUMPERS +#define USES_DIAG_PINS // DIAG jumpers rendered useless due to a board design error #define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support #define M5_EXTENDER // The M5 extender is attached @@ -106,6 +106,7 @@ // Pins on the extender // #if ENABLED(M5_EXTENDER) + #define USES_DIAG_JUMPERS // DIAG jumpers work on M5 extender #ifndef X2_STOP_PIN #define X2_STOP_PIN PI4 // M5 M1_STOP #endif @@ -127,6 +128,13 @@ #define Z_MIN_PROBE_PIN PH11 // Z Probe must be PH11 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // @@ -403,8 +411,9 @@ #define EXP2_07_PIN PB10 // -// LCDs and Controllers +// LCD / Controller // + #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) #define TFT_CS_PIN EXP2_04_PIN diff --git a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h index 855e94c72d..1bfc6c5492 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -21,7 +21,13 @@ */ #pragma once -#include "env_validate.h" +// The Octopus Pro V1 has shipped with both STM32F4 and STM32H7 MCUs. +// Ensure the correct env_validate.h file is included based on the build environment used. +#if NOT_TARGET(STM32H7) + #include "env_validate.h" +#else + #include "../stm32h7/env_validate.h" +#endif #define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support #define USES_DIAG_JUMPERS @@ -120,6 +126,13 @@ #define Z_MIN_PROBE_PIN PB7 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -405,8 +418,9 @@ #endif // BTT_MOTOR_EXPANSION // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) @@ -428,9 +442,7 @@ * orientation as the existing plug/DWIN to EXP1. TX/RX need to be connected to the TFT port, with TX->RX, RX->TX. */ - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! Ender-3 V2 display requires a custom cable. See 'pins_BTT_OCTOPUS_V1_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_OCTOPUS_V1_common", "Ender-3 V2 display") #define BEEPER_PIN EXP1_06_PIN #define BTN_EN1 EXP1_08_PIN @@ -494,6 +506,7 @@ #endif #endif + #endif // HAS_WIRED_LCD // Alter timing for graphical display @@ -524,8 +537,8 @@ // // NeoPixel LED // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PB0 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PB0 #endif #if ENABLED(WIFISUPPORT) diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h index 64ab2dd6c9..b833a8da52 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h @@ -69,6 +69,13 @@ // #define Z_MIN_PROBE_PIN PA1 // PROBE +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -83,8 +90,8 @@ #define POWER_LOSS_PIN PC13 // Power Loss Detection: PWR-DET #endif -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PA14 // LED driving pin +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PA14 // LED driving pin #endif #ifndef PS_ON_PIN @@ -133,6 +140,10 @@ #ifndef E0_SLAVE_ADDRESS #define E0_SLAVE_ADDRESS 3 #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_BTT_SKR_MINI_E3_V3_0_1."); + static_assert(Y_SLAVE_ADDRESS == 2, "Y_SLAVE_ADDRESS must be 2 for BOARD_BTT_SKR_MINI_E3_V3_0_1."); + static_assert(Z_SLAVE_ADDRESS == 1, "Z_SLAVE_ADDRESS must be 1 for BOARD_BTT_SKR_MINI_E3_V3_0_1."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_BTT_SKR_MINI_E3_V3_0_1."); #endif // @@ -207,9 +218,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0_1", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN @@ -237,9 +246,7 @@ #if ENABLED(TFTGLCD_PANEL_SPI) - #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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0_1", "TFTGLCD_PANEL_SPI") /** * TFTGLCD_PANEL_SPI display pinout @@ -282,9 +289,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0_1", "LCD_FYSETC_TFT81050") /** * FYSETC TFT TFT81050 display pinout 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 f1129194f7..c751f9b041 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -113,6 +113,13 @@ #define Z_MIN_PROBE_PIN PA2 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -425,8 +432,9 @@ #endif // BTT_MOTOR_EXPANSION // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) @@ -457,9 +465,7 @@ #elif ENABLED(WYH_L12864) - #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 + CONTROLLER_WARNING("BTT_SKR_PRO_common", "WYH_L12864") /** * 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 9e9f2a607a..41514181f5 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 @@ -437,8 +437,9 @@ #endif // BTT_MOTOR_EXPANSION // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) @@ -640,8 +641,8 @@ // // NeoPixel LED // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PE6 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PE6 #endif #if ENABLED(WIFISUPPORT) diff --git a/Marlin/src/pins/stm32f4/pins_CREALITY_CR4NTXXC10.h b/Marlin/src/pins/stm32f4/pins_CREALITY_CR4NTXXC10.h index d25cd6c17e..d1077cd5d0 100644 --- a/Marlin/src/pins/stm32f4/pins_CREALITY_CR4NTXXC10.h +++ b/Marlin/src/pins/stm32f4/pins_CREALITY_CR4NTXXC10.h @@ -86,6 +86,13 @@ #define Z_MIN_PROBE_PIN PB1 // BLTouch IN #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -146,18 +153,23 @@ #define Z_HARDWARE_SERIAL X_HARDWARE_SERIAL #define E0_HARDWARE_SERIAL X_HARDWARE_SERIAL + // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0 + #define X_SLAVE_ADDRESS 0 #endif #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 1 + #define Y_SLAVE_ADDRESS 1 #endif #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 2 + #define Z_SLAVE_ADDRESS 2 #endif #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 3 + #define E0_SLAVE_ADDRESS 3 #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_CREALITY_CR4NTXXC10."); + static_assert(Y_SLAVE_ADDRESS == 1, "Y_SLAVE_ADDRESS must be 1 for BOARD_CREALITY_CR4NTXXC10."); + static_assert(Z_SLAVE_ADDRESS == 2, "Z_SLAVE_ADDRESS must be 2 for BOARD_CREALITY_CR4NTXXC10."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_CREALITY_CR4NTXXC10."); // Software serial diff --git a/Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h b/Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h index 32f70a3715..fa524464e3 100644 --- a/Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h +++ b/Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h @@ -35,4 +35,6 @@ #define DISABLE_DEBUG false // DISABLE_(DEBUG|JTAG) is not supported for STM32F4. #define ALLOW_STM32F4 +#define EEPROM_EXCL_ZONE 916,926 // Ender-3S1 STM32F401 Bootloader EEPROM exclusion zone + #include "../stm32f1/pins_CREALITY_V24S1_301.h" diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index 725d326ec2..d41a6eac75 100644 --- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -283,6 +283,7 @@ // // LCD / Controller // + #if IS_RRD_SC #define BEEPER_PIN EXP1_01_PIN #define LCD_PINS_RS EXP1_04_PIN diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h index 16973b344f..7d7126b640 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h @@ -23,10 +23,8 @@ #include "env_validate.h" -#define DEFAULT_MACHINE_NAME "3D Printer" - #define BOARD_INFO_NAME "FYSETC Cheetah V2.0" -#define BOARD_WEBSITE_URL "fysetc.com" +#define BOARD_WEBSITE_URL "github.com/FYSETC/FYSETC-Cheetah-v2" // USB Flash Drive support //#define HAS_OTG_USB_HOST_SUPPORT @@ -94,17 +92,21 @@ // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0 + #define X_SLAVE_ADDRESS 0 #endif #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 2 + #define Y_SLAVE_ADDRESS 2 #endif #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 1 + #define Z_SLAVE_ADDRESS 1 #endif #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 3 + #define E0_SLAVE_ADDRESS 3 #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_FYSETC_CHEETAH_V20."); + static_assert(Y_SLAVE_ADDRESS == 2, "Y_SLAVE_ADDRESS must be 2 for BOARD_FYSETC_CHEETAH_V20."); + static_assert(Z_SLAVE_ADDRESS == 1, "Z_SLAVE_ADDRESS must be 1 for BOARD_FYSETC_CHEETAH_V20."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_FYSETC_CHEETAH_V20."); #endif // diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h index 70a9bf9de2..5eb398c3cf 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h @@ -24,7 +24,7 @@ #include "env_validate.h" #define BOARD_INFO_NAME "FYSETC Cheetah V3.0" -#define BOARD_WEBSITE_URL "fysetc.com" +#define BOARD_WEBSITE_URL "github.com/FYSETC/Cheetah_V3.0" // USB Flash Drive support //#define HAS_OTG_USB_HOST_SUPPORT @@ -41,12 +41,12 @@ // // Z Probe // -//#if ENABLED(BLTOUCH) -// #error "You need to set jumper to 5V for BLTouch, then comment out this line to proceed." -// #define SERVO0_PIN PA0 -//#elif !defined(Z_MIN_PROBE_PIN) -// #define Z_MIN_PROBE_PIN PA0 -//#endif +#if ENABLED(BLTOUCH) + #error "You need to set jumper to 5V for BLTouch, then comment out this line to proceed." + #define SERVO0_PIN PA0 // PROBE +#elif !defined(Z_MIN_PROBE_PIN) + #define Z_MIN_PROBE_PIN PA0 +#endif // // Limit Switches @@ -55,17 +55,10 @@ #define Y_STOP_PIN PA3 #define Z_STOP_PIN PC4 -#if 1 -#define TEST_IO1 PA0 // PROBE -#define TEST_IO2 PA1 // FIL-D -//#define TEST_IO3 PA9 -//#define TEST_IO4 PA10 -#endif - // // Filament runout // -//#define FIL_RUNOUT_PIN PA1 +#define FIL_RUNOUT_PIN PA1 // FIL-D // // Steppers @@ -87,66 +80,61 @@ #define E0_ENABLE_PIN PD2 #if HAS_TMC_UART - #if 1 - #ifndef X_SERIAL_TX_PIN - #define X_SERIAL_TX_PIN PB3 - #endif - #ifndef X_SERIAL_RX_PIN - #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN - #endif + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial2 + //#define Y_HARDWARE_SERIAL Serial2 + //#define Z_HARDWARE_SERIAL Serial2 + //#define E0_HARDWARE_SERIAL Serial2 - #ifndef Y_SERIAL_TX_PIN - #define Y_SERIAL_TX_PIN PB3 - #endif - #ifndef Y_SERIAL_RX_PIN - #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN - #endif + #ifndef X_SERIAL_TX_PIN + #define X_SERIAL_TX_PIN PB3 + #endif + #ifndef X_SERIAL_RX_PIN + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + #endif - #ifndef Z_SERIAL_TX_PIN - #define Z_SERIAL_TX_PIN PB3 - #endif - #ifndef Z_SERIAL_RX_PIN - #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN - #endif - #ifndef E0_SERIAL_TX_PIN - #define E0_SERIAL_TX_PIN PB3 - #endif - #ifndef E0_SERIAL_RX_PIN - #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN - #endif + #ifndef Y_SERIAL_TX_PIN + #define Y_SERIAL_TX_PIN PB3 + #endif + #ifndef Y_SERIAL_RX_PIN + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + #endif - #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0 - #endif - #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 2 - #endif - #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 1 - #endif - #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 3 - #endif - #else - #define X_HARDWARE_SERIAL Serial2 - #define Y_HARDWARE_SERIAL Serial2 - #define Z_HARDWARE_SERIAL Serial2 - #define E0_HARDWARE_SERIAL Serial2 + #ifndef Z_SERIAL_TX_PIN + #define Z_SERIAL_TX_PIN PB3 + #endif + #ifndef Z_SERIAL_RX_PIN + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + #endif + #ifndef E0_SERIAL_TX_PIN + #define E0_SERIAL_TX_PIN PB3 + #endif + #ifndef E0_SERIAL_RX_PIN + #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN + #endif // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0 + #define X_SLAVE_ADDRESS 0 #endif #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 2 + #define Y_SLAVE_ADDRESS 2 #endif #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 1 + #define Z_SLAVE_ADDRESS 1 #endif #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 3 + #define E0_SLAVE_ADDRESS 3 #endif - #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_FYSETC_CHEETAH_V30."); + static_assert(Y_SLAVE_ADDRESS == 2, "Y_SLAVE_ADDRESS must be 2 for BOARD_FYSETC_CHEETAH_V30."); + static_assert(Z_SLAVE_ADDRESS == 1, "Z_SLAVE_ADDRESS must be 1 for BOARD_FYSETC_CHEETAH_V30."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_FYSETC_CHEETAH_V30."); #endif // diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index 3daa813952..8658191dbe 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -238,6 +238,7 @@ // // LCD / Controller // + #if ENABLED(FYSETC_242_OLED_12864) #define BTN_EN1 EXP1_01_PIN @@ -255,7 +256,7 @@ #define FORCE_SOFT_SPI #define KILL_PIN -1 // NC - #define NEOPIXEL_PIN EXP1_07_PIN + #define BOARD_NEOPIXEL_PIN EXP1_07_PIN #elif HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER_KING407.h b/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER_KING407.h index bfe4469084..4a1960367c 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER_KING407.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER_KING407.h @@ -278,6 +278,7 @@ // // LCD / Controller // + #if ENABLED(FYSETC_242_OLED_12864) #define BEEPER_PIN EXP2_08_PIN diff --git a/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h b/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h index f63f4adeec..6cd09d3ac8 100644 --- a/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h +++ b/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h @@ -480,8 +480,9 @@ #endif // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) @@ -512,9 +513,7 @@ #elif ENABLED(WYH_L12864) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! WYH_L12864 requires wiring modifications. See 'pins_I3DBEEZ9.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("I3DBEEZ9", "WYH_L12864") /** * 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_LERDGE_K.h b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h index da11ce05ef..83062a5487 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h @@ -206,7 +206,6 @@ // #define LED_PIN PA15 // Status LED //#define CASE_LIGHT_PIN PB6 // LED Ribbon Connector (PWM TIM4_CH1) -//#define NEOPIXEL_PIN -1 #ifndef RGB_LED_R_PIN #define RGB_LED_R_PIN PB8 // swap R and G pin for compatibility with real wires #endif diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h index 22e7f6e2e2..f795cc35ac 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_X.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_X.h @@ -113,7 +113,6 @@ // //#define CASE_LIGHT_PIN_CI -1 //#define CASE_LIGHT_PIN_DO -1 -//#define NEOPIXEL_PIN -1 // // SD support (On board) diff --git a/Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h b/Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h index 39073bffce..248fc514ac 100644 --- a/Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h @@ -96,10 +96,8 @@ // // Probe enable // -#if ENABLED(PROBE_ENABLE_DISABLE) - #ifndef PROBE_ENABLE_PIN - #define PROBE_ENABLE_PIN SERVO0_PIN - #endif +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN #endif // @@ -336,8 +334,9 @@ #endif // BTT_MOTOR_EXPANSION // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_V2.h index 772a93605a..12d3947b99 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_V2.h @@ -51,7 +51,7 @@ // // MKS WIFI MODULE // -//#define WIFI_SERIAL 1// USART1 +//#define WIFI_SERIAL_PORT 1 // USART1 #if ENABLED(MKS_WIFI_MODULE) #define WIFI_IO0_PIN PB14 // MKS ESP WIFI IO0 PIN #define WIFI_IO1_PIN PB15 // MKS ESP WIFI IO1 PIN @@ -59,8 +59,6 @@ #endif // The FYSETC_MINI_12864_2_1 uses one of the EXP pins -#if DISABLED(FYSETC_MINI_12864_2_1) && !defined(NEOPIXEL_PIN) - #define NEOPIXEL_PIN PC5 -#endif +#define BOARD_NEOPIXEL_PIN PC5 #include "pins_MKS_MONSTER8_common.h" diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h index 5b5c4fea87..b832a14b2a 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h @@ -67,6 +67,13 @@ #define Z_MIN_PIN PB13 #define Z_MAX_PIN PB12 +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // @@ -210,9 +217,6 @@ #define KILL_PIN_STATE HIGH #endif -// Random Info -#define USB_SERIAL -1 // USB Serial - /** * ------ ------ * (BEEPER) PB2 | 1 2 | PE10 (BTN_ENC) (SPI1 MISO) PA6 | 1 2 | PA5 (SPI1 SCK) @@ -241,43 +245,120 @@ #define EXP2_07_PIN PB11 #define EXP2_08_PIN -1 // RESET -#if HAS_MEDIA - #ifndef SDCARD_CONNECTION +// +// SD Support +// +#ifndef SDCARD_CONNECTION + #if HAS_WIRED_LCD && DISABLED(NO_LCD_SDCARD) + #define SDCARD_CONNECTION LCD + #else #define SDCARD_CONNECTION ONBOARD #endif - #if SD_CONNECTION_IS(ONBOARD) - #define ENABLE_SPI3 - #define SD_SS_PIN -1 - #define SDSS PC9 - #define SD_SCK_PIN PC10 - #define SD_MISO_PIN PC11 - #define SD_MOSI_PIN PC12 - #define SD_DETECT_PIN PC4 // SD_DETECT_PIN doesn't work with NO_SD_HOST_DRIVE disabled - #elif SD_CONNECTION_IS(LCD) - #define ENABLE_SPI1 - #define SDSS EXP2_04_PIN - #define SD_SCK_PIN EXP2_02_PIN - #define SD_MISO_PIN EXP2_01_PIN - #define SD_MOSI_PIN EXP2_06_PIN - #define SD_DETECT_PIN EXP2_07_PIN - #endif #endif -#if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI) - #define TFT_CS_PIN EXP1_07_PIN +// +// Onboard SD card +// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2 +// +#if SD_CONNECTION_IS(ONBOARD) + #define ENABLE_SPI3 + #define SD_SS_PIN -1 + #define SDSS PC9 + #define SD_SCK_PIN PC10 + #define SD_MISO_PIN PC11 + #define SD_MOSI_PIN PC12 + #define SD_DETECT_PIN PC4 // SD_DETECT_PIN doesn't work with NO_SD_HOST_DRIVE disabled +#elif SD_CONNECTION_IS(LCD) + #define ENABLE_SPI1 + #define SDSS EXP2_04_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_DETECT_PIN EXP2_07_PIN +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for BOARD_MKS_MONSTER8_V1/V2." +#endif + +#if HAS_WIRED_LCD + + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN + + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS EXP1_07_PIN + + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + + #define LCD_PINS_EN EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + + #else + + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) + #if ENABLED(MKS_MINI_12864) + + #define ENABLE_SPI1 + #define FORCE_SOFT_SPI + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN + //#define LCD_BACKLIGHT_PIN -1 + //#define LCD_RESET_PIN -1 + + #elif ENABLED(FYSETC_MINI_12864_2_1) + + #define LCD_PINS_DC EXP1_04_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 LCD_PINS_DC + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN + #define DOGLCD_MOSI EXP2_06_PIN + #define DOGLCD_SCK EXP2_02_PIN + #if SD_CONNECTION_IS(ONBOARD) + #define FORCE_SOFT_SPI + #endif + //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 + + #else + + #define LCD_PINS_D4 EXP1_05_PIN + #if IS_ULTIPANEL + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN + #endif + + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 96 + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 48 + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 600 + #endif + + #endif + #endif +#endif // HAS_WIRED_LCD + +#if HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI + #define TFT_SCK_PIN EXP2_02_PIN #define TFT_MISO_PIN EXP2_01_PIN #define TFT_MOSI_PIN EXP2_06_PIN - #define TFT_DC_PIN EXP1_08_PIN - #define TFT_A0_PIN TFT_DC_PIN - #define TFT_RESET_PIN EXP1_04_PIN - - #define LCD_BACKLIGHT_PIN EXP1_03_PIN - #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN - - #define TOUCH_BUTTONS_HW_SPI - #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #ifndef TFT_WIDTH #define TFT_WIDTH 480 @@ -286,85 +367,97 @@ #define TFT_HEIGHT 320 #endif - #define TOUCH_CS_PIN EXP1_05_PIN // SPI1_NSS - #define TOUCH_SCK_PIN EXP2_02_PIN // SPI1_SCK - #define TOUCH_MISO_PIN EXP2_01_PIN // SPI1_MISO - #define TOUCH_MOSI_PIN EXP2_06_PIN // SPI1_MOSI + #if ENABLED(BTT_TFT35_SPI_V1_0) - #define LCD_READ_ID 0xD3 - #define LCD_USE_DMA_SPI + /** + * ------ ------ + * BEEPER | 1 2 | LCD-BTN MISO | 1 2 | CLK + * T_MOSI | 3 4 | T_CS LCD-ENCA | 3 4 | TFTCS + * T_CLK | 5 6 T_MISO LCD-ENCB | 5 6 MOSI + * PENIRQ | 7 8 | F_CS RS | 7 8 | RESET + * GND | 9 10 | VCC GND | 9 10 | NC + * ------ ------ + * EXP1 EXP2 + * + * 480x320, 3.5", SPI Display with Rotary Encoder. + * Stock Display for the BIQU B1 SE Series. + * Schematic: https://github.com/bigtreetech/TFT35-SPI/blob/master/v1/Hardware/BTT%20TFT35-SPI%20V1-SCH.pdf + */ + #define TFT_CS_PIN EXP2_04_PIN + #define TFT_DC_PIN EXP2_07_PIN + #define TFT_A0_PIN TFT_DC_PIN - #define TFT_BUFFER_WORDS 14400 + #define TOUCH_CS_PIN EXP1_04_PIN + #define TOUCH_SCK_PIN EXP1_05_PIN + #define TOUCH_MISO_PIN EXP1_06_PIN + #define TOUCH_MOSI_PIN EXP1_03_PIN + #define TOUCH_INT_PIN EXP1_07_PIN - #ifndef TOUCH_CALIBRATION_X - #define TOUCH_CALIBRATION_X -17253 - #endif - #ifndef TOUCH_CALIBRATION_Y - #define TOUCH_CALIBRATION_Y 11579 - #endif - #ifndef TOUCH_OFFSET_X - #define TOUCH_OFFSET_X 514 - #endif - #ifndef TOUCH_OFFSET_Y - #define TOUCH_OFFSET_Y -24 - #endif - #ifndef TOUCH_ORIENTATION - #define TOUCH_ORIENTATION TOUCH_LANDSCAPE - #endif - -#elif HAS_WIRED_LCD - - #define LCD_PINS_EN EXP1_03_PIN - #define LCD_PINS_RS EXP1_04_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 ENABLE_SPI1 - #define FORCE_SOFT_SPI - #define DOGLCD_A0 EXP1_07_PIN - #define DOGLCD_CS EXP1_06_PIN - #define DOGLCD_SCK EXP2_02_PIN - #define DOGLCD_MOSI EXP2_06_PIN - //#define LCD_BACKLIGHT_PIN -1 - //#define LCD_RESET_PIN -1 - - #elif ENABLED(FYSETC_MINI_12864_2_1) - - #define LCD_PINS_DC EXP1_04_PIN - #define DOGLCD_CS EXP1_03_PIN - #define DOGLCD_A0 LCD_PINS_DC - #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_05_PIN - #define NEOPIXEL_PIN EXP1_06_PIN - #define DOGLCD_MOSI EXP2_06_PIN - #define DOGLCD_SCK EXP2_02_PIN - #if SD_CONNECTION_IS(ONBOARD) - #define FORCE_SOFT_SPI + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 17540 #endif - //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 - - #else - - #define LCD_PINS_D4 EXP1_05_PIN - #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_06_PIN - #define LCD_PINS_D6 EXP1_07_PIN - #define LCD_PINS_D7 EXP1_08_PIN + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y -11388 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X -21 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 337 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE #endif - #define BOARD_ST7920_DELAY_1 96 - #define BOARD_ST7920_DELAY_2 48 - #define BOARD_ST7920_DELAY_3 600 + #elif ENABLED(MKS_TS35_V2_0) - #endif // !MKS_MINI_12864 + /** ------ ------ + * BEEPER | 1 2 | BTN_ENC SPI1_MISO | 1 2 | SPI1_SCK + * TFT_BKL / LCD_EN | 3 4 | TFT_RESET / LCD_RS BTN_EN1 | 3 4 | SPI1_CS + * TOUCH_CS / LCD_D4 | 5 6 TOUCH_INT / LCD_D5 BTN_EN2 | 5 6 SPI1_MOSI + * SPI1_CS / LCD_D6 | 7 8 | SPI1_RS / LCD_D7 SPI1_RS | 7 8 | RESET + * GND | 9 10 | VCC GND | 9 10 | VCC + * ------ ------ + * EXP1 EXP2 + */ + #define TFT_CS_PIN EXP1_07_PIN // SPI1_CS + #define TFT_DC_PIN EXP1_08_PIN // SPI1_RS + #define TFT_A0_PIN TFT_DC_PIN -#endif // HAS_WIRED_LCD + #define TFT_RESET_PIN EXP1_04_PIN + + #define LCD_BACKLIGHT_PIN EXP1_03_PIN + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN + + #define TOUCH_BUTTONS_HW_SPI + #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 + + #define TOUCH_CS_PIN EXP1_05_PIN // SPI1_NSS + #define TOUCH_SCK_PIN EXP2_02_PIN // SPI1_SCK + #define TOUCH_MISO_PIN EXP2_01_PIN // SPI1_MISO + #define TOUCH_MOSI_PIN EXP2_06_PIN // SPI1_MOSI + + #define LCD_READ_ID 0xD3 + #define LCD_USE_DMA_SPI + + #define TFT_BUFFER_WORDS 14400 + + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17253 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11579 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 514 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -24 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #endif + + #endif -#if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, HAS_WIRED_LCD) - #define BEEPER_PIN EXP1_01_PIN - #define BTN_EN1 EXP2_03_PIN - #define BTN_EN2 EXP2_05_PIN - #define BTN_ENC EXP1_02_PIN #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h index b85b2357d3..15f5d36634 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h @@ -37,6 +37,13 @@ #define SRAM_EEPROM_EMULATION +// +// Servos +// +#define SERVO0_PIN PB0 // XS2-5 +#define SERVO1_PIN PF7 // XS1-5 +#define SERVO2_PIN PF8 // XS1-6 + // // Limit Switches // @@ -48,11 +55,11 @@ #define Z_MAX_PIN PG3 // -// Servos +// Probe enable // -#define SERVO0_PIN PB0 // XS2-5 -#define SERVO1_PIN PF7 // XS1-5 -#define SERVO2_PIN PF8 // XS1-6 +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif // // Steppers 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 d096b3b3d8..050c8f2424 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 @@ -64,6 +64,13 @@ #define Z_MIN_PIN Z_DIAG_PIN #define Z_MAX_PIN E0_DIAG_PIN +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // @@ -188,25 +195,27 @@ #define KILL_PIN_STATE HIGH #endif -// Random Info -#define USB_SERIAL -1 // USB Serial -#define WIFI_SERIAL 3 // USART3 -#define MKS_WIFI_MODULE_SERIAL 1 // USART1 -#define MKS_WIFI_MODULE_SPI 2 // SPI2 - #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif -// MKS WIFI MODULE +// +// MKS WiFi Module +// #if ENABLED(MKS_WIFI_MODULE) #define WIFI_IO0_PIN PC13 #define WIFI_IO1_PIN PC7 #define WIFI_RESET_PIN PE9 + #define MKS_WIFI_MODULE_SERIAL 1 // USART1 + #define MKS_WIFI_MODULE_SPI 2 // SPI2 +#else + #define WIFI_SERIAL_PORT 3 // USART3 #endif -// MKS TEST -#if ENABLED(MKS_TEST) +// +// MKS Testing for code in lcd/extui/mks_ui +// +#if ALL(TFT_LVGL_UI, MKS_TEST) #define MKS_TEST_POWER_LOSS_PIN PA13 // PW_DET #define MKS_TEST_PS_ON_PIN PB2 // PW_OFF #endif @@ -278,6 +287,7 @@ // // LCD / Controller // + #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) #define TFT_CS_PIN EXP1_07_PIN #define TFT_SCK_PIN EXP2_02_PIN 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 5135abf9f1..5af3cf53dd 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -74,6 +74,13 @@ #define FIL_RUNOUT_PIN PA4 // MT_DET #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // @@ -284,6 +291,7 @@ // // LCD / Controller // + #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) #ifndef TOUCH_CALIBRATION_X #define TOUCH_CALIBRATION_X -17253 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h index 3ff29e6862..b20477a15d 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h @@ -101,6 +101,13 @@ #endif #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Steppers // @@ -277,8 +284,9 @@ #endif // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) @@ -352,8 +360,8 @@ // // NeoPixel LED // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PC5 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PC5 #endif // diff --git a/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV3.h b/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV3.h index 5802c07241..a256d2e7cb 100644 --- a/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV3.h +++ b/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV3.h @@ -44,9 +44,6 @@ // I2C MCP3426 (16-Bit, 240SPS, dual-channel ADC) #define HAS_MCP3426_ADC -#ifdef STM32F4 - #define HAS_STM32_UID -#endif // // Servos @@ -161,9 +158,9 @@ #define FAN_SOFT_PWM_REQUIRED // -// Neopixel +// NeoPixel // -#define NEOPIXEL_PIN PC7 +#define BOARD_NEOPIXEL_PIN PC7 #define NEOPIXEL2_PIN PC8 // diff --git a/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV4.h b/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV4.h index 1697cf000e..f7daa4c3ec 100644 --- a/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV4.h +++ b/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV4.h @@ -158,9 +158,9 @@ #define FAN_SOFT_PWM_REQUIRED // -// Neopixel +// NeoPixel // -#define NEOPIXEL_PIN PC7 +#define BOARD_NEOPIXEL_PIN PC7 #define NEOPIXEL2_PIN PC8 // diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index daed1da4b0..4574df53ac 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -139,28 +139,57 @@ #define SD_DETECT_PIN PB0 #define BEEPER_PIN PE8 +/** + * ------ ------ + * (BEEPER) ???? | 1 2 | PE7 (BTN_ENC) (MISO) ???? | 1 2 | ???? (SCK) + * (LCD_EN) PE9 | 3 4 | PE10 (LCD_RS) (BTN_EN1) PB2 | 3 4 | ???? (SD_SS) + * (LCD_D4) PE12 | 5 6 PE13 (LCD_D5) (BTN_EN2) PB1 | 5 6 ???? (MOSI) + * (LCD_D6) PE14 | 7 8 | PE15 (LCD_D7) (SD_DETECT) ???? | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_01_PIN -1 +#define EXP1_02_PIN PE7 // ENC +#define EXP1_03_PIN PE9 +#define EXP1_04_PIN PE10 +#define EXP1_05_PIN PE12 +#define EXP1_06_PIN PE13 // CS +#define EXP1_07_PIN PE14 // A0 +#define EXP1_08_PIN PE15 + +#define EXP2_01_PIN -1 +#define EXP2_02_PIN -1 +#define EXP2_03_PIN PB2 // EN1 +#define EXP2_04_PIN -1 +#define EXP2_05_PIN PB1 // EN2 +#define EXP2_06_PIN -1 +#define EXP2_07_PIN -1 +#define EXP2_08_PIN -1 + // // LCD / Controller // + #if HAS_WIRED_LCD - #define BTN_EN1 PB2 - #define BTN_EN2 PB1 - #define BTN_ENC PE7 + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN - #define LCD_PINS_RS PE10 - #define LCD_PINS_EN PE9 - #define LCD_PINS_D4 PE12 + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS PE13 - #define DOGLCD_A0 PE14 + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_A0 EXP1_07_PIN #endif #if IS_ULTIPANEL - #define LCD_PINS_D5 PE13 - #define LCD_PINS_D6 PE14 - #define LCD_PINS_D7 PE15 + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder diff --git a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h index 6149000598..cec7780b94 100644 --- a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h +++ b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h @@ -45,9 +45,9 @@ #endif // -// Neopixels +// NeoPixel // -#define NEOPIXEL_PIN PA8 +#define BOARD_NEOPIXEL_PIN PA8 // // Servos @@ -134,17 +134,21 @@ // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0 + #define X_SLAVE_ADDRESS 0 #endif #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 1 + #define Y_SLAVE_ADDRESS 1 #endif #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 2 + #define Z_SLAVE_ADDRESS 2 #endif #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 3 + #define E0_SLAVE_ADDRESS 3 #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_TH3D_EZBOARD_V2."); + static_assert(Y_SLAVE_ADDRESS == 1, "Y_SLAVE_ADDRESS must be 1 for BOARD_TH3D_EZBOARD_V2."); + static_assert(Z_SLAVE_ADDRESS == 2, "Z_SLAVE_ADDRESS must be 2 for BOARD_TH3D_EZBOARD_V2."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_TH3D_EZBOARD_V2."); // Reduce baud rate to improve software serial reliability #ifndef TMC_BAUD_RATE diff --git a/Marlin/src/pins/stm32f4/pins_TRONXY_CXY_446_V10.h b/Marlin/src/pins/stm32f4/pins_TRONXY_CXY_446_V10.h new file mode 100644 index 0000000000..7e35bfd08f --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_TRONXY_CXY_446_V10.h @@ -0,0 +1,256 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * BOARD_TRONXY_CXY_446_V10 + * + * CXY-V6-191121 / CXY-446-V10-220413 + */ + +#pragma once + +#include "env_validate.h" + +#if EXTRUDERS > 2 || E_STEPPERS > 2 || NUM_RUNOUT_SENSORS > 2 + #error "TRONXY CXY 446 V10 only supports 2 Extruders / E steppers / Filament Runout sensors." +#endif + +#define BOARD_INFO_NAME "BOARD_TRONXY_CXY_446_V10" +#define DEFAULT_MACHINE_NAME "TRONXY CXY 446 V10" + +#define STEP_TIMER 6 +#define TEMP_TIMER 14 + +// +// EEPROM +// +#if NO_EEPROM_SELECTED + #define I2C_EEPROM + //#define FLASH_EEPROM_EMULATION + #undef NO_EEPROM_SELECTED +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE) + #define EEPROM_PAGE_SIZE (0x800U) // 2K, but will use 2x more (4K) + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE +#else + #define MARLIN_EEPROM_SIZE 0x800 // 2K (FT24C16A) +#endif + +// +// SPI Flash +// +#define SPI_FLASH // W25Q16 +#if ENABLED(SPI_FLASH) + #define SPI_FLASH_SIZE 0x1000000 // 16MB + #define SPI_FLASH_CS_PIN PG15 + #define SPI_FLASH_MOSI_PIN PB5 + #define SPI_FLASH_MISO_PIN PB4 + #define SPI_FLASH_SCK_PIN PB3 +#endif + +// +// SD Card / Flash Drive +// +#define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive Support + +// +// SD Card +// +#define ONBOARD_SDIO +#define SD_DETECT_PIN -1 +#define SDIO_CLOCK 4500000 +#define SDIO_READ_RETRIES 16 + +#define SDIO_D0_PIN PC8 +#define SDIO_D1_PIN PC9 +#define SDIO_D2_PIN PC10 +#define SDIO_D3_PIN PC11 +#define SDIO_CK_PIN PC12 +#define SDIO_CMD_PIN PD2 + +// +// Limit Switches +// +#define X_STOP_PIN PC15 +#define Y_STOP_PIN PC14 + +#if ENABLED(FIX_MOUNTED_PROBE) + #define Z_STOP_PIN PE3 +#else + #define Z_STOP_PIN PC13 +#endif + +// +// Filament Sensors +// +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #define FIL_RUNOUT_PIN PE6 + #define FIL_RUNOUT2_PIN PF12 +#endif + +// +// Steppers +// +#define X_ENABLE_PIN PF0 +#define X_STEP_PIN PE5 +#define X_DIR_PIN PF1 + +#define Y_ENABLE_PIN PF5 +#define Y_STEP_PIN PF9 +#define Y_DIR_PIN PF3 + +#define Z_ENABLE_PIN PA5 +#define Z_STEP_PIN PA6 +#define Z_DIR_PIN PF15 + +#define E0_ENABLE_PIN PF14 +#define E0_STEP_PIN PB1 +#define E0_DIR_PIN PF13 + +#define E1_ENABLE_PIN PG5 +#define E1_STEP_PIN PD12 +#define E1_DIR_PIN PG4 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC3 +#define TEMP_1_PIN PC0 +#define TEMP_BED_PIN PC2 + +// +// Heaters +// +#define HEATER_0_PIN PG7 // Hotend #1 Heater +#define HEATER_1_PIN PA15 // Hotend #2 Heater +#define HEATER_BED_PIN PE2 + +// +// Fans +// +#define FAN_SOFT_PWM_REQUIRED + +#define FAN0_PIN PG0 // Part Cooling Fan #1 +#define FAN1_PIN PB6 // Part Cooling Fan #2 +#define FAN2_PIN PG9 // Extruder/Hotend #1 Heatsink Fan +#define FAN3_PIN PF10 // Extruder/Hotend #2 Heatsink Fan +#define CONTROLLER_FAN_PIN PD7 + +// +// Laser / Servos +// +#define SPINDLE_LASER_ENA_PIN PB11 // WiFi Module TXD (Pin5) +#define SPINDLE_LASER_PWM_PIN PB10 // WiFi Module RXD (Pin4) + +// +// NOTE: The PWM pin definition const PinMap PinMap_PWM[] in PeripheralPins.c must be augmented here. +// See PWM_PIN(x) definition for details. +// + +// +// TFT with FSMC interface +// +#if HAS_FSMC_TFT + #define TOUCH_CS_PIN PD11 + #define TOUCH_SCK_PIN PB13 + #define TOUCH_MISO_PIN PB14 + #define TOUCH_MOSI_PIN PB15 + + #define TFT_RESET_PIN PB12 + #define TFT_BACKLIGHT_PIN PG8 + + #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT + #define FSMC_DMA_DEV DMA2 + #define FSMC_DMA_CHANNEL DMA_CH5 + #define FSMC_CS_PIN PG12 + #define FSMC_RS_PIN PG2 + + #define TFT_CS_PIN FSMC_CS_PIN + #define TFT_RS_PIN FSMC_RS_PIN + + #if ENABLED(TFT_LVGL_UI) + #define HAS_SPI_FLASH_FONT 1 + #define HAS_GCODE_PREVIEW 1 + #define HAS_GCODE_DEFAULT_VIEW_IN_FLASH 0 + #define HAS_LANG_SELECT_SCREEN 1 + #define HAS_BAK_VIEW_IN_FLASH 0 + #define HAS_LOGO_IN_FLASH 0 + #elif ANY(TFT_CLASSIC_UI, TFT_COLOR_UI) + //#define TFT_DRIVER ILI9488 + #define TFT_BUFFER_WORDS 14400 + #endif + + // Touch Screen calibration + #if ENABLED(TFT_TRONXY_X5SA) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17181 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11434 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 501 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -9 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #endif + #endif + + #if ENABLED(MKS_ROBIN_TFT43) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 17184 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 10604 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X -31 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -29 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #endif + #endif +#else + #error "TRONXY CXY 446 V10 only supports TFT with FSMC interface." +#endif + +// +// Power Loss +// +#if ENABLED(PSU_CONTROL) + #define PS_ON_PIN PG10 + #define POWER_LOSS_PIN PE1 +#endif + +// +// Misc. Functions +// +//#define LED_PIN PG10 +#define BEEPER_PIN PA8 diff --git a/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h b/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h deleted file mode 100644 index 97580bf618..0000000000 --- a/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h +++ /dev/null @@ -1,257 +0,0 @@ -/** - * 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 - -#include "env_validate.h" - -#if HOTENDS > 3 || E_STEPPERS > 3 - #error "Tronxy V10 supports up to 3 hotends / E steppers." -#endif - -#define BOARD_INFO_NAME "Tronxy V10" -#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME - -#define STEP_TIMER 6 -#define TEMP_TIMER 14 - -// -// Servos -// -//#define SERVO0_PIN PB10 - -// -// EEPROM -// -#if NO_EEPROM_SELECTED - #undef NO_EEPROM_SELECTED - #if TRONXY_UI > 0 - #define EEPROM_AT24CXX - #else - #define FLASH_EEPROM_EMULATION - #endif -#endif - -#if ENABLED(FLASH_EEPROM_EMULATION) - // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h) - #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE) - #define EEPROM_PAGE_SIZE (0x800U) // 2KB, but will use 2x more (4KB) - #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE -#else - #if ENABLED(EEPROM_AT24CXX) - #define AT24CXX_SCL PB8 - #define AT24CXX_SDA PB9 - #define AT24CXX_WP PB7 - #else - #define I2C_EEPROM // AT24C32 - #endif - #define MARLIN_EEPROM_SIZE 0x1000 // 4K -#endif - -// -// SPI Flash -// -//#define SPI_FLASH -#if ENABLED(SPI_FLASH) - #define SPI_FLASH_SIZE 0x200000 // 2MB - #define SPI_FLASH_CS_PIN PG15 // SPI2 - #define SPI_FLASH_SCK_PIN PB3 - #define SPI_FLASH_MISO_PIN PB4 - #define SPI_FLASH_MOSI_PIN PB5 -#endif - -// -// Limit Switches -// -#define X_MIN_PIN PC15 -#define X_MAX_PIN PB0 -#define Y_STOP_PIN PC14 - -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN PE3 -#endif - -#if ENABLED(DUAL_Z_ENDSTOP_PROBE) - #if NUM_Z_STEPPERS > 1 && Z_HOME_TO_MAX // Swap Z1/Z2 for dual Z with max homing - #define Z_MIN_PIN PF11 - #define Z_MAX_PIN PC13 - #else - #define Z_MIN_PIN PC13 - #define Z_MAX_PIN PF11 - #endif -#else - #ifndef Z_STOP_PIN - #define Z_STOP_PIN PC13 - #endif -#endif -// -// Filament Sensors -// -#ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN PE6 // MT_DET -#endif -#ifndef FIL_RUNOUT2_PIN - #define FIL_RUNOUT2_PIN PF12 -#endif - -// -// Steppers -// -#define X_ENABLE_PIN PF0 -#define X_STEP_PIN PE5 -#define X_DIR_PIN PF1 - -#define Y_ENABLE_PIN PF5 -#define Y_STEP_PIN PF9 -#define Y_DIR_PIN PF3 - -#define Z_ENABLE_PIN PA5 -#define Z_STEP_PIN PA6 -#define Z_DIR_PIN PF15 - -#define E0_ENABLE_PIN PF14 -#define E0_STEP_PIN PB1 -#define E0_DIR_PIN PF13 - -#define E1_ENABLE_PIN PG5 -#define E1_STEP_PIN PD12 -#define E1_DIR_PIN PG4 - -#define E2_ENABLE_PIN PF7 -#define E2_STEP_PIN PF6 -#define E2_DIR_PIN PF4 - -// -// Temperature Sensors -// -#define TEMP_0_PIN PC3 // TH1 -#define TEMP_BED_PIN PC2 // TB1 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PG7 // HEATER1 -#define HEATER_BED_PIN PE2 // HOT BED -//#define HEATER_BED_INVERTING true - -#define FAN0_PIN PG0 // FAN0 -#define FAN1_PIN PB6 // FAN1 -#define FAN2_PIN PG9 // FAN2 -#define FAN3_PIN PF10 // FAN3 -#define CONTROLLER_FAN_PIN PD7 // BOARD FAN -#define FAN_SOFT_PWM_REQUIRED - -// -// Laser / Spindle -// -#if HAS_CUTTER - #define SPINDLE_LASER_ENA_PIN PB11 // wifi:TX - #if ENABLED(SPINDLE_LASER_USE_PWM) - #define SPINDLE_LASER_PWM_PIN PB10 // wifi:RX-TIM2_CH3 - // The PWM pin definition const PinMap PinMap_PWM[] in PeripheralPins.c must be compounded here - // See PWM_PIN(x) definition for details - #endif -#endif - -// -// Misc -// -#define BEEPER_PIN PA8 - -//#define LED_PIN PG10 -#define PS_ON_PIN PG10 // Temporarily switch the machine with LED simulation - -#if ENABLED(TRONXY_BACKUP_POWER) - #define POWER_LOSS_PIN PF11 // Configure as drop-down input -#else - #define POWER_LOSS_PIN PE1 // Output of LM393 comparator, configured as pullup -#endif -//#define POWER_LM393_PIN PE0 // +V for the LM393 comparator, configured as output high - -#if ENABLED(TFT_TRONXY_X5SA) - #error "TFT_TRONXY_X5SA is not yet supported." -#endif - -#if 0 - -// -// TFT with FSMC interface -// -#if HAS_FSMC_TFT - #define TFT_RESET_PIN PB12 - #define TFT_BACKLIGHT_PIN PG8 - - #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT - - #define TFT_CS_PIN PG12 - #define TFT_RS_PIN PG2 - - //#define TFT_WIDTH 480 - //#define TFT_HEIGHT 320 - //#define TFT_PIXEL_OFFSET_X 48 - //#define TFT_PIXEL_OFFSET_Y 32 - //#define TFT_DRIVER ILI9488 - //#define TFT_BUFFER_WORDS 14400 - - #if NEED_TOUCH_PINS - #define TOUCH_CS_PIN PD11 // SPI1_NSS - #define TOUCH_SCK_PIN PB13 // SPI1_SCK - #define TOUCH_MISO_PIN PB14 // SPI1_MISO - #define TOUCH_MOSI_PIN PB15 // SPI1_MOSI - #endif - - #if (LCD_CHIP_INDEX == 1 && (TRONXY_UI == 1 || TRONXY_UI == 2)) || LCD_CHIP_INDEX == 3 - #define TOUCH_CALIBRATION_X -17181 - #define TOUCH_CALIBRATION_Y 11434 - #define TOUCH_OFFSET_X 501 - #define TOUCH_OFFSET_Y -9 - #elif LCD_CHIP_INDEX == 1 && TRONXY_UI == 4 - #define TOUCH_CALIBRATION_X 11166 - #define TOUCH_CALIBRATION_Y 17162 - #define TOUCH_OFFSET_X -10 - #define TOUCH_OFFSET_Y -16 - #elif LCD_CHIP_INDEX == 4 && TRONXY_UI == 3 - //#define TOUCH_CALIBRATION_X 8781 - //#define TOUCH_CALIBRATION_Y 11773 - //#define TOUCH_OFFSET_X -17 - //#define TOUCH_OFFSET_Y -16 - // Upside-down - #define TOUCH_CALIBRATION_X -8553 - #define TOUCH_CALIBRATION_Y -11667 - #define TOUCH_OFFSET_X 253 - #define TOUCH_OFFSET_Y 331 - #elif LCD_CHIP_INDEX == 2 - #define TOUCH_CALIBRATION_X 17184 - #define TOUCH_CALIBRATION_Y 10604 - #define TOUCH_OFFSET_X -31 - #define TOUCH_OFFSET_Y -29 - #endif -#endif - -#endif - -// -// SD Card -// -#define ONBOARD_SDIO -#define SD_DETECT_PIN -1 // PF0, but not connected -#define SDIO_CLOCK 4500000 -#define SDIO_READ_RETRIES 16 diff --git a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h index bf45f94ab8..d9c542c6a2 100644 --- a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h +++ b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h @@ -181,6 +181,7 @@ // // LCD / Controller // + #if IS_RRD_FG_SC #define BEEPER_PIN PC7 // LCD_BEEPER #define BTN_ENC PE11 // BTN_ENC diff --git a/Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h b/Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h index 6c31fdc572..ffa644c88c 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h @@ -34,6 +34,7 @@ #ifndef BOARD_INFO_NAME #define BOARD_INFO_NAME "BTT EBB42 V1.1" #endif +#define BOARD_WEBSITE_URL "github.com/bigtreetech/EBB/tree/master/EBB%20CAN%20V1.1%20(STM32G0B1)/EBB42%20CAN%20V1.1" // // EEPROM @@ -105,8 +106,9 @@ // Default TMC slave addresses #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 0b00 + #define E0_SLAVE_ADDRESS 0 #endif + static_assert(E0_SLAVE_ADDRESS == 0, "E0_SLAVE_ADDRESS must be 0 for BOARD_BTT_EBB42_V1_1."); #endif // @@ -133,13 +135,14 @@ // // Default NEOPIXEL_PIN // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PD3 // LED driving pin +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PD3 // LED driving pin #endif // // LCD / Controller // + #if HAS_WIRED_LCD #define BTN_EN1 PB7 #define BTN_EN2 PB5 diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h index c2c16ba696..3489fe5c8f 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h @@ -262,9 +262,7 @@ * (EXP1-8) PA1 <-----------> A (DWIN-8) * (EXP1-10) 5V <-----------> VCC (DWIN-10) */ - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! Ender-3 V2 display requires a custom cable with TX = PA0, RX = PC2. See 'pins_BTT_MANTA_E3_EZ_V1_0.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_MANTA_E3_EZ_V1_0", "Ender-3 V2 display", " Requires a custom cable with TX = PA0, RX = PC2.") #define BEEPER_PIN EXP1_01_PIN #define BTN_EN1 EXP1_08_PIN @@ -287,9 +285,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_MANTA_E3_EZ_V1_0.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_MANTA_E3_EZ_V1_0", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN @@ -348,6 +344,6 @@ // // NeoPixel LED // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PC7 // RGB +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PC7 // RGB #endif diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V2_1.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V2_1.h index 2990fc50a1..b7c5a8c470 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V2_1.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V2_1.h @@ -208,8 +208,9 @@ #endif // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) @@ -303,8 +304,8 @@ // // NeoPixel LED // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PD0 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PD0 #endif #ifndef NEOPIXEL2_PIN diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M5P_V1_0.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M5P_V1_0.h index ed3fb4e9dc..8d75638ee5 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M5P_V1_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M5P_V1_0.h @@ -236,8 +236,9 @@ #endif // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) @@ -331,8 +332,8 @@ // // NeoPixel LED // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PC11 // RGB1 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PC11 // RGB1 #endif #ifndef NEOPIXEL2_PIN diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_V1_0.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_V1_0.h index 824e44130f..b81dbe0dac 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_V1_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_V1_0.h @@ -73,8 +73,8 @@ // // NeoPixel LED // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PC6 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PC6 #endif #ifndef NEOPIXEL2_PIN diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_V1_1.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_V1_1.h index d7c15eaa04..36aa3895c3 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_V1_1.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_V1_1.h @@ -72,8 +72,8 @@ // // NeoPixel LED // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PA9 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PA9 #endif #ifndef NEOPIXEL2_PIN diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h index 796527b364..327c5f1970 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h @@ -286,8 +286,9 @@ #endif // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) 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 a516768462..6c724ad1bf 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 @@ -63,6 +63,13 @@ // #define Z_MIN_PROBE_PIN PC14 // PROBE +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -112,17 +119,21 @@ // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS - #define X_SLAVE_ADDRESS 0 + #define X_SLAVE_ADDRESS 0 #endif #ifndef Y_SLAVE_ADDRESS - #define Y_SLAVE_ADDRESS 2 + #define Y_SLAVE_ADDRESS 2 #endif #ifndef Z_SLAVE_ADDRESS - #define Z_SLAVE_ADDRESS 1 + #define Z_SLAVE_ADDRESS 1 #endif #ifndef E0_SLAVE_ADDRESS - #define E0_SLAVE_ADDRESS 3 + #define E0_SLAVE_ADDRESS 3 #endif + static_assert(X_SLAVE_ADDRESS == 0, "X_SLAVE_ADDRESS must be 0 for BOARD_BTT_SKR_MINI_E3_V3_0."); + static_assert(Y_SLAVE_ADDRESS == 2, "Y_SLAVE_ADDRESS must be 2 for BOARD_BTT_SKR_MINI_E3_V3_0."); + static_assert(Z_SLAVE_ADDRESS == 1, "Z_SLAVE_ADDRESS must be 1 for BOARD_BTT_SKR_MINI_E3_V3_0."); + static_assert(E0_SLAVE_ADDRESS == 3, "E0_SLAVE_ADDRESS must be 3 for BOARD_BTT_SKR_MINI_E3_V3_0."); #endif // @@ -162,6 +173,20 @@ #define EXP1_09_PIN -1 #define EXP1_10_PIN -1 +/** SPI Port + * ------ + * 5V | 1 2 | GND + * CS | 3 4 | CLK + * MOSI | 5 6 | MISO + * 3V3 | 7 8 | GND + * ------ + * SPI1 + */ +#define SPI1_03_PIN PD9 +#define SPI1_04_PIN PA5 +#define SPI1_05_PIN PA7 +#define SPI1_06_PIN PA6 + #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI /** * ------ ------ ------ @@ -176,9 +201,7 @@ * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on. */ - #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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0", "DWIN_CREALITY_LCD", " Requires a custom cable.") #define BEEPER_PIN EXP1_02_PIN #define BTN_EN1 EXP1_08_PIN @@ -224,7 +247,7 @@ #define LCD_BACKLIGHT_PIN -1 #define NEOPIXEL_PIN EXP1_02_PIN #else - #error "Only CR10_FYSETC_MINI_12864_2_1 and compatibles are currently supported on the BIGTREE_SKR_MINI_E3 with SKR_MINI_SCREEN_ADAPTER" + #error "Only FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 / BEEZ_MINI_12864 are currently supported on the BIGTREE_SKR_MINI_E3 with SKR_MINI_SCREEN_ADAPTER." #endif #else @@ -243,9 +266,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN @@ -273,9 +294,7 @@ #if ENABLED(TFTGLCD_PANEL_SPI) - #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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0", "TFTGLCD_PANEL_SPI") /** * TFTGLCD_PANEL_SPI display pinout @@ -312,9 +331,7 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) - #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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0", "FYSETC_MINI_12864_2_1 and clones") /** * @@ -366,9 +383,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #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 + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0", "LCD_FYSETC_TFT81050") /** * FYSETC TFT TFT81050 display pinout @@ -435,8 +450,19 @@ #define SD_MOSI_PIN PA7 // -// Default NEOPIXEL_PIN +// NeoPixel // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PA8 // LED driving pin +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PA8 // LED driving pin #endif + +// Pins for documentation and sanity checks only. +// Changing these will not change the pin they are on. + +// Hardware UART pins +#define UART1_TX_PIN PA9 // default usage LCD connector +#define UART1_RX_PIN PA10 // default usage LCD connector +#define UART2_TX_PIN PA2 // default usage TFT connector +#define UART2_RX_PIN PA3 // default usage TFT connector +#define UART4_TX_PIN PC10 // default usage TMC UART +#define UART4_RX_PIN PC11 // default usage TMC UART diff --git a/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h b/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h index d55e0a3f84..13bb1b7d8b 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h @@ -454,8 +454,9 @@ #endif // BTT_MOTOR_EXPANSION // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) @@ -477,9 +478,7 @@ * orientation as the existing plug/DWIN to EXP1. TX/RX need to be connected to the TFT port, with TX->RX, RX->TX. */ - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! Ender-3 V2 display requires a custom cable. See 'pins_BTT_OCTOPUS_V1_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_KRAKEN_V1_0", "Ender-3 V2 display") #define BEEPER_PIN EXP1_06_PIN #define BTN_EN1 EXP1_08_PIN @@ -515,6 +514,9 @@ #define DOGLCD_CS EXP1_03_PIN #define DOGLCD_A0 EXP1_04_PIN //#define LCD_BACKLIGHT_PIN -1 + + #define FORCE_SOFT_SPI + #define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally. #if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) #ifndef RGB_LED_R_PIN diff --git a/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h b/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h index bc6118228f..2c5c4bc05e 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h @@ -418,8 +418,9 @@ #endif // -// LCDs and Controllers +// LCD / Controller // + #if ENABLED(BTT_MINI_12864) // BTT Mini 12864 V2.0 connected via 18-pin FPC cable #define BEEPER_PIN EXP1_01_PIN diff --git a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h index 6c081f9b56..f51dbac93b 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h @@ -120,6 +120,13 @@ #define Z_MIN_PROBE_PIN PB15 #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -403,7 +410,7 @@ #endif // -// LCDs and Controllers +// LCD / Controller // #if ENABLED(BTT_MINI_12864) // BTT Mini 12864 V2.0 connected via 18-pin FPC cable @@ -441,8 +448,8 @@ // // NeoPixel LED // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PE10 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PE10 #endif #ifndef NEOPIXEL2_PIN #define NEOPIXEL2_PIN PE9 diff --git a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h index 148b21de0b..113b7eac29 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h @@ -124,6 +124,13 @@ #endif #endif +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN +#endif + // // Filament Runout Sensor // @@ -416,8 +423,9 @@ #endif // BTT_MOTOR_EXPANSION // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) @@ -439,9 +447,7 @@ * orientation as the existing plug/DWIN to EXP1. TX/RX need to be connected to the TFT port, with TX->RX, RX->TX. */ - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! Ender-3 V2 display requires a custom cable. See 'pins_BTT_OCTOPUS_V1_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_OCTOPUS_PRO_V1_common", "Ender-3 V2 display") #define BEEPER_PIN EXP1_06_PIN #define BTN_EN1 EXP1_08_PIN diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h index caa2272f4d..7314ccc825 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h @@ -23,7 +23,10 @@ #include "env_validate.h" -#define DEFAULT_MACHINE_NAME "Biqu BX" +#define BOARD_WEBSITE_URL "github.com/bigtreetech/BIQU-BX" +#define DEFAULT_MACHINE_NAME "BIQU BX" + +#define USES_DIAG_JUMPERS // Onboard I2C EEPROM #define I2C_EEPROM @@ -32,18 +35,27 @@ #define HAS_OTG_USB_HOST_SUPPORT // USB Flash Drive support //#define SWD_DEBUG // Use pins PA13 and PA14 on STM32H7 for the SWD debugger +// +// Trinamic Stallguard pins +// +#define X_DIAG_PIN PB11 // X- +#define Y_DIAG_PIN PB12 // Y- +#define Z_DIAG_PIN PD12 // Z- +#define E0_DIAG_PIN PD13 // X+ +#define E1_DIAG_PIN PB13 // Y+ + // // Limit Switches // -#define X_MIN_PIN PB11 -#define X_MAX_PIN PD13 -#define Y_MIN_PIN PB12 -#define Y_MAX_PIN PB13 -#define Z_MIN_PIN PD12 -#define Z_MAX_PIN PD11 +#define X_MIN_PIN X_DIAG_PIN // X- +#define X_MAX_PIN E0_DIAG_PIN // X+ +#define Y_MIN_PIN Y_DIAG_PIN // Y- +#define Y_MAX_PIN E1_DIAG_PIN // Y+ +#define Z_MIN_PIN Z_DIAG_PIN // Z- +#define Z_MAX_PIN PD11 // Z+ -#define FIL_RUNOUT_PIN PD13 -#define FIL_RUNOUT2_PIN PB13 +#define FIL_RUNOUT_PIN E0_DIAG_PIN // X+ +#define FIL_RUNOUT2_PIN E1_DIAG_PIN // Y+ #ifndef SWD_DEBUG #define LED_PIN PA13 @@ -53,42 +65,63 @@ #define POWER_MONITOR_PIN PB0 #define RPI_POWER_PIN PE5 -#define SERVO0_PIN PA2 +#define SERVO0_PIN PA2 // PROBE // // Z Probe (when not Z_MIN_PIN) // #ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN PH2 // Probe + #define Z_MIN_PROBE_PIN PH2 // PROBE +#endif + +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) && !defined(PROBE_ENABLE_PIN) + #define PROBE_ENABLE_PIN SERVO0_PIN #endif // // Steppers // -#define X_STEP_PIN PG13 +#define X_STEP_PIN PG13 // X #define X_DIR_PIN PG12 #define X_ENABLE_PIN PG14 #define X_CS_PIN PG10 -#define Y_STEP_PIN PB3 +#define Y_STEP_PIN PB3 // Y #define Y_DIR_PIN PD3 #define Y_ENABLE_PIN PB4 #define Y_CS_PIN PD4 -#define Z_STEP_PIN PD7 -#define Z_DIR_PIN PD6 -#define Z_ENABLE_PIN PG9 -#define Z_CS_PIN PD5 +#ifdef BX_SWAP_ZM_E1M + #define Z_STEP_PIN PA8 // E1 + #define Z_DIR_PIN PC9 + #define Z_ENABLE_PIN PD2 + #define Z_CS_PIN PC8 +#else + #define Z_STEP_PIN PD7 // Z1 + #define Z_DIR_PIN PD6 + #define Z_ENABLE_PIN PG9 + #define Z_CS_PIN PD5 +#endif -#define E0_STEP_PIN PC14 +#define E0_STEP_PIN PC14 // E0 #define E0_DIR_PIN PC13 #define E0_ENABLE_PIN PC15 #define E0_CS_PIN PI8 -#define E1_STEP_PIN PA8 -#define E1_DIR_PIN PC9 -#define E1_ENABLE_PIN PD2 -#define E1_CS_PIN PC8 +#ifdef BX_SWAP_ZM_E1M + #define E1_STEP_PIN PD7 // Z1 + #define E1_DIR_PIN PD6 + #define E1_ENABLE_PIN PG9 + #define E1_CS_PIN PD5 +#else + #define E1_STEP_PIN PA8 // E1 + #define E1_DIR_PIN PC9 + #define E1_ENABLE_PIN PD2 + #define E1_CS_PIN PC8 +#endif // // SPI pins for TMC2130 stepper drivers @@ -131,14 +164,24 @@ #define Y_SERIAL_TX_PIN PD4 #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN - #define Z_SERIAL_TX_PIN PD5 - #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + #ifdef BX_SWAP_ZM_E1M + #define Z_SERIAL_TX_PIN PC8 + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + #else + #define Z_SERIAL_TX_PIN PD5 + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + #endif #define E0_SERIAL_TX_PIN PI8 #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN - #define E1_SERIAL_TX_PIN PC8 - #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN + #ifdef BX_SWAP_ZM_E1M + #define E1_SERIAL_TX_PIN PD5 + #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN + #else + #define E1_SERIAL_TX_PIN PC8 + #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN + #endif // Reduce baud rate to improve software serial reliability #ifndef TMC_BAUD_RATE @@ -157,15 +200,15 @@ // // Heaters / Fans // -#define HEATER_0_PIN PC4 -#define HEATER_1_PIN PC5 -#define HEATER_BED_PIN PA4 +#define HEATER_0_PIN PC4 // HE0 +#define HEATER_1_PIN PC5 // HE1 +#define HEATER_BED_PIN PA4 // BED -#define FAN0_PIN PA5 // "FAN0" -#define FAN1_PIN PA6 // "FAN1" -#define FAN2_PIN PA7 // "FAN2" +#define FAN0_PIN PA5 // FAN0 +#define FAN1_PIN PA6 // FAN1 +#define FAN2_PIN PA7 // FAN2 / DCOT -#define NEOPIXEL_PIN PH3 +#define BOARD_NEOPIXEL_PIN PH3 // RGB #define NEOPIXEL2_PIN PB1 #if HAS_LTDC_TFT @@ -231,3 +274,25 @@ #define SD_MISO_PIN PC11 #define SD_MOSI_PIN PC12 #define SD_DETECT_PIN PI3 + +#if ENABLED(WIFISUPPORT) + // + // WIFI + // + + /** + * ----- + * (ESP-RX4) PA1 | 1 8 | GND + * (ESP-EN) -- | 2 7 | -- (ESP-IO2) + * (ESP-RST) -- | 3 6 | -- (ESP-IO0) + * 3.3V | 4 5 | PA0 (ESP-TX4) + * ----- + * WIFI-ESP01 + */ + #define ESP_WIFI_MODULE_COM 4 // Must also set either SERIAL_PORT / SERIAL_PORT_2 / SERIAL_PORT_3 to this + #define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT / SERIAL_PORT_2 / SERIAL_PORT_3 + #define ESP_WIFI_MODULE_RESET_PIN -1 + #define ESP_WIFI_MODULE_ENABLE_PIN -1 + #define ESP_WIFI_MODULE_GPIO0_PIN -1 + #define ESP_WIFI_MODULE_GPIO2_PIN -1 +#endif 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 index ee62002b59..b679921863 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h @@ -23,6 +23,10 @@ #include "env_validate.h" +// +// https://github.com/bigtreetech/SKR-3 +// + // 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 @@ -427,14 +431,38 @@ #endif // BTT_MOTOR_EXPANSION // -// LCDs and Controllers +// LCD / Controller // + #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) #define TFTGLCD_CS EXP2_03_PIN #endif +#elif HAS_DWIN_E3V2 || IS_DWIN_MARLINUI + /** + * ------ ------ --- + * | 1 2 | | 1 2 | 1 | + * | 3 4 | RX | 3 4 | TX | 2 | RX + * ENT 5 6 | BEEP ENT 5 6 | BEEP | 3 | TX + * B | 7 8 | A B | 7 8 | A | 4 | + * GND | 9 10 | VCC GND | 9 10 | VCC 5 | + * ------ ------ --- + * EXP1 DWIN TFT + * + * DWIN pins are labeled as printed on DWIN PCB. GND, VCC, A, B, ENT & BEEP can be connected in the same + * orientation as the existing plug/DWIN to EXP1. TX/RX need to be connected to the TFT port, with TX->RX, RX->TX. + */ + #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #error "CAUTION! Ender-3 V2 display requires a custom cable. See 'pins_BTT_SKR_V3_0_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #endif + + #define BEEPER_PIN EXP1_06_PIN + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_07_PIN + #define BTN_ENC EXP1_05_PIN + #elif HAS_WIRED_LCD #define BEEPER_PIN EXP1_01_PIN @@ -627,8 +655,8 @@ // // NeoPixel LED // -#ifndef NEOPIXEL_PIN - #define NEOPIXEL_PIN PE6 +#ifndef BOARD_NEOPIXEL_PIN + #define BOARD_NEOPIXEL_PIN PE6 #endif #if ENABLED(WIFISUPPORT) diff --git a/Marlin/src/pins/teensy2/pins_5DPRINT.h b/Marlin/src/pins/teensy2/pins_5DPRINT.h index 798f98dae5..1b1bbf122d 100644 --- a/Marlin/src/pins/teensy2/pins_5DPRINT.h +++ b/Marlin/src/pins/teensy2/pins_5DPRINT.h @@ -64,8 +64,7 @@ /** * 5DPrint D8 Driver board pin assignments - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/5DPrint%20D8/5DPD8_v1.0_OS_schematics.PDF - * Origin: https://bitbucket.org/makible/5dprint-d8-controller-board/src/master/5DPD8_v1.0_OS_schematics.PDF + * Schematic: https://bitbucket.org/makible/5dprint-d8-controller-board/src/master/5DPD8_v1.0_OS_schematics.PDF * * https://bitbucket.org/makible/5dprint-d8-controller-board */ diff --git a/Marlin/src/pins/teensy2/pins_BRAINWAVE.h b/Marlin/src/pins/teensy2/pins_BRAINWAVE.h index 900eae6dd4..8bdd926dda 100644 --- a/Marlin/src/pins/teensy2/pins_BRAINWAVE.h +++ b/Marlin/src/pins/teensy2/pins_BRAINWAVE.h @@ -28,8 +28,7 @@ * Requires hardware bundle for Arduino: * https://github.com/unrepentantgeek/brainwave-arduino * - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Brainwave/schematic.pdf - * Origin: https://github.com/unrepentantgeek/Brainwave/blob/master/brainwave/brainwave.sch + * Schematic: https://github.com/unrepentantgeek/Brainwave/blob/master/brainwave/brainwave.sch */ /** diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h index c1eee00c2d..f36ea66cf7 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h @@ -26,14 +26,10 @@ * * Converted to Arduino pin numbering * - * Schematic (RevA): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.A/schematic.png - * Origin (RevA): https://raw.githubusercontent.com/lwalkera/printrboard/revA/Printrboard.sch - * Schematic (RevB): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.B/schematic.png - * Origin (RevB): https://raw.githubusercontent.com/lwalkera/printrboard/revB/Printrboard.sch - * Schematic (RevC): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.C/schematic.png - * Origin (RevC): https://raw.githubusercontent.com/lwalkera/printrboard/revC/Printrboard.sch - * Schematic (RevD): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.D/schematic.png - * Origin (RevD): https://raw.githubusercontent.com/lwalkera/printrboard/RevD/Printrboard.sch + * Schematic (RevA): https://raw.githubusercontent.com/lwalkera/printrboard/revA/Printrboard.sch + * Schematic (RevB): https://raw.githubusercontent.com/lwalkera/printrboard/revB/Printrboard.sch + * Schematic (RevC): https://raw.githubusercontent.com/lwalkera/printrboard/revC/Printrboard.sch + * Schematic (RevD): https://raw.githubusercontent.com/lwalkera/printrboard/RevD/Printrboard.sch */ /** @@ -130,6 +126,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD && IS_NEWPANEL #define LCD_PINS_RS 9 // E1 JP11-11 diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h index 62922399d8..ef70d1a2cb 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h @@ -26,18 +26,12 @@ * * Converted to Arduino pin numbering * - * Schematic (RevF): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F/schematic.png - * Origin (RevF): https://github.com/lwalkera/printrboard/raw/revF/Printrboard.sch - * Schematic (RevF2): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F2/schematic.png - * Origin (RevF2): https://raw.githubusercontent.com/lwalkera/printrboard/revF2/Printrboard.sch - * Schematic (RevF3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F3/schematic.png - * Origin (RevF3): https://raw.githubusercontent.com/lwalkera/printrboard/revF3/Printrboard.sch - * Schematic (RevF4): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F4/schematic.png - * Origin (RevF4): https://raw.githubusercontent.com/lwalkera/printrboard/revF4/Printrboard.sch - * Schematic (RevF5): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F5/schematic.png - * Origin (RevF5): https://raw.githubusercontent.com/lwalkera/printrboard/revF5/Printrboard.sch - * Schematic (RevF6): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F6/schematic.png - * Origin (RevF6): https://raw.githubusercontent.com/lwalkera/printrboard/revF6/Printrboard.sch + * Schematic (RevF): https://github.com/lwalkera/printrboard/raw/revF/Printrboard.sch + * Schematic (RevF2): https://raw.githubusercontent.com/lwalkera/printrboard/revF2/Printrboard.sch + * Schematic (RevF3): https://raw.githubusercontent.com/lwalkera/printrboard/revF3/Printrboard.sch + * Schematic (RevF4): https://raw.githubusercontent.com/lwalkera/printrboard/revF4/Printrboard.sch + * Schematic (RevF5): https://raw.githubusercontent.com/lwalkera/printrboard/revF5/Printrboard.sch + * Schematic (RevF6): https://raw.githubusercontent.com/lwalkera/printrboard/revF6/Printrboard.sch */ /** diff --git a/Marlin/src/pins/teensy2/pins_SAV_MKI.h b/Marlin/src/pins/teensy2/pins_SAV_MKI.h index 9f590cbbb4..a0d056f850 100644 --- a/Marlin/src/pins/teensy2/pins_SAV_MKI.h +++ b/Marlin/src/pins/teensy2/pins_SAV_MKI.h @@ -26,8 +26,7 @@ * * Converted to Arduino pin numbering * - * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/SAV%20MkI/SAV_MK-I.pdf - * Origin: https://reprap.org/mediawiki/images/3/3c/SAV_MK-I.pdf + * Schematic: https://reprap.org/mediawiki/images/3/3c/SAV_MK-I.pdf */ /** diff --git a/Marlin/src/pins/teensy2/pins_TEENSY2.h b/Marlin/src/pins/teensy2/pins_TEENSY2.h index 9c8c6ce628..dac4c6c940 100644 --- a/Marlin/src/pins/teensy2/pins_TEENSY2.h +++ b/Marlin/src/pins/teensy2/pins_TEENSY2.h @@ -167,6 +167,7 @@ // // LCD / Controller // + #if IS_ULTIPANEL #define LCD_PINS_RS 8 // E0 #define LCD_PINS_EN 9 // E1 diff --git a/Marlin/src/pins/teensy2/pins_TEENSYLU.h b/Marlin/src/pins/teensy2/pins_TEENSYLU.h index deeffe9038..454aff91fc 100644 --- a/Marlin/src/pins/teensy2/pins_TEENSYLU.h +++ b/Marlin/src/pins/teensy2/pins_TEENSYLU.h @@ -25,8 +25,7 @@ * * Converted to Arduino pin numbering * - * Schematic (1.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Teensylu%20v1.0/schematic.png - * Origin (1.0): https://raw.githubusercontent.com/StephS/Teensylu/master/working/Teensylu-1.0.sch + * Schematic (1.0): https://raw.githubusercontent.com/StephS/Teensylu/master/working/Teensylu-1.0.sch * (*) Other versions are discouraged by creator. */ @@ -149,6 +148,7 @@ // // LCD / Controller // + #if HAS_WIRED_LCD && IS_NEWPANEL #define BEEPER_PIN -1 diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 94c1b02e0e..3963043ca6 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -253,7 +253,7 @@ bool SdBaseFile::exists(const char *name) { * * \return For success fgets() returns the length of the string in \a str. * If no data is read, fgets() returns zero for EOF or -1 if an error occurred. - **/ + */ int16_t SdBaseFile::fgets(char *str, int16_t num, char *delim) { char ch; int16_t n = 0; @@ -1295,7 +1295,6 @@ static void print2u(const uint8_t v) { * \param[in] fatDate The date field from a directory entry. */ - /** * %Print a directory date field. * @@ -1312,7 +1311,6 @@ void SdBaseFile::printFatDate(const uint16_t fatDate) { print2u(FAT_DAY(fatDate)); } - /** * %Print a directory time field. * diff --git a/Marlin/src/sd/SdBaseFile.h b/Marlin/src/sd/SdBaseFile.h index b806a3cd70..dc31e8492d 100644 --- a/Marlin/src/sd/SdBaseFile.h +++ b/Marlin/src/sd/SdBaseFile.h @@ -67,7 +67,6 @@ uint8_t const LS_DATE = 1, // ls() flag to print modify date LS_SIZE = 2, // ls() flag to print file size LS_R = 4; // ls() flag for recursive list of subdirectories - // flags for timestamp uint8_t const T_ACCESS = 1, // Set the file's last access date T_CREATE = 2, // Set the file's creation date and time diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index ae74155482..25a30585f8 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -34,8 +34,6 @@ #if ENABLED(DWIN_CREALITY_LCD) #include "../lcd/e3v2/creality/dwin.h" -#elif ENABLED(DWIN_LCD_PROUI) - #include "../lcd/e3v2/proui/dwin.h" #endif #include "../module/planner.h" // for synchronize diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp index 889b8560aa..016500d2d6 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp @@ -201,7 +201,7 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque * Keep sending INs and writes data to memory area pointed by 'data' * rcode 0 if no errors. rcode 01-0f is relayed from dispatchPkt(). Rcode f0 means RCVDAVIRQ error, fe = USB xfer timeout */ -uint8_t USB::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data, uint8_t bInterval /*= 0*/) { +uint8_t USB::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data, uint8_t bInterval/*=0*/) { EpInfo *pep = nullptr; uint16_t nak_limit = 0; diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h index 2b6e1be522..16b8c092cc 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h @@ -201,8 +201,6 @@ typedef struct { uint16_t wLength; // 6 Depends on bRequest } __attribute__((packed)) SETUP_PKT, *PSETUP_PKT; - - // Base class for incoming data parser class USBReadParser { diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp index 1aeef1703f..551fb274d7 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp @@ -796,7 +796,6 @@ uint8_t BulkOnly::RequestSense(uint8_t lun, uint16_t size, uint8_t *buf) { return Transaction(&cbw, size, buf); } - //////////////////////////////////////////////////////////////////////////////// // USB code //////////////////////////////////////////////////////////////////////////////// @@ -1148,7 +1147,6 @@ uint8_t BulkOnly::HandleSCSIError(uint8_t status) { } // switch } - //////////////////////////////////////////////////////////////////////////////// // Debugging code //////////////////////////////////////////////////////////////////////////////// diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h index 99c628f888..f4d2af5176 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h @@ -79,7 +79,6 @@ #define HID_DESCRIPTOR_HID 0x21 - /* OTG SET FEATURE Constants */ #define OTG_FEATURE_B_HNP_ENABLE 3 // SET FEATURE OTG - Enable B device to perform HNP #define OTG_FEATURE_A_HNP_SUPPORT 4 // SET FEATURE OTG - A device supports HNP @@ -92,7 +91,6 @@ #define USB_TRANSFER_TYPE_INTERRUPT 0x03 // Endpoint is an interrupt endpoint. #define bmUSB_TRANSFER_TYPE 0x03 // bit mask to separate transfer type from ISO attributes - /* Standard Feature Selectors for CLEAR_FEATURE Requests */ #define USB_FEATURE_ENDPOINT_STALL 0 // Endpoint recipient #define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // Device recipient diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt b/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt index 378786f940..f543bbaa64 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt @@ -5,14 +5,12 @@ The lib-uhs3/ folder contains a subset of the files from the USB Host Shield https://github.com/felis/UHS30 - ==== LICENSE SUMMARY ==== Source Path: Repository: License: ------------ ----------- -------- usb_flashdrive/lib github.com/felis/UHS30 GPLv2 or later - ==== MARLIN INTEGRATION WORK ==== All additional work done to integrate USB into Marlin was performed by diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h index b35e53686e..c94e7ab990 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h @@ -27,7 +27,6 @@ e-mail : support@circuitsathome.com #ifndef __UHS_BULK_STORAGE_H__ #define __UHS_BULK_STORAGE_H__ - //////////////////////////////////////////////////////////////////////////////// // Define any of these options at the top of your sketch to override // the defaults contained herewith. Do NOT do modifications here. @@ -201,7 +200,6 @@ public: uint8_t SCSITransaction6(SCSI_CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir); uint8_t SCSITransaction10(SCSI_CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir); - // Configure and internal methods, these should never be called by a user's sketch. uint8_t Start(); bool OKtoEnumerate(ENUMERATION_INFO *ei); @@ -211,12 +209,10 @@ public: return bAddress; }; - void Poll(); void DriverDefaults(); - private: void Reset(); void CheckMedia(); diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h index 37ba681c5c..06deb7a0ae 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h @@ -41,9 +41,7 @@ e-mail : support@circuitsathome.com #endif //////////////////////////////////////////////////////////////////////////////// - // Interface code - //////////////////////////////////////////////////////////////////////////////// /** @@ -298,9 +296,7 @@ again: // Only developer serviceable parts below! //////////////////////////////////////////////////////////////////////////////// - // Main driver code - //////////////////////////////////////////////////////////////////////////////// UHS_NI UHS_Bulk_Storage::UHS_Bulk_Storage(UHS_USB_HOST_BASE *p) { @@ -637,11 +633,7 @@ void UHS_NI UHS_Bulk_Storage::Poll() { } //////////////////////////////////////////////////////////////////////////////// - - // SCSI code - - //////////////////////////////////////////////////////////////////////////////// /** @@ -794,13 +786,8 @@ uint8_t UHS_NI UHS_Bulk_Storage::RequestSense(uint8_t lun, uint16_t size, uint8_ return v; } - //////////////////////////////////////////////////////////////////////////////// - - // USB code - - //////////////////////////////////////////////////////////////////////////////// /** @@ -954,7 +941,6 @@ uint8_t UHS_NI UHS_Bulk_Storage::HandleUsbError(uint8_t error, uint8_t index) { if(index != epDataInIndex) return UHS_BULK_ERR_WRITE_STALL; return UHS_BULK_ERR_STALL; - case UHS_HOST_ERROR_TOGERR: // Handle a very super rare corner case, where toggles become de-synched. // I have only ran into one device that has this firmware bug, and this is @@ -1171,13 +1157,8 @@ uint8_t UHS_NI UHS_Bulk_Storage::HandleSCSIError(uint8_t status) { } // switch } - //////////////////////////////////////////////////////////////////////////////// - - // Debugging code - - //////////////////////////////////////////////////////////////////////////////// /** diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h index 58d7ba200c..9ec18fbf41 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h @@ -59,7 +59,6 @@ e-mail : support@circuitsathome.com // D6-5 Type (0- standard, 1 - class, 2 - vendor, 3 - reserved) // D4-0 Recipient (0 - device, 1 - interface, 2 - endpoint, 3 - other, 4..31 - reserved) - // TO-DO: Use the python script to generate these. // TO-DO: Add _all_ subclasses here. // USB Device Classes, Subclasses and Protocols @@ -165,7 +164,6 @@ e-mail : support@circuitsathome.com //////////////////////////////////////////////////////////////////////////////// - /* USB state machine states */ #define UHS_USB_HOST_STATE_MASK 0xF0U @@ -324,7 +322,6 @@ typedef struct { // 8 bytes total } __attribute__((packed)) SETUP_PKT, *PSETUP_PKT; - // little endian :-) 8 8 8 8 16 16 #define mkSETUP_PKT8(bmReqType, bRequest, wValLo, wValHi, wInd, total) ((uint64_t)(((uint64_t)(bmReqType)))|(((uint64_t)(bRequest))<<8)|(((uint64_t)(wValLo))<<16)|(((uint64_t)(wValHi))<<24)|(((uint64_t)(wInd))<<32)|(((uint64_t)(total)<<48))) #define mkSETUP_PKT16(bmReqType, bRequest, wVal, wInd, total) ((uint64_t)(((uint64_t)(bmReqType)))|(((uint64_t)(bRequest))<<8)|(((uint64_t)(wVal ))<<16) |(((uint64_t)(wInd))<<32)|(((uint64_t)(total)<<48))) diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h index 4d9d35bd6d..3b47bbd892 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h @@ -29,8 +29,6 @@ e-mail : support@circuitsathome.com #else #define __ADDRESS_H__ - - /* NAK powers. To save space in endpoint data structure, amount of retries before giving up and returning 0x4 is stored in */ /* bmNakPower as a power of 2. The actual nak_limit is then calculated as nak_limit = ( 2^bmNakPower - 1) */ #define UHS_USB_NAK_MAX_POWER 14 // NAK binary order maximum value @@ -192,7 +190,6 @@ public: return (!index) ? NULL : &thePool[index]; }; - // Allocates new address uint8_t UHS_NI AllocAddress(uint8_t parent, bool is_hub = false, uint8_t port = 1) { diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h index f78a3bb8f0..d87b40fea2 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h @@ -47,7 +47,6 @@ UHS_EpInfo* UHS_USB_HOST_BASE::getEpInfoEntry(uint8_t addr, uint8_t ep) { if(!p || !p->epinfo) return NULL; - UHS_EpInfo *pep; for(uint8_t j = 0; j < UHS_HOST_MAX_INTERFACE_DRIVERS; j++) { pep = (UHS_EpInfo *)(p->epinfo[j]); @@ -311,7 +310,6 @@ again: return rcode; } - #if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE ei.address = addrPool.AllocAddress(parent, false, port); @@ -1111,7 +1109,6 @@ uint8_t UHS_USB_HOST_BASE::enumerateInterface(ENUMERATION_INFO *ei) { return devConfigIndex; }; - //////////////////////////////////////////////////////////////////////////////// // Vendor Specific Interface Class //////////////////////////////////////////////////////////////////////////////// @@ -1168,7 +1165,6 @@ uint8_t UHS_NI UHS_VSI::SetInterface(ENUMERATION_INFO *ei) { //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - #if 0 /* TO-DO: Move this silliness to a NONE driver. diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h index bb2a87cf03..6e9bb8b783 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h @@ -31,7 +31,6 @@ e-mail : support@circuitsathome.com * Universal Arduino(tm) "IDE" fixups. */ - // Just in case... #ifndef SERIAL_PORT_MONITOR #define SERIAL_PORT_MONITOR Serial @@ -57,7 +56,6 @@ e-mail : support@circuitsathome.com #endif #endif - #ifndef UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE #ifndef UHS_BIG_FLASH @@ -160,7 +158,6 @@ e-mail : support@circuitsathome.com #define UHS_KIO_SETBIT_ATOMIC(r, m) (*(uint32_t *)UHS_KIO_BITBAND_ADDR((r), BITNR((m)))) = 1 #define UHS_KIO_CLRBIT_ATOMIC(r, m) (*(uint32_t *)UHS_KIO_BITBAND_ADDR((r), BITNR((m)))) = 0 - #define VALUE_BETWEEN(v,l,h) (((v)>(l)) && ((v)<(h))) #define VALUE_WITHIN(v,l,h) (((v)>=(l)) && ((v)<=(h))) #define output_pgm_message(wa,fp,mp,el) wa = &mp, fp((char *)pgm_read_pointer(wa), el) diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h index 4fc9b94079..bb464d7adf 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h @@ -167,8 +167,6 @@ extern "C" { #error no STDIO #endif // defined(ARDUINO_ARCH_PIC32) - - #ifdef __AVR__ // The only wierdo in the bunch... void UHS_AVR_printf_HELPER_init() { diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h index edf673a4fb..af8917e14d 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h @@ -91,6 +91,4 @@ template void D_PrintBin(NOTUSED(T val), NOTUSED(int lvl)) { #endif } - - #endif // __PRINTHEX_H__ diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h index c516599d6b..03bf1c1c07 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h @@ -55,7 +55,6 @@ e-mail : support@circuitsathome.com // //////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////// // DEBUGGING //////////////////////////////////////////////////////////////////////////////// diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h index 6486482d96..013be2a9d4 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h @@ -97,7 +97,6 @@ e-mail : support@circuitsathome.com #define USB_SETUP_RECIPIENT_PORT 0x04 // Wireless USB 1.0 #define USB_SETUP_RECIPIENT_RPIPE 0x05 // Wireless USB 1.0 - /* USB descriptors */ #define USB_DESCRIPTOR_DEVICE 0x01 // bDescriptorType for a Device Descriptor. #define USB_DESCRIPTOR_CONFIGURATION 0x02 // bDescriptorType for a Configuration Descriptor. @@ -123,7 +122,6 @@ e-mail : support@circuitsathome.com #define USB_HID_DESCRIPTOR 0x21 - // Conventional codes for class-specific descriptors. "Common Class" Spec (3.11) #define USB_DESCRIPTOR_CS_DEVICE 0x21 #define USB_DESCRIPTOR_CS_CONFIG 0x22 @@ -131,8 +129,6 @@ e-mail : support@circuitsathome.com #define USB_DESCRIPTOR_CS_INTERFACE 0x24 #define USB_DESCRIPTOR_CS_ENDPOINT 0x25 - - /* USB Endpoint Transfer Types */ #define USB_TRANSFER_TYPE_CONTROL 0x00 // Endpoint is a control endpoint. #define USB_TRANSFER_TYPE_ISOCHRONOUS 0x01 // Endpoint is an isochronous endpoint. diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h index 79c06a492b..eb4f35eb13 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h @@ -27,7 +27,6 @@ e-mail : support@circuitsathome.com #include "UHS_max3421e.h" #include - #ifndef SPI_HAS_TRANSACTION #error "Your SPI library installation is too old." #else @@ -58,8 +57,6 @@ e-mail : support@circuitsathome.com #define USB_HOST_SHIELD_USE_ISR 1 #endif - - #if !USB_HOST_SHIELD_USE_ISR #error NOISR Polled mode _NOT SUPPORTED YET_ @@ -180,8 +177,6 @@ e-mail : support@circuitsathome.com #endif #endif - - #ifdef NO_AUTO_SPEED // Ugly details section... // MAX3421E characteristics @@ -466,7 +461,6 @@ public: interrupts(); }; - int16_t UHS_NI Init(int16_t mseconds); int16_t UHS_NI Init() { diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h index 57352a3518..f126a6fcef 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h @@ -28,7 +28,6 @@ #error digitalPinToInterrupt not defined, complain to your board maintainer. #endif - #if USB_HOST_SHIELD_USE_ISR // allow two slots. this makes the maximum allowed shield count TWO @@ -47,7 +46,6 @@ } #endif - void UHS_NI MAX3421E_HOST::resume_host() { // Used on MCU that lack control of IRQ priority (AVR). // Resumes ISRs. @@ -875,7 +873,6 @@ void UHS_NI MAX3421E_HOST::ISRbottom() { DDSB(); } - /* USB main task. Services the MAX3421e */ #if !USB_HOST_SHIELD_USE_ISR void UHS_NI MAX3421E_HOST::ISRTask() {} diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h index eeaa4f81d9..1318ea8b28 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h @@ -126,12 +126,10 @@ AJK_IIF(AJK_BITAND(AJK_IS_COMPARABLE(x))(AJK_IS_COMPARABLE(y)) ) \ #define AJK_EQUAL(x, y) AJK_COMPL(AJK_NOT_EQUAL(x, y)) - #define AJK_COMMA() , #define AJK_COMMA_IF(n) AJK_IF(n)(AJK_COMMA, AJK_EAT)() - #define AJK_COMMA_VAR(AJK_count, AJK_v) AJK_COMMA_IF(AJK_count) AJK_v ## AJK_count #define AJK_MAKE_LIST(AJK_v, AJK_count) AJK_EVAL(AJK_REPEAT(AJK_count, AJK_COMMA_VAR, AJK_v)) diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h index f86054cad8..f50b3bd4c1 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h @@ -29,8 +29,6 @@ #define SWI_MAXIMUM_ALLOWED 4 #endif - - #if defined(__arm__) || defined(ARDUINO_ARCH_PIC32) static char dyn_SWI_initied = 0; static dyn_SWI* dyn_SWI_LIST[SWI_MAXIMUM_ALLOWED]; @@ -79,7 +77,6 @@ void softISR() { // TO-DO: Perhaps limit to 8, and inline this? // - // Make a working copy, while clearing the queue. noInterrupts(); #ifdef ARDUINO_ARCH_PIC32 @@ -117,7 +114,6 @@ void softISR() { #define DDSB() __DSB() #endif - #ifdef __arm__ #ifndef interruptsStatus #define interruptsStatus() __interruptsStatus() diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h index 07f4ae054d..652b43fd2e 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h @@ -22,7 +22,6 @@ #ifndef DYN_SWI_H #define DYN_SWI_H - #if defined(__arm__) || defined(ARDUINO_ARCH_PIC32) #ifdef ARDUINO_ARCH_PIC32 #include @@ -135,7 +134,6 @@ extern "C" #error Do not know how to relocate IRQ vectors or perform SWI #endif // SWI_IRQ_NUM - #ifndef SWI_IRQ_NUM #error SWI_IRQ_NUM not defined #else diff --git a/Marlin/src/tests/marlin_tests.cpp b/Marlin/src/tests/marlin_tests.cpp index f61f840176..89e5664345 100644 --- a/Marlin/src/tests/marlin_tests.cpp +++ b/Marlin/src/tests/marlin_tests.cpp @@ -37,41 +37,6 @@ // Startup tests are run at the end of setup() void runStartupTests() { // Call post-setup tests here to validate behaviors. - - // String with cutoff at 20 chars: - // "F-string, 1234.50, 2" - SString<20> str20; - str20 = F("F-string, "); - str20.append(1234.5f).append(',').append(' ') - .append(2345.67).append(',').append(' ') - .echoln(); - - // Truncate to "F-string" - str20.trunc(8).echoln(); - - // 100 dashes, but chopped down to DEFAULT_MSTRING_SIZE (20) - TSS(repchr_t('-', 100)).echoln(); - - // Hello World!-123456------ str(F("Hello")); - str.append(F(" World!")); - str += '-'; - str += uint8_t(123); - str += F("456"); - str += repchr_t('-', 6); - str += Spaces(3); - str += "< spaces!"; - str += int8_t(33); - str.eol(); - str += "^ eol!"; - - str.append("...", 1234.5f, '*', p_float_t(2345.602, 3), F(" = "), 1234.5 * 2345.602).echoln(); - - // Print it again with SERIAL_ECHOLN - auto print_char_ptr = [](char * const str) { SERIAL_ECHOLN(str); }; - print_char_ptr(str); - } // Periodic tests are run from within loop() diff --git a/Marlin/tests/README.md b/Marlin/tests/README.md new file mode 100644 index 0000000000..883069f044 --- /dev/null +++ b/Marlin/tests/README.md @@ -0,0 +1,5 @@ +These test files are executed by the unit-tests built from the `/test` folder. + +These are placed outside of the main PlatformIO test folder so we can collect all test files and compile them into multiple PlatformIO test binaries. This enables tests to be executed against a variety of Marlin configurations. + +To execute these tests, refer to the top-level Makefile. diff --git a/Marlin/tests/core/test_macros.cpp b/Marlin/tests/core/test_macros.cpp new file mode 100644 index 0000000000..bb269dec2b --- /dev/null +++ b/Marlin/tests/core/test_macros.cpp @@ -0,0 +1,1215 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../test/unit_tests.h" +#include + +// These represent enabled and disabled configuration options for testing. +// They will be used by multiple tests. +#define OPTION_ENABLED 1 +#define OPTION_DISABLED 0 + +MARLIN_TEST(macros_bitwise_8, TEST) { + uint8_t odd_set = 0xAA; + uint8_t even_set = 0x55; + for (uint8_t b = 0; b < 8; ++b) { + TEST_ASSERT_EQUAL((b % 2) != 0, TEST(odd_set, b)); + TEST_ASSERT_EQUAL((b % 2) == 0, TEST(even_set, b)); + } +} + +MARLIN_TEST(macros_bitwise_8, SET_BIT_TO) { + uint8_t n = 0x00; + + // Test LSB + SET_BIT_TO(n, 0, true); + TEST_ASSERT_EQUAL(0x01, n); + SET_BIT_TO(n, 0, false); + TEST_ASSERT_EQUAL(0x00, n); + + // Test MSB + SET_BIT_TO(n, 7, true); + TEST_ASSERT_EQUAL(0x80, n); + SET_BIT_TO(n, 7, false); + TEST_ASSERT_EQUAL(0x00, n); + + // Test a bit in the middle + SET_BIT_TO(n, 3, true); + TEST_ASSERT_EQUAL(0x08, n); + SET_BIT_TO(n, 3, false); + TEST_ASSERT_EQUAL(0x00, n); +} + +MARLIN_TEST(macros_bitwise_8, SBI) { + uint8_t n; + + // Test LSB + n = 0x00; + SBI(n, 0); + TEST_ASSERT_EQUAL(0x01, n); + + // Test MSB + n = 0x00; + SBI(n, 7); + TEST_ASSERT_EQUAL(0x80, n); + + // Test a bit in the middle + n = 0x00; + SBI(n, 3); + TEST_ASSERT_EQUAL(0x08, n); +} + +MARLIN_TEST(macros_bitwise_8, CBI) { + uint8_t n; + + // Test LSB + n = 0xFF; + CBI(n, 0); + TEST_ASSERT_EQUAL(0xFE, n); + + // Test MSB + n = 0xFF; + CBI(n, 7); + TEST_ASSERT_EQUAL(0x7F, n); + + // Test a bit in the middle + n = 0xFF; + CBI(n, 3); + TEST_ASSERT_EQUAL(0xF7, n); +} + +MARLIN_TEST(macros_bitwise_8, TBI) { + uint8_t n; + + // Test LSB + n = 0xAA; + TBI(n, 0); + TEST_ASSERT_EQUAL(0xAB, n); + + // Test MSB + n = 0xAA; + TBI(n, 7); + TEST_ASSERT_EQUAL(0x2A, n); + + // Test a bit in the middle + n = 0xAA; + TBI(n, 3); + TEST_ASSERT_EQUAL(0xA2, n); +} + +// 32-bit BIT operation tests +// These verify the above macros, but specifically with the MSB of a uint32_t. +// This ensures that the macros are not limited to 8-bit operations. + +MARLIN_TEST(macros_bitwise_32, TEST_32bit) { + uint32_t odd_set = 0x80000000; + uint32_t even_set = 0x00000000; + TEST_ASSERT_EQUAL(true, TEST(odd_set, 31)); + TEST_ASSERT_EQUAL(false, TEST(even_set, 31)); +} + +MARLIN_TEST(macros_bitwise_32, SET_BIT_TO_32bit) { + uint32_t n = 0x00000000; + + // Test MSB + SET_BIT_TO(n, 31, true); + TEST_ASSERT_EQUAL(0x80000000, n); + SET_BIT_TO(n, 31, false); + TEST_ASSERT_EQUAL(0x00000000, n); +} + +MARLIN_TEST(macros_bitwise_32, SBI_32bit) { + uint32_t n = 0x00000000; + + // Test MSB + SBI(n, 31); + TEST_ASSERT_EQUAL(0x80000000, n); +} + +MARLIN_TEST(macros_bitwise_32, CBI_32bit) { + uint32_t n = 0xFFFFFFFF; + + // Test MSB + CBI(n, 31); + TEST_ASSERT_EQUAL(0x7FFFFFFF, n); +} + +MARLIN_TEST(macros_bitwise_32, TBI_32bit) { + uint32_t n = 0x7FFFFFFF; + + // Test MSB + TBI(n, 31); + TEST_ASSERT_EQUAL(0xFFFFFFFF, n); +} + +// Geometry macros +MARLIN_TEST(macros_geometry, cu_int) { + TEST_ASSERT_EQUAL(8, cu(2)); + TEST_ASSERT_EQUAL(27, cu(3)); +} + +MARLIN_TEST(macros_geometry, cu_float) { + TEST_ASSERT_FLOAT_WITHIN(0.001f, 8.615f, cu(2.05f)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 28.094f, cu(3.04f)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 13.998f, cu(2.41f)); +} + +MARLIN_TEST(macros_geometry, RADIANS) { + TEST_ASSERT_FLOAT_WITHIN(0.001f, float(M_PI), RADIANS(180.0f)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 0.0f, RADIANS(0.0f)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, float(M_PI) / 4, RADIANS(45.0f)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, float(M_PI) / 2, RADIANS(90.0f)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 3 * float(M_PI) / 2, RADIANS(270.0f)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 4 * float(M_PI), RADIANS(720.0f)); +} + +MARLIN_TEST(macros_geometry, DEGREES) { + TEST_ASSERT_FLOAT_WITHIN(0.001f, 180.0f, DEGREES(float(M_PI))); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 0.0f, DEGREES(0.0f)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 45.0f, DEGREES(float(M_PI) / 4)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 90.0f, DEGREES(float(M_PI) / 2)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 270.0f, DEGREES(3 * float(M_PI) / 2)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 720.0f, DEGREES(4 * float(M_PI))); +} + +MARLIN_TEST(macros_geometry, HYPOT2) { + TEST_ASSERT_EQUAL(25, HYPOT2(3, 4)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 13.0f, HYPOT2(2.0f, 3.0f)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 18.72f, HYPOT2(2.4f, 3.6f)); +} + +MARLIN_TEST(macros_geometry, NORMSQ) { + TEST_ASSERT_EQUAL(14, NORMSQ(1, 2, 3)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 14.0f, NORMSQ(1.0f, 2.0f, 3.0f)); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 20.16f, NORMSQ(1.2f, 2.4f, 3.6f)); +} + +MARLIN_TEST(macros_geometry, CIRCLE_AREA) { + TEST_ASSERT_EQUAL(float(M_PI) * 4, CIRCLE_AREA(2)); +} + +MARLIN_TEST(macros_geometry, CIRCLE_CIRC) { + TEST_ASSERT_EQUAL(2 * float(M_PI) * 3, CIRCLE_CIRC(3)); +} + +MARLIN_TEST(macros_numeric, SIGN) { + TEST_ASSERT_EQUAL(1, SIGN(100)); + TEST_ASSERT_EQUAL(-1, SIGN(-100)); + TEST_ASSERT_EQUAL(0, SIGN(0)); +} + +MARLIN_TEST(macros_numeric, IS_POWER_OF_2) { + TEST_ASSERT_EQUAL(false, IS_POWER_OF_2(0)); + TEST_ASSERT_EQUAL(true, IS_POWER_OF_2(1)); + TEST_ASSERT_EQUAL(true, IS_POWER_OF_2(4)); + TEST_ASSERT_EQUAL(false, IS_POWER_OF_2(5)); + TEST_ASSERT_EQUAL(false, IS_POWER_OF_2(0x80000001)); + TEST_ASSERT_EQUAL(true, IS_POWER_OF_2(0x80000000)); +} + +// Numeric constraints +MARLIN_TEST(macros_numeric, NOLESS_int) { + // Scenario 1: Input was already acceptable + int a = 8; + NOLESS(a, 5); + TEST_ASSERT_EQUAL(8, a); + + // Original scenario: Input was less than the limit + a = 5; + NOLESS(a, 10); + TEST_ASSERT_EQUAL(10, a); + + // Scenario 2: Input is negative, and coerces to a positive number + a = -5; + NOLESS(a, 0); + TEST_ASSERT_EQUAL(0, a); + + // Scenario 3: Input is negative, and coerces to another negative number + a = -10; + NOLESS(a, -5); + TEST_ASSERT_EQUAL(-5, a); +} + +MARLIN_TEST(macros_numeric, NOLESS_uint) { + // Scenario 1: Input was already acceptable + unsigned int b = 8u; + NOLESS(b, 5u); + TEST_ASSERT_EQUAL(8u, b); + + // Original scenario: Input was less than the limit + b = 5u; + NOLESS(b, 10u); + TEST_ASSERT_EQUAL(10u, b); +} + +MARLIN_TEST(macros_numeric, NOLESS_float) { + // Scenario 1: Input was already acceptable + float c = 8.5f; + NOLESS(c, 5.5f); + TEST_ASSERT_EQUAL_FLOAT(8.5f, c); + + // Original scenario: Input was less than the limit + c = 5.5f; + NOLESS(c, 10.5f); + TEST_ASSERT_EQUAL_FLOAT(10.5f, c); + + // Scenario 2: Input is negative, and coerces to a positive number + c = -5.5f; + NOLESS(c, 5.0f); + TEST_ASSERT_EQUAL_FLOAT(5.0f, c); + + // Scenario 3: Input is negative, and coerces to another negative number + c = -10.5f; + NOLESS(c, -5.5f); + TEST_ASSERT_EQUAL_FLOAT(-5.5f, c); + c = -5.5f; + NOLESS(c, -10.5f); + TEST_ASSERT_EQUAL_FLOAT(-5.5f, c); +} + +MARLIN_TEST(macros_numeric, NOMORE_int) { + // Scenario 1: Input was already acceptable + int a = 8; + NOMORE(a, 10); + TEST_ASSERT_EQUAL(8, a); + + // Original scenario: Input was more than the limit + a = 15; + NOMORE(a, 10); + TEST_ASSERT_EQUAL(10, a); + + // Scenario 2: Input is positive, and coerces to a negative number + a = 5; + NOMORE(a, -2); + TEST_ASSERT_EQUAL(-2, a); + + // Scenario 3: Input is negative, and coerces to another negative number + a = -5; + NOMORE(a, -10); + TEST_ASSERT_EQUAL(-10, a); +} + +MARLIN_TEST(macros_numeric, NOMORE_uint) { + // Scenario 1: Input was already acceptable + unsigned int b = 8u; + NOMORE(b, 10u); + TEST_ASSERT_EQUAL(8u, b); + + // Original scenario: Input was more than the limit + b = 15u; + NOMORE(b, 10u); + TEST_ASSERT_EQUAL(10u, b); +} + +MARLIN_TEST(macros_numeric, NOMORE_float) { + // Scenario 1: Input was already acceptable + float c = 8.5f; + NOMORE(c, 10.5f); + TEST_ASSERT_EQUAL_FLOAT(8.5f, c); + + // Original scenario: Input was more than the limit + c = 15.5f; + NOMORE(c, 10.5f); + TEST_ASSERT_EQUAL_FLOAT(10.5f, c); + + // Scenario 2: Input is positive, and coerces to a negative number + c = 5.5f; + NOMORE(c, -1.7f); + TEST_ASSERT_EQUAL_FLOAT(-1.7f, c); + + // Scenario 3: Input is negative, and coerces to another negative number + c = -5.5f; + NOMORE(c, -10.5f); + TEST_ASSERT_EQUAL_FLOAT(-10.5f, c); +} + +MARLIN_TEST(macros_numeric, LIMIT_int) { + int a = 15; + LIMIT(a, 10, 20); + TEST_ASSERT_EQUAL(15, a); + + a = 5; + LIMIT(a, 10, 20); + TEST_ASSERT_EQUAL(10, a); + + a = 25; + LIMIT(a, 10, 20); + TEST_ASSERT_EQUAL(20, a); + + // Scenario: Range is [-10, -5] + a = -8; + LIMIT(a, -10, -5); + TEST_ASSERT_EQUAL(-8, a); + + a = -12; + LIMIT(a, -10, -5); + TEST_ASSERT_EQUAL(-10, a); + + a = -3; + LIMIT(a, -10, -5); + TEST_ASSERT_EQUAL(-5, a); + + // Scenario: Range is [-10, 5] + a = 0; + LIMIT(a, -10, 5); + TEST_ASSERT_EQUAL(0, a); + + a = -12; + LIMIT(a, -10, 5); + TEST_ASSERT_EQUAL(-10, a); + + a = 6; + LIMIT(a, -10, 5); + TEST_ASSERT_EQUAL(5, a); +} + +MARLIN_TEST(macros_numeric, LIMIT_uint) { + unsigned int b = 15u; + LIMIT(b, 10u, 20u); + TEST_ASSERT_EQUAL(15u, b); + + b = 5u; + LIMIT(b, 10u, 20u); + TEST_ASSERT_EQUAL(10u, b); + + b = 25u; + LIMIT(b, 10u, 20u); + TEST_ASSERT_EQUAL(20u, b); +} + +MARLIN_TEST(macros_numeric, LIMIT_float) { + float c = 15.5f; + LIMIT(c, 10.5f, 20.5f); + TEST_ASSERT_EQUAL_FLOAT(15.5f, c); + + c = 5.5f; + LIMIT(c, 10.5f, 20.5f); + TEST_ASSERT_EQUAL_FLOAT(10.5f, c); + + c = 25.5f; + LIMIT(c, 10.5f, 20.5f); + TEST_ASSERT_EQUAL_FLOAT(20.5f, c); + + // Scenario: Range is [-10.5, -5.5] + c = -8.5f; + LIMIT(c, -10.5f, -5.5f); + TEST_ASSERT_EQUAL_FLOAT(-8.5f, c); + + c = -12.5f; + LIMIT(c, -10.5f, -5.5f); + TEST_ASSERT_EQUAL_FLOAT(-10.5f, c); + + c = -3.5f; + LIMIT(c, -10.5f, -5.5f); + TEST_ASSERT_EQUAL_FLOAT(-5.5f, c); + + // Scenario: Range is [-10.5, 5.5] + c = 0.0f; + LIMIT(c, -10.5f, 5.5f); + TEST_ASSERT_EQUAL_FLOAT(0.0f, c); + + c = -12.5f; + LIMIT(c, -10.5f, 5.5f); + TEST_ASSERT_EQUAL_FLOAT(-10.5f, c); + + c = 6.5f; + LIMIT(c, -10.5f, 5.5f); + TEST_ASSERT_EQUAL_FLOAT(5.5f, c); +} + + +// Looping macros +MARLIN_TEST(macros_looping, DO_macro) { + #define _M_1(A) (A) + int sum = DO(M, +, 1, 2, 3, 4, 5); + TEST_ASSERT_EQUAL(15, sum); + + // Test with maximum number of arguments + sum = DO(M, +, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40); + TEST_ASSERT_EQUAL(820, sum); + #undef _M_1 +} + +// Configuration Options +MARLIN_TEST(macros_options, ENABLED_DISABLED) { + #define OPTION_A + #define OPTION_B 1 + #define OPTION_C true + #define OPTION_D 0 + #define OPTION_E false + // #define OPTION_F + + // Test ENABLED macro + TEST_ASSERT_TRUE(ENABLED(OPTION_A)); + TEST_ASSERT_TRUE(ENABLED(OPTION_B)); + TEST_ASSERT_TRUE(ENABLED(OPTION_C)); + TEST_ASSERT_FALSE(ENABLED(OPTION_D)); + TEST_ASSERT_FALSE(ENABLED(OPTION_E)); + TEST_ASSERT_FALSE(ENABLED(OPTION_F)); + + // Test DISABLED macro + TEST_ASSERT_FALSE(DISABLED(OPTION_A)); + TEST_ASSERT_FALSE(DISABLED(OPTION_B)); + TEST_ASSERT_FALSE(DISABLED(OPTION_C)); + TEST_ASSERT_TRUE(DISABLED(OPTION_D)); + TEST_ASSERT_TRUE(DISABLED(OPTION_E)); + TEST_ASSERT_TRUE(DISABLED(OPTION_F)); + + #undef OPTION_A + #undef OPTION_B + #undef OPTION_C + #undef OPTION_D + #undef OPTION_E +} + +MARLIN_TEST(macros_options, ANY) { + TEST_ASSERT_TRUE(ANY(OPTION_DISABLED, OPTION_ENABLED, OPTION_DISABLED)); // Enabled option in the middle + TEST_ASSERT_TRUE(ANY(OPTION_ENABLED, OPTION_DISABLED, OPTION_DISABLED)); // Enabled option at the beginning + TEST_ASSERT_TRUE(ANY(OPTION_DISABLED, OPTION_DISABLED, OPTION_ENABLED)); // Enabled option at the end + TEST_ASSERT_FALSE(ANY(OPTION_DISABLED, OPTION_DISABLED, OPTION_DISABLED)); // All options disabled +} + +MARLIN_TEST(macros_options, ALL) { + TEST_ASSERT_TRUE(ALL(OPTION_ENABLED, OPTION_ENABLED, OPTION_ENABLED)); // All options enabled + TEST_ASSERT_FALSE(ALL(OPTION_ENABLED, OPTION_DISABLED, OPTION_ENABLED)); // Disabled option in the middle + TEST_ASSERT_FALSE(ALL(OPTION_DISABLED, OPTION_ENABLED, OPTION_ENABLED)); // Disabled option at the beginning + TEST_ASSERT_FALSE(ALL(OPTION_ENABLED, OPTION_ENABLED, OPTION_DISABLED)); // Disabled option at the end + TEST_ASSERT_FALSE(ALL(OPTION_DISABLED, OPTION_DISABLED, OPTION_DISABLED)); // All options disabled +} + +MARLIN_TEST(macros_options, NONE) { + TEST_ASSERT_FALSE(NONE(OPTION_ENABLED, OPTION_ENABLED, OPTION_ENABLED)); // All options enabled + TEST_ASSERT_FALSE(NONE(OPTION_ENABLED, OPTION_DISABLED, OPTION_ENABLED)); // Disabled option in the middle + TEST_ASSERT_FALSE(NONE(OPTION_DISABLED, OPTION_ENABLED, OPTION_ENABLED)); // Disabled option at the beginning + TEST_ASSERT_FALSE(NONE(OPTION_ENABLED, OPTION_ENABLED, OPTION_DISABLED)); // Disabled option at the end + TEST_ASSERT_TRUE(NONE(OPTION_DISABLED, OPTION_DISABLED, OPTION_DISABLED)); // All options disabled +} + +MARLIN_TEST(macros_options, COUNT_ENABLED) { + TEST_ASSERT_EQUAL(3, COUNT_ENABLED(OPTION_ENABLED, OPTION_ENABLED, OPTION_ENABLED)); // All options enabled + TEST_ASSERT_EQUAL(2, COUNT_ENABLED(OPTION_ENABLED, OPTION_DISABLED, OPTION_ENABLED)); // Disabled option in the middle + TEST_ASSERT_EQUAL(2, COUNT_ENABLED(OPTION_DISABLED, OPTION_ENABLED, OPTION_ENABLED)); // Disabled option at the beginning + TEST_ASSERT_EQUAL(2, COUNT_ENABLED(OPTION_ENABLED, OPTION_ENABLED, OPTION_DISABLED)); // Disabled option at the end + TEST_ASSERT_EQUAL(0, COUNT_ENABLED(OPTION_DISABLED, OPTION_DISABLED, OPTION_DISABLED)); // All options disabled +} + +MARLIN_TEST(macros_options, MANY) { + TEST_ASSERT_FALSE(MANY(OPTION_ENABLED, OPTION_DISABLED, OPTION_DISABLED)); // Only one option enabled + TEST_ASSERT_TRUE(MANY(OPTION_ENABLED, OPTION_ENABLED, OPTION_DISABLED)); // Two options enabled + TEST_ASSERT_TRUE(MANY(OPTION_ENABLED, OPTION_ENABLED, OPTION_ENABLED)); // All options enabled + TEST_ASSERT_FALSE(MANY(OPTION_DISABLED, OPTION_DISABLED, OPTION_DISABLED)); // No options enabled +} + + +// Ternary macros +MARLIN_TEST(macros_options, TERN) { + TEST_ASSERT_EQUAL(1, TERN(OPTION_ENABLED, 1, 0)); // OPTION_ENABLED is enabled, so it should return '1' + TEST_ASSERT_EQUAL(0, TERN(OPTION_DISABLED, 1, 0)); // OPTION_DISABLED is disabled, so it should return '0' +} + +MARLIN_TEST(macros_options, TERN0) { + TEST_ASSERT_EQUAL(1, TERN0(OPTION_ENABLED, 1)); // OPTION_ENABLED is enabled, so it should return '1' + TEST_ASSERT_EQUAL(0, TERN0(OPTION_DISABLED, 1)); // OPTION_DISABLED is disabled, so it should return '0' +} + +MARLIN_TEST(macros_options, TERN1) { + TEST_ASSERT_EQUAL(0, TERN1(OPTION_ENABLED, 0)); // OPTION_ENABLED is enabled, so it should return '0' + TEST_ASSERT_EQUAL(1, TERN1(OPTION_DISABLED, 0)); // OPTION_DISABLED is disabled, so it should return '1' +} + +MARLIN_TEST(macros_options, TERN_) { + TEST_ASSERT_EQUAL(-1, TERN_(OPTION_ENABLED, -)1); // OPTION_ENABLED is enabled, so it should return '1' + TEST_ASSERT_EQUAL(1, TERN_(OPTION_DISABLED, -)1); // OPTION_DISABLED is disabled, so it should return nothing +} + +MARLIN_TEST(macros_options, IF_DISABLED) { + TEST_ASSERT_EQUAL(1, IF_DISABLED(OPTION_ENABLED, -)1); // OPTION_ENABLED is enabled, so it should return nothing + TEST_ASSERT_EQUAL(-1, IF_DISABLED(OPTION_DISABLED, -)1); // OPTION_DISABLED is disabled, so it should return '1' +} + +MARLIN_TEST(macros_options, OPTITEM) { + int enabledArray[] = {OPTITEM(OPTION_ENABLED, 1, 2)}; + int disabledArray[] = {OPTITEM(OPTION_DISABLED, 1, 2)}; + TEST_ASSERT_EQUAL(2, sizeof(enabledArray) / sizeof(int)); // OPTION_ENABLED is enabled, so it should return an array of size 2 + TEST_ASSERT_EQUAL(0, sizeof(disabledArray) / sizeof(int)); // OPTION_DISABLED is disabled, so it should return an array of size 0 +} + +MARLIN_TEST(macros_options, OPTARG) { + int enabledArgs[] = {0 OPTARG(OPTION_ENABLED, 1, 2)}; + int disabledArgs[] = {0 OPTARG(OPTION_DISABLED, 1, 2)}; + + int sumEnabledArgs = 0; + for (const auto& arg : enabledArgs) { + sumEnabledArgs += arg; + } + + int sumDisabledArgs = 0; + for (const auto& arg : disabledArgs) { + sumDisabledArgs += arg; + } + + TEST_ASSERT_EQUAL(3, sumEnabledArgs); // OPTION_ENABLED is enabled, so it should return 3 + TEST_ASSERT_EQUAL(0, sumDisabledArgs); // OPTION_DISABLED is disabled, so it should return 0 +} + +MARLIN_TEST(macros_options, OPTCODE) { + int enabledCode = 0; OPTCODE(OPTION_ENABLED, enabledCode = 1); + int disabledCode = 0; OPTCODE(OPTION_DISABLED, disabledCode = 1); + TEST_ASSERT_EQUAL(1, enabledCode); // OPTION_ENABLED is enabled, so it should return 1 + TEST_ASSERT_EQUAL(0, disabledCode); // OPTION_DISABLED is disabled, so it should return 0 +} + +MARLIN_TEST(macros_optional_math, PLUS_TERN0) { + int enabledPlus = 5 PLUS_TERN0(OPTION_ENABLED, 2); + int disabledPlus = 5 PLUS_TERN0(OPTION_DISABLED, 2); + TEST_ASSERT_EQUAL(7, enabledPlus); // OPTION_ENABLED is enabled, so it should return 7 + TEST_ASSERT_EQUAL(5, disabledPlus); // OPTION_DISABLED is disabled, so it should return 5 +} + +MARLIN_TEST(macros_optional_math, MINUS_TERN0) { + int enabledMinus = 5 MINUS_TERN0(OPTION_ENABLED, 2); + int disabledMinus = 5 MINUS_TERN0(OPTION_DISABLED, 2); + TEST_ASSERT_EQUAL(3, enabledMinus); // OPTION_ENABLED is enabled, so it should return 3 + TEST_ASSERT_EQUAL(5, disabledMinus); // OPTION_DISABLED is disabled, so it should return 5 +} + +MARLIN_TEST(macros_optional_math, MUL_TERN1) { + int enabledMul = 5 MUL_TERN1(OPTION_ENABLED, 2); + int disabledMul = 5 MUL_TERN1(OPTION_DISABLED, 2); + TEST_ASSERT_EQUAL(10, enabledMul); // OPTION_ENABLED is enabled, so it should return 10 + TEST_ASSERT_EQUAL(5, disabledMul); // OPTION_DISABLED is disabled, so it should return 5 +} + +MARLIN_TEST(macros_optional_math, DIV_TERN1) { + int enabledDiv = 10 DIV_TERN1(OPTION_ENABLED, 2); + int disabledDiv = 10 DIV_TERN1(OPTION_DISABLED, 2); + TEST_ASSERT_EQUAL(5, enabledDiv); // OPTION_ENABLED is enabled, so it should return 5 + TEST_ASSERT_EQUAL(10, disabledDiv); // OPTION_DISABLED is disabled, so it should return 10 +} + +MARLIN_TEST(macros_optional_math, SUM_TERN) { + int enabledSum = SUM_TERN(OPTION_ENABLED, 5, 2); + int disabledSum = SUM_TERN(OPTION_DISABLED, 5, 2); + TEST_ASSERT_EQUAL(7, enabledSum); // OPTION_ENABLED is enabled, so it should return 7 + TEST_ASSERT_EQUAL(5, disabledSum); // OPTION_DISABLED is disabled, so it should return 5 +} + +MARLIN_TEST(macros_optional_math, DIFF_TERN) { + int enabledDiff = DIFF_TERN(OPTION_ENABLED, 5, 2); + int disabledDiff = DIFF_TERN(OPTION_DISABLED, 5, 2); + TEST_ASSERT_EQUAL(3, enabledDiff); // OPTION_ENABLED is enabled, so it should return 3 + TEST_ASSERT_EQUAL(5, disabledDiff); // OPTION_DISABLED is disabled, so it should return 5 +} + +MARLIN_TEST(macros_optional_math, MUL_TERN) { + int enabledMul = MUL_TERN(OPTION_ENABLED, 5, 2); + int disabledMul = MUL_TERN(OPTION_DISABLED, 5, 2); + TEST_ASSERT_EQUAL(10, enabledMul); // OPTION_ENABLED is enabled, so it should return 10 + TEST_ASSERT_EQUAL(5, disabledMul); // OPTION_DISABLED is disabled, so it should return 5 +} + +MARLIN_TEST(macros_optional_math, DIV_TERN) { + int enabledDiv = DIV_TERN(OPTION_ENABLED, 10, 2); + int disabledDiv = DIV_TERN(OPTION_DISABLED, 10, 2); + TEST_ASSERT_EQUAL(5, enabledDiv); // OPTION_ENABLED is enabled, so it should return 5 + TEST_ASSERT_EQUAL(10, disabledDiv); // OPTION_DISABLED is disabled, so it should return 10 +} + +// Mock pin definitions +#define PIN1_PIN 1 +#define PIN2_PIN 2 +#define PIN3_PIN -1 + +MARLIN_TEST(macros_pins, PIN_EXISTS) { + // Test PIN_EXISTS macro + int pin1_exists, pin2_exists, pin3_exists, pin4_exists; + + #if PIN_EXISTS(PIN1) + pin1_exists = 1; + #else + pin1_exists = 0; + #endif + + #if PIN_EXISTS(PIN2) + pin2_exists = 1; + #else + pin2_exists = 0; + #endif + + #if PIN_EXISTS(PIN3) + pin3_exists = 1; + #else + pin3_exists = 0; + #endif + + #if PIN_EXISTS(PIN4) + pin4_exists = 1; + #else + pin4_exists = 0; + #endif + + TEST_ASSERT_TRUE(pin1_exists); + TEST_ASSERT_TRUE(pin2_exists); + TEST_ASSERT_FALSE(pin3_exists); + TEST_ASSERT_FALSE(pin4_exists); +} + +MARLIN_TEST(macros_pins, PINS_EXIST) { + // Test PINS_EXIST macro + int pins1_2_exist, pins1_3_exist; + + #if PINS_EXIST(PIN1, PIN2) + pins1_2_exist = 1; + #else + pins1_2_exist = 0; + #endif + + #if PINS_EXIST(PIN1, PIN3) + pins1_3_exist = 1; + #else + pins1_3_exist = 0; + #endif + + TEST_ASSERT_TRUE(pins1_2_exist); + TEST_ASSERT_FALSE(pins1_3_exist); +} + +MARLIN_TEST(macros_pins, ANY_PIN) { + // Test ANY_PIN macro + int any_pin1_3, any_pin3_4; + + #if ANY_PIN(PIN1, PIN3) + any_pin1_3 = 1; + #else + any_pin1_3 = 0; + #endif + + #if ANY_PIN(PIN3, PIN4) + any_pin3_4 = 1; + #else + any_pin3_4 = 0; + #endif + + TEST_ASSERT_TRUE(any_pin1_3); + TEST_ASSERT_FALSE(any_pin3_4); +} + +// Undefine mock pin definitions +#undef PIN1_PIN +#undef PIN2_PIN +#undef PIN3_PIN + + +// Mock button definitions +#define BTN_BUTTON1 1 +#define BTN_BUTTON2 2 +#define BTN_BUTTON3 -1 + +MARLIN_TEST(macros_buttons, BUTTON_EXISTS) { + // Test BUTTON_EXISTS macro + int button1_exists, button2_exists, button3_exists, button4_exists; + + #if BUTTON_EXISTS(BUTTON1) + button1_exists = 1; + #else + button1_exists = 0; + #endif + + #if BUTTON_EXISTS(BUTTON2) + button2_exists = 1; + #else + button2_exists = 0; + #endif + + #if BUTTON_EXISTS(BUTTON3) + button3_exists = 1; + #else + button3_exists = 0; + #endif + + #if BUTTON_EXISTS(BUTTON4) + button4_exists = 1; + #else + button4_exists = 0; + #endif + + TEST_ASSERT_TRUE(button1_exists); + TEST_ASSERT_TRUE(button2_exists); + TEST_ASSERT_FALSE(button3_exists); + TEST_ASSERT_FALSE(button4_exists); +} + +MARLIN_TEST(macros_buttons, BUTTONS_EXIST) { + // Test BUTTONS_EXIST macro + int buttons1_2_exist, buttons1_3_exist; + + #if BUTTONS_EXIST(BUTTON1, BUTTON2) + buttons1_2_exist = 1; + #else + buttons1_2_exist = 0; + #endif + + #if BUTTONS_EXIST(BUTTON1, BUTTON3) + buttons1_3_exist = 1; + #else + buttons1_3_exist = 0; + #endif + + TEST_ASSERT_TRUE(buttons1_2_exist); + TEST_ASSERT_FALSE(buttons1_3_exist); +} + +MARLIN_TEST(macros_buttons, ANY_BUTTON) { + // Test ANY_BUTTON macro + int any_button1_3, any_button3_4; + + #if ANY_BUTTON(BUTTON1, BUTTON3) + any_button1_3 = 1; + #else + any_button1_3 = 0; + #endif + + #if ANY_BUTTON(BUTTON3, BUTTON4) + any_button3_4 = 1; + #else + any_button3_4 = 0; + #endif + + TEST_ASSERT_TRUE(any_button1_3); + TEST_ASSERT_FALSE(any_button3_4); +} + +// Undefine mock button definitions +#undef BTN_BUTTON1 +#undef BTN_BUTTON2 +#undef BTN_BUTTON3 + + +MARLIN_TEST(macros_value_functions, WITHIN) { + // Test WITHIN macro + TEST_ASSERT_TRUE(WITHIN(5, 1, 10)); // 5 is within 1 and 10 + TEST_ASSERT_TRUE(WITHIN(1, 1, 10)); // Edge case: 1 is the lower limit + TEST_ASSERT_TRUE(WITHIN(10, 1, 10)); // Edge case: 10 is the upper limit + TEST_ASSERT_FALSE(WITHIN(0, 1, 10)); // Edge case: 0 is just below the lower limit + TEST_ASSERT_FALSE(WITHIN(11, 1, 10)); // Edge case: 11 is just above the upper limit + TEST_ASSERT_FALSE(WITHIN(15, 1, 10)); // 15 is not within 1 and 10 +} + +MARLIN_TEST(macros_value_functions, ISEOL) { + // Test ISEOL macro + TEST_ASSERT_TRUE(ISEOL('\n')); // '\n' is an end-of-line character + TEST_ASSERT_TRUE(ISEOL('\r')); // '\r' is an end-of-line character + TEST_ASSERT_FALSE(ISEOL('a')); // 'a' is not an end-of-line character +} + +MARLIN_TEST(macros_value_functions, NUMERIC) { + // Test NUMERIC macro + TEST_ASSERT_TRUE(NUMERIC('0')); // Edge case: '0' is the lowest numeric character + TEST_ASSERT_TRUE(NUMERIC('5')); // '5' is a numeric character + TEST_ASSERT_TRUE(NUMERIC('9')); // Edge case: '9' is the highest numeric character + TEST_ASSERT_FALSE(NUMERIC('0' - 1)); // Edge case: '/' is just before '0' in ASCII + TEST_ASSERT_FALSE(NUMERIC('9' + 1)); // Edge case: ':' is just after '9' in ASCII + TEST_ASSERT_FALSE(NUMERIC('a')); // 'a' is not a numeric character +} + +MARLIN_TEST(macros_value_functions, DECIMAL) { + // Test DECIMAL macro + TEST_ASSERT_TRUE(DECIMAL('0')); // Edge case: '0' is the lowest numeric character + TEST_ASSERT_TRUE(DECIMAL('5')); // '5' is a numeric character + TEST_ASSERT_TRUE(DECIMAL('9')); // Edge case: '9' is the highest numeric character + TEST_ASSERT_TRUE(DECIMAL('.')); // '.' is a decimal character + TEST_ASSERT_FALSE(DECIMAL('0' - 1)); // Edge case: '/' is just before '0' in ASCII + TEST_ASSERT_FALSE(DECIMAL('9' + 1)); // Edge case: ':' is just after '9' in ASCII + TEST_ASSERT_FALSE(DECIMAL('-')); // '-' is not a decimal character, but can appear in numbers + TEST_ASSERT_FALSE(DECIMAL('+')); // '+' is not a decimal character, but can appear in numbers + TEST_ASSERT_FALSE(DECIMAL('e')); // 'e' is not a decimal character, but can appear in scientific notation +} + +MARLIN_TEST(macros_value_functions, HEXCHR) { + // Test HEXCHR macro + TEST_ASSERT_EQUAL(0, HEXCHR('0')); // Edge case: '0' is the lowest numeric character + TEST_ASSERT_EQUAL(9, HEXCHR('9')); // Edge case: '9' is the highest numeric character + TEST_ASSERT_EQUAL(10, HEXCHR('a')); // 'a' is a hex character with value 10 + TEST_ASSERT_EQUAL(10, HEXCHR('A')); // 'A' is a hex character with value 10 + TEST_ASSERT_EQUAL(15, HEXCHR('f')); // Edge case: 'f' is the highest lowercase hex character + TEST_ASSERT_EQUAL(15, HEXCHR('F')); // Edge case: 'F' is the highest uppercase hex character + TEST_ASSERT_EQUAL(-1, HEXCHR('g')); // 'g' is not a hex character +} + +MARLIN_TEST(macros_value_functions, NUMERIC_SIGNED) { + // Test NUMERIC_SIGNED macro + TEST_ASSERT_TRUE(NUMERIC_SIGNED('0')); // Edge case: '0' is the lowest numeric character + TEST_ASSERT_TRUE(NUMERIC_SIGNED('5')); // '5' is a numeric character + TEST_ASSERT_TRUE(NUMERIC_SIGNED('9')); // Edge case: '9' is the highest numeric character + TEST_ASSERT_TRUE(NUMERIC_SIGNED('-')); // '-' is not a numeric character, but can appear in signed numbers + TEST_ASSERT_TRUE(NUMERIC_SIGNED('+')); // '+' is not a numeric character, but can appear in signed numbers + TEST_ASSERT_FALSE(NUMERIC_SIGNED('.')); // '.' is not a numeric character + TEST_ASSERT_FALSE(NUMERIC_SIGNED('0' - 1)); // Edge case: '/' is just before '0' in ASCII + TEST_ASSERT_FALSE(NUMERIC_SIGNED('9' + 1)); // Edge case: ':' is just after '9' in ASCII + TEST_ASSERT_FALSE(NUMERIC_SIGNED('e')); // 'e' is not a numeric character, but can appear in scientific notation +} + +MARLIN_TEST(macros_value_functions, DECIMAL_SIGNED) { + // Test DECIMAL_SIGNED macro + TEST_ASSERT_TRUE(DECIMAL_SIGNED('0')); // Edge case: '0' is the lowest numeric character + TEST_ASSERT_TRUE(DECIMAL_SIGNED('5')); // '5' is a decimal character + TEST_ASSERT_TRUE(DECIMAL_SIGNED('9')); // Edge case: '9' is the highest numeric character + TEST_ASSERT_TRUE(DECIMAL_SIGNED('-')); // '-' is not a numeric character, but can appear in signed numbers + TEST_ASSERT_TRUE(DECIMAL_SIGNED('+')); // '+' is not a numeric character, but can appear in signed numbers + TEST_ASSERT_TRUE(DECIMAL_SIGNED('.')); // '.' is a decimal character + TEST_ASSERT_FALSE(DECIMAL_SIGNED('0' - 1)); // Edge case: '/' is just before '0' in ASCII + TEST_ASSERT_FALSE(DECIMAL_SIGNED('9' + 1)); // Edge case: ':' is just after '9' in ASCII + TEST_ASSERT_FALSE(DECIMAL_SIGNED('e')); // 'e' is not a decimal character, but can appear in scientific notation +} + +MARLIN_TEST(macros_array, COUNT) { + // Test COUNT macro + int array[10]; + TEST_ASSERT_EQUAL(10, COUNT(array)); // The array has 10 elements +} + +MARLIN_TEST(macros_array, ZERO) { + // Test ZERO macro + int array[5] = {1, 2, 3, 4, 5}; + ZERO(array); + for (auto& element : array) { + TEST_ASSERT_EQUAL(0, element); + } +} + +MARLIN_TEST(macros_array, COPY) { + int array1[5] = {1, 2, 3, 4, 5}; + int array2[5] = {0}; + COPY(array2, array1); + for (const auto& element : array1) { + TEST_ASSERT_EQUAL(element, array2[&element - &array1[0]]); // All elements should be equal + } +} + +MARLIN_TEST(macros_expansion, CODE_N) { + int a = 0; + CODE_N(0, a+=1, a+=2, a+=3, a+=4, a+=5, a+=6, a+=7, a+=8, a+=9, a+=10, a+=11, a+=12, a+=13, a+=14, a+=15, a+=16); + TEST_ASSERT_EQUAL(0, a); + + a = 0; + CODE_N(1, a+=1, a+=2, a+=3, a+=4, a+=5, a+=6, a+=7, a+=8, a+=9, a+=10, a+=11, a+=12, a+=13, a+=14, a+=15, a+=16); + TEST_ASSERT_EQUAL(1, a); + + a = 0; + CODE_N(2, a+=1, a+=2, a+=3, a+=4, a+=5, a+=6, a+=7, a+=8, a+=9, a+=10, a+=11, a+=12, a+=13, a+=14, a+=15, a+=16); + TEST_ASSERT_EQUAL(3, a); + + a = 0; + CODE_N(16, a+=1, a+=2, a+=3, a+=4, a+=5, a+=6, a+=7, a+=8, a+=9, a+=10, a+=11, a+=12, a+=13, a+=14, a+=15, a+=16); + TEST_ASSERT_EQUAL(136, a); + + // 16 is the highest number supported by the CODE_N macro +} + +MARLIN_TEST(macros_expansion, GANG_N) { + TEST_ASSERT_EQUAL(0, 0 GANG_N(0, +1, +2, +3, +4, +5, +6, +7, +8, +9, +10, +11, +12, +13, +14, +15, +16)); + TEST_ASSERT_EQUAL(1, 0 GANG_N(1, +1, +2, +3, +4, +5, +6, +7, +8, +9, +10, +11, +12, +13, +14, +15, +16)); + TEST_ASSERT_EQUAL(3, 0 GANG_N(2, +1, +2, +3, +4, +5, +6, +7, +8, +9, +10, +11, +12, +13, +14, +15, +16)); + TEST_ASSERT_EQUAL(136, 0 GANG_N(16, +1, +2, +3, +4, +5, +6, +7, +8, +9, +10, +11, +12, +13, +14, +15, +16)); + + // 16 is the highest number supported by the GANG_N macro +} + +MARLIN_TEST(macros_expansion, GANG_N_1) { + // Count by twos to be sure it can't bass by returning N + TEST_ASSERT_EQUAL(0, 0 GANG_N_1(0, +2)); + TEST_ASSERT_EQUAL(2, 0 GANG_N_1(1, +2)); + TEST_ASSERT_EQUAL(4, 0 GANG_N_1(2, +2)); + TEST_ASSERT_EQUAL(32, 0 GANG_N_1(16, +2)); +} + +MARLIN_TEST(macros_expansion, LIST_N) { + std::vector expected, result; + int compare_size; + + expected = {}; + result = {LIST_N(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)}; + TEST_ASSERT_EQUAL(expected.size(), result.size()); + compare_size = _MIN(expected.size(), result.size()); + for (int i = 0; i < compare_size; i++) { + TEST_ASSERT_EQUAL(expected[i], result[i]); + } + + expected = {1}; + result = {LIST_N(1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)}; + TEST_ASSERT_EQUAL(expected.size(), result.size()); + compare_size = _MIN(expected.size(), result.size()); + for (int i = 0; i < compare_size; i++) { + TEST_ASSERT_EQUAL(expected[i], result[i]); + } + + expected = {1, 2}; + result = {LIST_N(2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)}; + TEST_ASSERT_EQUAL(expected.size(), result.size()); + compare_size = _MIN(expected.size(), result.size()); + for (int i = 0; i < compare_size; i++) { + TEST_ASSERT_EQUAL(expected[i], result[i]); + } + + expected = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; + result = {LIST_N(16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)}; + TEST_ASSERT_EQUAL(expected.size(), result.size()); + compare_size = _MIN(expected.size(), result.size()); + for (int i = 0; i < compare_size; i++) { + TEST_ASSERT_EQUAL(expected[i], result[i]); + } +} + +MARLIN_TEST(macros_expansion, LIST_N_1) { + std::vector expected, result; + int compare_size; + + expected = {}; + result = {LIST_N_1(0, 1)}; + TEST_ASSERT_EQUAL(expected.size(), result.size()); + compare_size = _MIN(expected.size(), result.size()); + for (int i = 0; i < compare_size; i++) { + TEST_ASSERT_EQUAL(expected[i], result[i]); + } + + expected = {2}; + result = {LIST_N_1(1, 2)}; + TEST_ASSERT_EQUAL(expected.size(), result.size()); + compare_size = _MIN(expected.size(), result.size()); + for (int i = 0; i < compare_size; i++) { + TEST_ASSERT_EQUAL(expected[i], result[i]); + } + + expected = {1, 1}; + result = {LIST_N_1(2, 1)}; + TEST_ASSERT_EQUAL(expected.size(), result.size()); + compare_size = _MIN(expected.size(), result.size()); + for (int i = 0; i < compare_size; i++) { + TEST_ASSERT_EQUAL(expected[i], result[i]); + } + + expected = std::vector(16, 1); + result = {LIST_N_1(16, 1)}; + TEST_ASSERT_EQUAL(expected.size(), result.size()); + compare_size = _MIN(expected.size(), result.size()); + for (int i = 0; i < compare_size; i++) { + TEST_ASSERT_EQUAL(expected[i], result[i]); + } +} + +MARLIN_TEST(macros_expansion, ARRAY_N) { + // Test ARRAY_N macro + std::array expected = {1, 2, 3, 4, 5}; + std::array result = ARRAY_N(5, 1, 2, 3, 4, 5); + TEST_ASSERT_EQUAL(expected.size(), result.size()); + + std::array expected2 = {1, 2, 3}; + std::array result2 = ARRAY_N(3, 1, 2, 3); + TEST_ASSERT_EQUAL(expected2.size(), result2.size()); +} + +MARLIN_TEST(macros_expansion, ARRAY_N_1) { + // Test ARRAY_N_1 macro + std::array expected = {2, 2, 2, 2, 2}; + std::array result = ARRAY_N_1(5, 2); + TEST_ASSERT_EQUAL(expected.size(), result.size()); + + std::array expected2 = {1, 1, 1}; + std::array result2 = ARRAY_N_1(3, 1); + TEST_ASSERT_EQUAL(expected2.size(), result2.size()); +} + +MARLIN_TEST(macros_math, CEILING) { + TEST_ASSERT_EQUAL(2, CEILING(3, 2)); + TEST_ASSERT_EQUAL(5, CEILING(10, 2)); + TEST_ASSERT_EQUAL(0, CEILING(0, 2)); +} + +MARLIN_TEST(macros_math, ABS) { + TEST_ASSERT_EQUAL(5, ABS(-5)); + TEST_ASSERT_EQUAL(5, ABS(5)); + TEST_ASSERT_EQUAL_FLOAT(5.5, ABS(-5.5)); + TEST_ASSERT_EQUAL_FLOAT(5.5, ABS(5.5)); +} + +MARLIN_TEST(macros_float, UNEAR_ZERO) { + TEST_ASSERT_TRUE(UNEAR_ZERO(0.0000009f)); + TEST_ASSERT_FALSE(UNEAR_ZERO(0.000001f)); +} + +MARLIN_TEST(macros_float, NEAR_ZERO) { + TEST_ASSERT_TRUE(NEAR_ZERO(0.0000001f)); + TEST_ASSERT_TRUE(NEAR_ZERO(-0.0000001f)); + TEST_ASSERT_FALSE(NEAR_ZERO(0.0000011f)); + TEST_ASSERT_FALSE(NEAR_ZERO(-0.0000011f)); +} + +MARLIN_TEST(macros_float, NEAR) { + TEST_ASSERT_TRUE(NEAR(0.000001f, 0.000002f)); + TEST_ASSERT_FALSE(NEAR(0.0000009f, 0.000002f)); +} + +MARLIN_TEST(macros_float, RECIPROCAL) { + TEST_ASSERT_EQUAL_FLOAT(1.0f, RECIPROCAL(1.0f)); + TEST_ASSERT_EQUAL_FLOAT(0.0f, RECIPROCAL(0.0f)); + TEST_ASSERT_EQUAL_FLOAT(2.0f, RECIPROCAL(0.5f)); + TEST_ASSERT_EQUAL_FLOAT(-2.0f, RECIPROCAL(-0.5f)); + TEST_ASSERT_EQUAL_FLOAT(0.0f, RECIPROCAL(0.0000001f)); + TEST_ASSERT_EQUAL_FLOAT(0.0f, RECIPROCAL(-0.0000001f)); +} + +MARLIN_TEST(macros_float, FIXFLOAT) { + TEST_ASSERT_EQUAL(0.0000005f, FIXFLOAT(0.0f)); + TEST_ASSERT_EQUAL(-0.0000005f, FIXFLOAT(-0.0f)); +} + +MARLIN_TEST(macros_math, MATH_MACROS) { + // Sanity check of macros typically mapped to compiler functions + TEST_ASSERT_EQUAL_FLOAT(0.0f, ACOS(1.0f)); + TEST_ASSERT_EQUAL_FLOAT(0.785398f, ATAN2(1.0f, 1.0f)); + TEST_ASSERT_EQUAL_FLOAT(8.0f, POW(2.0f, 3.0f)); + TEST_ASSERT_EQUAL_FLOAT(2.0f, SQRT(4.0f)); + TEST_ASSERT_EQUAL_FLOAT(0.5f, RSQRT(4.0f)); + TEST_ASSERT_EQUAL_FLOAT(2.0f, CEIL(1.5f)); + TEST_ASSERT_EQUAL_FLOAT(1.0f, FLOOR(1.5f)); + TEST_ASSERT_EQUAL_FLOAT(1.0f, TRUNC(1.5f)); + TEST_ASSERT_EQUAL(2, LROUND(1.5f)); + TEST_ASSERT_EQUAL_FLOAT(1.0f, FMOD(5.0f, 2.0f)); + TEST_ASSERT_EQUAL_FLOAT(5.0f, HYPOT(3.0f, 4.0f)); +} + +MARLIN_TEST(macros_math, MIN_MAX) { + // _MIN tests + TEST_ASSERT_EQUAL(-1, _MIN(-1, 0)); + TEST_ASSERT_EQUAL(-1, _MIN(0, -1)); + TEST_ASSERT_EQUAL(-1, _MIN(-1, 1)); + TEST_ASSERT_EQUAL(-1, _MIN(1, -1)); + TEST_ASSERT_EQUAL(-1, _MIN(-1, -1)); + TEST_ASSERT_EQUAL(1, _MIN(1, 1)); + TEST_ASSERT_EQUAL_FLOAT(-1.5f, _MIN(-1.5f, 0.5f)); + TEST_ASSERT_EQUAL_FLOAT(-1.5f, _MIN(0.5f, -1.5f)); + + // _MAX tests + TEST_ASSERT_EQUAL(0, _MAX(-1, 0)); + TEST_ASSERT_EQUAL(0, _MAX(0, -1)); + TEST_ASSERT_EQUAL(1, _MAX(-1, 1)); + TEST_ASSERT_EQUAL(1, _MAX(1, -1)); + TEST_ASSERT_EQUAL(-1, _MAX(-1, -1)); + TEST_ASSERT_EQUAL(1, _MAX(1, 1)); + TEST_ASSERT_EQUAL_FLOAT(0.5f, _MAX(-1.5f, 0.5f)); + TEST_ASSERT_EQUAL_FLOAT(0.5f, _MAX(0.5f, -1.5f)); +} + +MARLIN_TEST(macros_math, INCREMENT) { + TEST_ASSERT_EQUAL(1, INCREMENT(0)); + TEST_ASSERT_EQUAL(21, INCREMENT(20)); + // 20 is the highest number supported by the INCREMENT macro +} + +MARLIN_TEST(macros_math, ADD) { + // Test smallest add + TEST_ASSERT_EQUAL(0, ADD0(0)); + TEST_ASSERT_EQUAL(10, ADD0(10)); + + // Test largest add + TEST_ASSERT_EQUAL(10, ADD10(0)); + TEST_ASSERT_EQUAL(20, ADD10(10)); +} + +MARLIN_TEST(macros_math, SUM) { + // Test smallest sum + TEST_ASSERT_EQUAL(3, SUM(0, 3)); + TEST_ASSERT_EQUAL(7, SUM(3, 4)); + + // Test largest sum + TEST_ASSERT_EQUAL(15, SUM(10, 5)); + TEST_ASSERT_EQUAL(19, SUM(9, 10)); +} + +MARLIN_TEST(macros_math, DOUBLE) { + // Test double + TEST_ASSERT_EQUAL(0, DOUBLE(0)); + TEST_ASSERT_EQUAL(2, DOUBLE(1)); + TEST_ASSERT_EQUAL(4, DOUBLE(2)); + TEST_ASSERT_EQUAL(20, DOUBLE(10)); +} + +MARLIN_TEST(macros_math, DECREMENT) { + TEST_ASSERT_EQUAL(0, DECREMENT(1)); + TEST_ASSERT_EQUAL(14, DECREMENT(15)); +} + +MARLIN_TEST(macros_math, SUB) { + // Test smallest subtraction + TEST_ASSERT_EQUAL(0, SUB0(0)); + TEST_ASSERT_EQUAL(10, SUB0(10)); + + // Test subtracting 1 + TEST_ASSERT_EQUAL(0, SUB1(1)); + TEST_ASSERT_EQUAL(5, SUB1(6)); + + // Test largest subtraction + TEST_ASSERT_EQUAL(0, SUB10(10)); + TEST_ASSERT_EQUAL(5, SUB10(15)); +} + + +// Define a helper macro for testing +#define TEST_OP(i) ++counter; +#define TEST_OP2(i, j) counter += j; + +MARLIN_TEST(macros_repeat, REPEAT) { + int counter = 0; + REPEAT(5, TEST_OP); + TEST_ASSERT_EQUAL(5, counter); +} + +MARLIN_TEST(macros_repeat, REPEAT_1) { + int counter = 0; + REPEAT_1(5, TEST_OP); + TEST_ASSERT_EQUAL(5, counter); +} + +MARLIN_TEST(macros_repeat, REPEAT2) { + int counter = 0; + REPEAT2(5, TEST_OP2, 1); + TEST_ASSERT_EQUAL(5, counter); +} + +MARLIN_TEST(macros_repeat, RREPEAT) { + int counter = 0; + RREPEAT(5, TEST_OP); + TEST_ASSERT_EQUAL(5, counter); +} + +MARLIN_TEST(macros_repeat, RREPEAT_1) { + int counter = 0; + RREPEAT_1(5, TEST_OP); + TEST_ASSERT_EQUAL(5, counter); +} + +MARLIN_TEST(macros_repeat, RREPEAT2) { + int counter = 0; + RREPEAT2(5, TEST_OP2, 1); + TEST_ASSERT_EQUAL(5, counter); +} diff --git a/Marlin/tests/core/test_types.cpp b/Marlin/tests/core/test_types.cpp new file mode 100644 index 0000000000..865d35de15 --- /dev/null +++ b/Marlin/tests/core/test_types.cpp @@ -0,0 +1,605 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../test/unit_tests.h" +#include "src/core/types.h" + +MARLIN_TEST(types, XYval_const_as_bools) { + const XYval xy_const_true = {1, 2}; + TEST_ASSERT_TRUE(xy_const_true); + + const XYval xy_const_false = {0, 0}; + TEST_ASSERT_FALSE(xy_const_false); +} + +MARLIN_TEST(types, XYval_non_const_as_bools) { + XYval xy_true = {1, 2}; + TEST_ASSERT_TRUE(xy_true); + + XYval xy_false = {0, 0}; + TEST_ASSERT_FALSE(xy_false); +} + +MARLIN_TEST(types, XYval_reset) { + XYval xy = {1, 2}; + xy.reset(); + TEST_ASSERT_EQUAL(0, xy.x); + TEST_ASSERT_EQUAL(0, xy.y); +} + +MARLIN_TEST(types, XYval_set) { + XYval xy; + xy.set(3, 4); + TEST_ASSERT_EQUAL(3, xy.x); + TEST_ASSERT_EQUAL(4, xy.y); +} + +MARLIN_TEST(types, XYval_magnitude) { + XYval xy; + + xy.set(3, 4); + TEST_ASSERT_EQUAL(5, xy.magnitude()); + + xy.set(-3, -4); + TEST_ASSERT_EQUAL(5, xy.magnitude()); + + xy.set(-3, 4); + TEST_ASSERT_EQUAL(5, xy.magnitude()); + + xy.set(3, -4); + TEST_ASSERT_EQUAL(5, xy.magnitude()); +} + +MARLIN_TEST(types, XYval_small_large) { + XYval xy; + + xy.set(3, 4); + TEST_ASSERT_EQUAL(3, xy.small()); + TEST_ASSERT_EQUAL(4, xy.large()); + + xy.set(4, 3); + TEST_ASSERT_EQUAL(3, xy.small()); + TEST_ASSERT_EQUAL(4, xy.large()); + + // BUG?: Is this behavior actually correct? + // Does small mean "less than", or should it mean + // "closer to zero"? If the latter, then the following + // tests are incorrect. + xy.set(-3, -4); + TEST_ASSERT_EQUAL(-4, xy.small()); + TEST_ASSERT_EQUAL(-3, xy.large()); + + xy.set(-3, 2); + TEST_ASSERT_EQUAL(-3, xy.small()); + TEST_ASSERT_EQUAL(2, xy.large()); + + xy.set(2, -3); + TEST_ASSERT_EQUAL(-3, xy.small()); + TEST_ASSERT_EQUAL(2, xy.large()); +} + +MARLIN_TEST(types, XYval_operators) { + XYval xy1 = {2, 3}, xy2 = {6, 12}; + XYval xy3 = xy1 + xy2; + TEST_ASSERT_EQUAL(8, xy3.x); + TEST_ASSERT_EQUAL(15, xy3.y); + xy3 = xy1 - xy2; + TEST_ASSERT_EQUAL(-4, xy3.x); + TEST_ASSERT_EQUAL(-9, xy3.y); + xy3 = xy1 * xy2; + TEST_ASSERT_EQUAL(12, xy3.x); + TEST_ASSERT_EQUAL(36, xy3.y); + xy3 = xy2 / xy1; + TEST_ASSERT_EQUAL(3, xy3.x); + TEST_ASSERT_EQUAL(4, xy3.y); +} + +MARLIN_TEST(types, XYval_ABS) { + XYval xy = {-3, -4}; + XYval xy_abs = xy.ABS(); + TEST_ASSERT_EQUAL(3, xy_abs.x); + TEST_ASSERT_EQUAL(4, xy_abs.y); +} + +MARLIN_TEST(types, XYval_ROUNDL) { + XYval xy = {3.3f, 4.7f}; + auto xy_round = xy.ROUNDL(); + TEST_ASSERT_EQUAL(3, xy_round.x); + TEST_ASSERT_EQUAL(5, xy_round.y); +} + +MARLIN_TEST(types, XYval_reciprocal) { + XYval xy = {0.5f, 4.0f}; + XYval xy_reciprocal = xy.reciprocal(); + TEST_ASSERT_EQUAL_FLOAT(2.0f, xy_reciprocal.x); + TEST_ASSERT_EQUAL_FLOAT(0.25f, xy_reciprocal.y); +} + +MARLIN_TEST(types, XYZval_const_as_bools) { + const XYZval xyz_const_true = {1, 2, 3}; + TEST_ASSERT_TRUE(xyz_const_true); + + const XYZval xyz_const_false = {0, 0, 0}; + TEST_ASSERT_FALSE(xyz_const_false); +} + +MARLIN_TEST(types, XYZval_non_const_as_bools) { + XYZval xyz_true = {1, 2, 3}; + TEST_ASSERT_TRUE(xyz_true); + + XYZval xyz_false = {0, 0, 0}; + TEST_ASSERT_FALSE(xyz_false); +} + +MARLIN_TEST(types, XYZval_reset) { + XYZval xyz = {1, 2, 3}; + xyz.reset(); + TEST_ASSERT_EQUAL(0, xyz.x); + TEST_ASSERT_EQUAL(0, xyz.y); + TEST_ASSERT_EQUAL(0, xyz.z); +} + +MARLIN_TEST(types, XYZval_set) { + XYZval xyz; + xyz.set(3, 4, 5); + TEST_ASSERT_EQUAL(3, xyz.x); + TEST_ASSERT_EQUAL(4, xyz.y); + TEST_ASSERT_EQUAL(5, xyz.z); +} + +MARLIN_TEST(types, XYZval_magnitude) { + XYZval xyz; + + xyz.set(3.0f, 4.0f, 5.0f); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 7.071f, xyz.magnitude()); + + xyz.set(-3.0f, -4.0f, -5.0f); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 7.071f, xyz.magnitude()); + + xyz.set(-3.0f, 4.0f, 5.0f); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 7.071f, xyz.magnitude()); + + xyz.set(3.0f, -4.0f, 5.0f); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 7.071f, xyz.magnitude()); + + xyz.set(3.0f, 4.0f, -5.0f); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 7.071f, xyz.magnitude()); +} + +MARLIN_TEST(types, XYZval_small_large) { + XYZval xyz; + + xyz.set(3, 4, 5); + TEST_ASSERT_EQUAL(3, xyz.small()); + TEST_ASSERT_EQUAL(5, xyz.large()); + + xyz.set(5, 4, 3); + TEST_ASSERT_EQUAL(3, xyz.small()); + TEST_ASSERT_EQUAL(5, xyz.large()); + + xyz.set(4, 3, 5); + TEST_ASSERT_EQUAL(3, xyz.small()); + TEST_ASSERT_EQUAL(5, xyz.large()); + + xyz.set(3, 5, 4); + TEST_ASSERT_EQUAL(3, xyz.small()); + TEST_ASSERT_EQUAL(5, xyz.large()); + + // Test with negative numbers + xyz.set(-3, -4, -5); + TEST_ASSERT_EQUAL(-5, xyz.small()); + TEST_ASSERT_EQUAL(-3, xyz.large()); + + // Test with mixed negative/positive numbers + xyz.set(-3, 4, 5); + TEST_ASSERT_EQUAL(-3, xyz.small()); + TEST_ASSERT_EQUAL(5, xyz.large()); + + xyz.set(3, -4, 5); + TEST_ASSERT_EQUAL(-4, xyz.small()); + TEST_ASSERT_EQUAL(5, xyz.large()); + + xyz.set(3, 4, -5); + TEST_ASSERT_EQUAL(-5, xyz.small()); + TEST_ASSERT_EQUAL(4, xyz.large()); +} + +MARLIN_TEST(types, XYZval_operators) { + XYZval xyz1 = {2, 3, 4}, xyz2 = {6, 12, 24}; + XYZval xyz3 = xyz1 + xyz2; + TEST_ASSERT_EQUAL(8, xyz3.x); + TEST_ASSERT_EQUAL(15, xyz3.y); + TEST_ASSERT_EQUAL(28, xyz3.z); + xyz3 = xyz1 - xyz2; + TEST_ASSERT_EQUAL(-4, xyz3.x); + TEST_ASSERT_EQUAL(-9, xyz3.y); + TEST_ASSERT_EQUAL(-20, xyz3.z); + xyz3 = xyz1 * xyz2; + TEST_ASSERT_EQUAL(12, xyz3.x); + TEST_ASSERT_EQUAL(36, xyz3.y); + TEST_ASSERT_EQUAL(96, xyz3.z); + xyz3 = xyz2 / xyz1; + TEST_ASSERT_EQUAL(3, xyz3.x); + TEST_ASSERT_EQUAL(4, xyz3.y); + TEST_ASSERT_EQUAL(6, xyz3.z); +} + +MARLIN_TEST(types, XYZval_ABS) { + XYZval xyz = {-3, -4, -5}; + XYZval xyz_abs = xyz.ABS(); + TEST_ASSERT_EQUAL(3, xyz_abs.x); + TEST_ASSERT_EQUAL(4, xyz_abs.y); + TEST_ASSERT_EQUAL(5, xyz_abs.z); +} + +MARLIN_TEST(types, XYZval_ROUNDL) { + XYZval xyz = {3.3f, 4.7f, 5.5f}; + XYZval xyz_round = xyz.ROUNDL(); + TEST_ASSERT_EQUAL(3, xyz_round.x); + TEST_ASSERT_EQUAL(5, xyz_round.y); + TEST_ASSERT_EQUAL(6, xyz_round.z); +} + +MARLIN_TEST(types, XYZval_reciprocal) { + XYZval xyz = {0.5f, 2.0f, 0.33333f}; + XYZval xyz_reciprocal = xyz.reciprocal(); + TEST_ASSERT_EQUAL_FLOAT(2.0f, xyz_reciprocal.x); + TEST_ASSERT_EQUAL_FLOAT(0.5f, xyz_reciprocal.y); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 3.0f, xyz_reciprocal.z); +} + +MARLIN_TEST(types, XYZEval_const_as_bools) { + const XYZEval xyze_const_true = {1, 2, 3, 4}; + TEST_ASSERT_TRUE(xyze_const_true); + + const XYZEval xyze_const_false = {0, 0, 0, 0}; + TEST_ASSERT_FALSE(xyze_const_false); +} + +MARLIN_TEST(types, XYZEval_non_const_as_bools) { + XYZEval xyze_true = {1, 2, 3, 4}; + TEST_ASSERT_TRUE(xyze_true); + + XYZEval xyze_false = {0, 0, 0, 0}; + TEST_ASSERT_FALSE(xyze_false); +} + +MARLIN_TEST(types, XYZEval_reset) { + XYZEval xyze = {1, 2, 3, 4}; + xyze.reset(); + TEST_ASSERT_EQUAL(0, xyze.x); + TEST_ASSERT_EQUAL(0, xyze.y); + TEST_ASSERT_EQUAL(0, xyze.z); + TEST_ASSERT_EQUAL(0, xyze.e); +} + +MARLIN_TEST(types, XYZEval_set) { + XYZEval xyze; + xyze.set(3, 4, 5, 6); + TEST_ASSERT_EQUAL(3, xyze.x); + TEST_ASSERT_EQUAL(4, xyze.y); + TEST_ASSERT_EQUAL(5, xyze.z); + TEST_ASSERT_EQUAL(6, xyze.e); +} + +MARLIN_TEST(types, XYZEval_magnitude) { + XYZEval xyze; + + xyze.set(3.0f, 4.0f, 5.0f, 6.0f); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 9.274f, xyze.magnitude()); + + xyze.set(-3.0f, -4.0f, -5.0f, -6.0f); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 9.274f, xyze.magnitude()); + + xyze.set(-3.0f, 4.0f, 5.0f, 6.0f); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 9.274f, xyze.magnitude()); + + xyze.set(3.0f, -4.0f, 5.0f, 6.0f); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 9.274f, xyze.magnitude()); + + xyze.set(3.0f, 4.0f, -5.0f, 6.0f); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 9.274f, xyze.magnitude()); + + xyze.set(3.0f, 4.0f, 5.0f, -6.0f); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 9.274f, xyze.magnitude()); +} + +MARLIN_TEST(types, XYZEval_small_large) { + XYZEval xyze; + + xyze.set(3, 4, 5, 6); + TEST_ASSERT_EQUAL(3, xyze.small()); + TEST_ASSERT_EQUAL(6, xyze.large()); + + xyze.set(6, 5, 4, 3); + TEST_ASSERT_EQUAL(3, xyze.small()); + TEST_ASSERT_EQUAL(6, xyze.large()); + + xyze.set(4, 3, 6, 5); + TEST_ASSERT_EQUAL(3, xyze.small()); + TEST_ASSERT_EQUAL(6, xyze.large()); + + xyze.set(3, 6, 5, 4); + TEST_ASSERT_EQUAL(3, xyze.small()); + TEST_ASSERT_EQUAL(6, xyze.large()); + + xyze.set(-3, -4, -5, -6); + TEST_ASSERT_EQUAL(-6, xyze.small()); + TEST_ASSERT_EQUAL(-3, xyze.large()); + + xyze.set(-3, 4, 5, 6); + TEST_ASSERT_EQUAL(-3, xyze.small()); + TEST_ASSERT_EQUAL(6, xyze.large()); + + xyze.set(3, -4, 5, 6); + TEST_ASSERT_EQUAL(-4, xyze.small()); + TEST_ASSERT_EQUAL(6, xyze.large()); + + xyze.set(3, 4, -5, 6); + TEST_ASSERT_EQUAL(-5, xyze.small()); + TEST_ASSERT_EQUAL(6, xyze.large()); + + xyze.set(3, 4, 5, -6); + TEST_ASSERT_EQUAL(-6, xyze.small()); + TEST_ASSERT_EQUAL(5, xyze.large()); +} + +MARLIN_TEST(types, XYZEval_operators) { + XYZEval xyze1 = {2, 3, 4, 5}, xyze2 = {6, 12, 24, 48}; + XYZEval xyze3 = xyze1 + xyze2; + TEST_ASSERT_EQUAL(8, xyze3.x); + TEST_ASSERT_EQUAL(15, xyze3.y); + TEST_ASSERT_EQUAL(28, xyze3.z); + TEST_ASSERT_EQUAL(53, xyze3.e); + xyze3 = xyze1 - xyze2; + TEST_ASSERT_EQUAL(-4, xyze3.x); + TEST_ASSERT_EQUAL(-9, xyze3.y); + TEST_ASSERT_EQUAL(-20, xyze3.z); + TEST_ASSERT_EQUAL(-43, xyze3.e); + xyze3 = xyze1 * xyze2; + TEST_ASSERT_EQUAL(12, xyze3.x); + TEST_ASSERT_EQUAL(36, xyze3.y); + TEST_ASSERT_EQUAL(96, xyze3.z); + TEST_ASSERT_EQUAL(240, xyze3.e); + xyze3 = xyze2 / xyze1; + TEST_ASSERT_EQUAL(3, xyze3.x); + TEST_ASSERT_EQUAL(4, xyze3.y); + TEST_ASSERT_EQUAL(6, xyze3.z); + TEST_ASSERT_EQUAL(9, xyze3.e); +} + +MARLIN_TEST(types, XYZEval_ABS) { + XYZEval xyze = {-3, -4, -5, -6}; + XYZEval xyze_abs = xyze.ABS(); + TEST_ASSERT_EQUAL(3, xyze_abs.x); + TEST_ASSERT_EQUAL(4, xyze_abs.y); + TEST_ASSERT_EQUAL(5, xyze_abs.z); + TEST_ASSERT_EQUAL(6, xyze_abs.e); +} + +MARLIN_TEST(types, XYZEval_ROUNDL) { + XYZEval xyze = {3.3f, 4.7f, 5.5f, 6.6f}; + XYZEval xyze_round = xyze.ROUNDL(); + TEST_ASSERT_EQUAL(3, xyze_round.x); + TEST_ASSERT_EQUAL(5, xyze_round.y); + TEST_ASSERT_EQUAL(6, xyze_round.z); + TEST_ASSERT_EQUAL(7, xyze_round.e); +} + +MARLIN_TEST(types, XYZEval_reciprocal) { + XYZEval xyze = {0.5f, 2.0f, 0.33333f, 0.25f}; + XYZEval xyze_reciprocal = xyze.reciprocal(); + TEST_ASSERT_EQUAL_FLOAT(2.0f, xyze_reciprocal.x); + TEST_ASSERT_EQUAL_FLOAT(0.5f, xyze_reciprocal.y); + TEST_ASSERT_FLOAT_WITHIN(0.001f, 3.0f, xyze_reciprocal.z); + TEST_ASSERT_EQUAL_FLOAT(4.0f, xyze_reciprocal.e); +} + +MARLIN_TEST(types, Flags_const_as_bools) { + const Flags<32> flags_const_false = {0}; + TEST_ASSERT_FALSE(flags_const_false); + + const Flags<32> flags_const_true = {1}; + TEST_ASSERT_TRUE(flags_const_true); +} + +MARLIN_TEST(types, Flags_non_const_as_bools) { + Flags<32> flags_false = {0}; + TEST_ASSERT_FALSE(flags_false); + + Flags<32> flags_true = {1}; + TEST_ASSERT_TRUE(flags_true); +} + +MARLIN_TEST(types, Flags_1) { + Flags<1> flags; + + flags.set(0, true); + TEST_ASSERT_EQUAL(1, flags.b); + + flags.reset(); + TEST_ASSERT_EQUAL(0, flags.b); + + flags.set(0, true); + flags.clear(0); + TEST_ASSERT_EQUAL(0, flags.b); + + TEST_ASSERT_EQUAL(false, flags.test(0)); + flags.set(0, true); + TEST_ASSERT_EQUAL(true, flags.test(0)); + + TEST_ASSERT_EQUAL(true, flags[0]); + flags.clear(0); + TEST_ASSERT_EQUAL(false, flags[0]); + + TEST_ASSERT_EQUAL(1, flags.size()); +} + +MARLIN_TEST(types, Flags_8) { + Flags<8> flags; + + flags.reset(); + TEST_ASSERT_EQUAL(0, flags.b); + + flags.set(3, true); + TEST_ASSERT_EQUAL(8, flags.b); + + flags.clear(3); + TEST_ASSERT_EQUAL(0, flags.b); + + flags.set(3, true); + TEST_ASSERT_EQUAL(true, flags.test(3)); + TEST_ASSERT_EQUAL(false, flags.test(2)); + + TEST_ASSERT_EQUAL(true, flags[3]); + TEST_ASSERT_EQUAL(false, flags[2]); + + TEST_ASSERT_EQUAL(1, flags.size()); +} + +MARLIN_TEST(types, Flags_16) { + Flags<16> flags; + + flags.reset(); + TEST_ASSERT_EQUAL(0, flags.b); + + flags.set(0, true); + flags.set(15, true); + TEST_ASSERT_EQUAL(32769, flags.b); + + flags.clear(0); + TEST_ASSERT_EQUAL(32768, flags.b); + + flags.reset(); + flags.set(7, true); + flags.set(15, true); + TEST_ASSERT_EQUAL(true, flags.test(7)); + TEST_ASSERT_EQUAL(false, flags.test(8)); + TEST_ASSERT_EQUAL(true, flags.test(15)); + + TEST_ASSERT_EQUAL(true, flags[7]); + TEST_ASSERT_EQUAL(false, flags[8]); + TEST_ASSERT_EQUAL(true, flags[15]); + + TEST_ASSERT_EQUAL(2, flags.size()); +} + +MARLIN_TEST(types, Flags_32) { + Flags<32> flags; + + flags.reset(); + TEST_ASSERT_EQUAL(0, flags.b); + + flags.set(0, true); + flags.set(31, true); + TEST_ASSERT_EQUAL(2147483649, flags.b); + + flags.clear(0); + flags.clear(31); + TEST_ASSERT_EQUAL(0, flags.b); + + flags.set(0, true); + flags.set(31, true); + TEST_ASSERT_EQUAL(true, flags.test(0)); + TEST_ASSERT_EQUAL(true, flags.test(31)); + TEST_ASSERT_EQUAL(false, flags.test(1)); + TEST_ASSERT_EQUAL(false, flags.test(30)); + + TEST_ASSERT_EQUAL(true, flags[0]); + TEST_ASSERT_EQUAL(true, flags[31]); + TEST_ASSERT_EQUAL(false, flags[1]); + TEST_ASSERT_EQUAL(false, flags[30]); + + TEST_ASSERT_EQUAL(4, flags.size()); +} + +MARLIN_TEST(types, AxisFlags_const_as_bools) { + const AxisFlags axis_flags_const_false = {0}; + TEST_ASSERT_FALSE(axis_flags_const_false); + + const AxisFlags axis_flags_const_true = {1}; + TEST_ASSERT_TRUE(axis_flags_const_true); +} + +MARLIN_TEST(types, AxisFlags_non_const_as_bools) { + AxisFlags axis_flags_false = {0}; + TEST_ASSERT_FALSE(axis_flags_false); + + AxisFlags axis_flags_true = {1}; + TEST_ASSERT_TRUE(axis_flags_true); +} + +MARLIN_TEST(types, AxisBits_const_as_bools) { + const AxisBits axis_bits_const_false = {0}; + TEST_ASSERT_FALSE(axis_bits_const_false); + + const AxisBits axis_bits_const_true = {1}; + TEST_ASSERT_TRUE(axis_bits_const_true); +} + +MARLIN_TEST(types, AxisBits_non_const_as_bools) { + AxisBits axis_bits_false = {0}; + TEST_ASSERT_FALSE(axis_bits_false); + + AxisBits axis_bits_true = {1}; + TEST_ASSERT_TRUE(axis_bits_true); +} + +MARLIN_TEST(types, MString1) { + // String with cutoff at 20 chars: + // "F-string, 1234.50, 2" + MString<20> str20; + str20 = F("F-string, "); + str20.append(1234.5f).append(',').append(' ') + .append(2345.67).append(',').append(' '); + + TEST_ASSERT_TRUE(strcmp_P(str20, PSTR("F-string, 1234.50, 2")) == 0); + + // Truncate to "F-string" + str20.trunc(8); + + TEST_ASSERT_FALSE(strcmp_P(&str20, PSTR("F-string")) != 0); +} + +MARLIN_TEST(types, MString2) { + // 100 dashes, but chopped down to DEFAULT_MSTRING_SIZE (20) + TEST_ASSERT_TRUE(TSS(repchr_t('-', 100)).length() == 20); +} + +MARLIN_TEST(types, SString) { + // Hello World!-123456------ < spaces!33 + // ^ eol! ... 1234.50*2345.602 = 2895645.67 + SString<100> str(F("Hello")); + str.append(F(" World!")); + str += '-'; + str += uint8_t(123); + str += F("456"); + str += repchr_t('-', 6); + str += Spaces(3); + str += "< spaces!"; + str += int8_t(33); + str.eol(); + str += "^ eol!"; + str.append(" ... ", 1234.5f, '*', p_float_t(2345.602, 3), F(" = "), 1234.5 * 2345.602); + + TEST_ASSERT_TRUE(strcmp_P(str, PSTR("Hello World!-123456------ < spaces!33\n^ eol! ... 1234.50*2345.602 = 2895645.67")) == 0); +} diff --git a/Marlin/tests/feature/test_runout.cpp b/Marlin/tests/feature/test_runout.cpp new file mode 100644 index 0000000000..2719446437 --- /dev/null +++ b/Marlin/tests/feature/test_runout.cpp @@ -0,0 +1,36 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../test/unit_tests.h" + +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + +#include + +MARLIN_TEST(runout, poll_runout_states) { + FilamentSensorBase sensor; + // Expected default value is one bit set for each extruder + uint8_t expected = static_cast(~(~0u << NUM_RUNOUT_SENSORS)); + TEST_ASSERT_EQUAL(expected, sensor.poll_runout_states()); +} + +#endif diff --git a/Marlin/tests/gcode/test_gcode.cpp b/Marlin/tests/gcode/test_gcode.cpp new file mode 100644 index 0000000000..be364cb905 --- /dev/null +++ b/Marlin/tests/gcode/test_gcode.cpp @@ -0,0 +1,58 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../test/unit_tests.h" +#include +#include + +MARLIN_TEST(gcode, process_parsed_command) { + GcodeSuite suite; + parser.command_letter = 'G'; + parser.codenum = 0; + suite.process_parsed_command(false); +} + +MARLIN_TEST(gcode, parse_g1_xz) { + char current_command[] = "G0 X10 Z30"; + parser.command_letter = -128; + parser.codenum = -1; + parser.parse(current_command); + TEST_ASSERT_EQUAL('G', parser.command_letter); + TEST_ASSERT_EQUAL(0, parser.codenum); + TEST_ASSERT_TRUE(parser.seen('X')); + TEST_ASSERT_FALSE(parser.seen('Y')); + TEST_ASSERT_TRUE(parser.seen('Z')); + TEST_ASSERT_FALSE(parser.seen('E')); +} + +MARLIN_TEST(gcode, parse_g1_nxz) { + char current_command[] = "N123 G0 X10 Z30"; + parser.command_letter = -128; + parser.codenum = -1; + parser.parse(current_command); + TEST_ASSERT_EQUAL('G', parser.command_letter); + TEST_ASSERT_EQUAL(0, parser.codenum); + TEST_ASSERT_TRUE(parser.seen('X')); + TEST_ASSERT_FALSE(parser.seen('Y')); + TEST_ASSERT_TRUE(parser.seen('Z')); + TEST_ASSERT_FALSE(parser.seen('E')); +} diff --git a/README.md b/README.md index ac496aac21..b11a1193b9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ GPL-V3.0 License Contributors Last Release Date - CI Status + CI Status GitHub Sponsors
Follow MarlinFirmware on Mastodon @@ -39,16 +39,16 @@ To build and upload Marlin you will use one of these tools: Marlin is optimized to build with the **PlatformIO IDE** extension for **Visual Studio Code**. You can still build Marlin with **Arduino IDE**, and we hope to improve the Arduino build experience, but at this time PlatformIO is the better choice. +## 8-Bit AVR Boards + +We intend to continue supporting 8-bit AVR boards in perpetuity, maintaining a single codebase that can apply to all machines. We want casual hobbyists and tinkerers and owners of older machines to benefit from the community's innovations just as much as those with fancier machines. Plus, those old AVR-based machines are often the best for your testing and feedback! + ## Hardware Abstraction Layer (HAL) Marlin includes an abstraction layer to provide a common API for all the platforms it targets. This allows Marlin code to address the details of motion and user interface tasks at the lowest and highest levels with no system overhead, tying all events directly to the hardware clock. Every new HAL opens up a world of hardware. At this time we need HALs for RP2040 and the Duet3D family of boards. A HAL that wraps an RTOS is an interesting concept that could be explored. Did you know that Marlin includes a Simulator that can run on Windows, macOS, and Linux? Join the Discord to help move these sub-projects forward! -## 8-Bit AVR Boards - -A core tenet of this project is to keep supporting 8-bit AVR boards while also maintaining a single codebase that applies equally to all machines. We want casual hobbyists to benefit from the community's innovations as much as possible just as much as those with fancier machines. Plus, those old AVR-based machines are often the best for your testing and feedback! - ### Supported Platforms Platform|MCU|Example Boards @@ -71,22 +71,9 @@ A core tenet of this project is to keep supporting 8-bit AVR boards while also m [Teensy 4.1](https://www.pjrc.com/store/teensy41.html)|ARM® Cortex-M7| Linux Native|x86/ARM/etc.|Raspberry Pi -## Submitting Patches - -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.1.x life-cycle. -- Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) to gain points with the maintainers. -- Please submit Feature Requests and Bug Reports to the [Issue Queue](https://github.com/MarlinFirmware/Marlin/issues/new/choose). Support resources are also listed there. -- Whenever you add new features, be sure to add tests to `buildroot/tests` and then run your tests locally, if possible. - - It's optional: Running all the tests on Windows might take a long time, and they will run anyway on GitHub. - - If you're running the tests on Linux (or on WSL with the code on a Linux volume) the speed is much faster. - - You can use `make tests-all-local` or `make tests-single-local TEST_TARGET=...`. - - If you prefer Docker you can use `make tests-all-local-docker` or `make tests-all-local-docker TEST_TARGET=...`. - ## Marlin Support -The Issue Queue is reserved for Bug Reports and Feature Requests. To get help with configuration and troubleshooting, please use the following resources: +The Issue Queue is reserved for Bug Reports and Feature Requests. Please use the following resources for help with configuration and troubleshooting: - [Marlin Documentation](https://marlinfw.org) - Official Marlin documentation - [Marlin Discord](https://discord.gg/n5NJ59y) - Discuss issues with Marlin users and developers @@ -95,60 +82,48 @@ The Issue Queue is reserved for Bug Reports and Feature Requests. To get help wi - Facebook Group ["Marlin Firmware for 3D Printers"](https://www.facebook.com/groups/3Dtechtalk/) - [Marlin Configuration](https://www.youtube.com/results?search_query=marlin+configuration) on YouTube +## Contributing Patches + +You can contribute patches by submitting a Pull Request to the ([bugfix-2.1.x](https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.1.x)) branch. + +- We use branches named with a "bugfix" or "dev" prefix to fix bugs and integrate new features. +- Follow the [Coding Standards](https://marlinfw.org/docs/development/coding_standards.html) to gain points with the maintainers. +- Please submit Feature Requests and Bug Reports to the [Issue Queue](https://github.com/MarlinFirmware/Marlin/issues/new/choose). See above for user support. +- Whenever you add new features, be sure to add one or more build tests to `buildroot/tests`. Any tests added to a PR will be run within that PR on GitHub servers as soon as they are pushed. To minimize iteration be sure to run your new tests locally, if possible. + - Local build tests: + - All: `make tests-config-all-local` + - Single: `make tests-config-single-local TEST_TARGET=...` + - Local build tests in Docker: + - All: `make tests-config-all-local-docker` + - Single: `make tests-config-all-local-docker TEST_TARGET=...` + - To run all unit test suites: + - Using PIO: `platformio run -t test-marlin` + - Using Make: `make unit-test-all-local` + - Using Docker + make: `maker unit-test-all-local-docker` + - To run a single unit test suite: + - Using PIO: `platformio run -t marlin_` + - Using make: `make unit-test-single-local TEST_TARGET=` + - Using Docker + make: `maker unit-test-single-local-docker TEST_TARGET=` +- If your feature can be unit tested, add one or more unit tests. For more information see our documentation on [Unit Tests](test). + ## Contributors Marlin is constantly improving thanks to a huge number of contributors from all over the world bringing their specialties and talents. Huge thanks are due to [all the contributors](https://github.com/MarlinFirmware/Marlin/graphs/contributors) who regularly patch up bugs, help direct traffic, and basically keep Marlin from falling apart. Marlin's continued existence would not be possible without them. -## Administration +## Project Leadership -Regular users can open and close their own issues, but only the administrators can do project-related things like add labels, merge changes, set milestones, and kick trolls. The current Marlin admin team consists of: - - - - -
Project Maintainer
- - 🇺🇸  **Scott Lahteine** -       [@thinkyhead](https://github.com/thinkyhead) -       [  Donate 💸  ](https://www.thinkyhead.com/donate-to-marlin) - - - - 🇺🇸  **Roxanne Neufeld** -       [@Roxy-3D](https://github.com/Roxy-3D) - - 🇺🇸  **Keith Bennett** -       [@thisiskeithb](https://github.com/thisiskeithb) -       [  Donate 💸  ](https://github.com/sponsors/thisiskeithb) - - 🇺🇸  **Jason Smith** -       [@sjasonsmith](https://github.com/sjasonsmith) - - - - 🇧🇷  **Victor Oliveira** -       [@rhapsodyv](https://github.com/rhapsodyv) - - 🇬🇧  **Chris Pepper** -       [@p3p](https://github.com/p3p) - -🇳🇿  **Peter Ellens** -       [@ellensp](https://github.com/ellensp) -       [  Donate 💸  ](https://ko-fi.com/ellensp) - - - - 🇺🇸  **Bob Kuhn** -       [@Bob-the-Kuhn](https://github.com/Bob-the-Kuhn) - - 🇳🇱  **Erik van der Zalm** -       [@ErikZalm](https://github.com/ErikZalm) -       [  Donate 💸  ](https://flattr.com/submit/auto?user_id=ErikZalm&url=https://github.com/MarlinFirmware/Marlin&title=Marlin&language=&tags=github&category=software) - -
+Name|Role|Link|Donate +----|----|----|---- +🇺🇸 Scott Lahteine|Project Lead|[[@thinkyhead](https://github.com/thinkyhead)]|[💸 Donate](https://marlinfw.org/docs/development/contributing.html#donate) +🇺🇸 Roxanne Neufeld|Admin|[[@Roxy-3D](https://github.com/Roxy-3D)]| +🇺🇸 Keith Bennett|Admin|[[@thisiskeithb](https://github.com/thisiskeithb)]|[💸 Donate](https://github.com/sponsors/thisiskeithb) +🇺🇸 Jason Smith|Admin|[[@sjasonsmith](https://github.com/sjasonsmith)]| +🇧🇷 Victor Oliveira|Admin|[[@rhapsodyv](https://github.com/rhapsodyv)]| +🇬🇧 Chris Pepper|Admin|[[@p3p](https://github.com/p3p)]| +🇳🇿 Peter Ellens|Admin|[[@ellensp](https://github.com/ellensp)]|[💸 Donate](https://ko-fi.com/ellensp) +🇺🇸 Bob Kuhn|Admin|[[@Bob-the-Kuhn](https://github.com/Bob-the-Kuhn)]| +🇳🇱 Erik van der Zalm|Founder|[[@ErikZalm](https://github.com/ErikZalm)]| ## License Marlin is published under the [GPL license](/LICENSE) because we believe in open development. The GPL comes with both rights and obligations. Whether you use Marlin firmware as the driver for your open or closed-source product, you must keep Marlin open, and you must provide your compatible Marlin source code to end users upon request. The most straightforward way to comply with the Marlin license is to make a fork of Marlin on Github, perform your modifications, and direct users to your modified fork. - -While we can't prevent the use of this code in products (3D printers, CNC, etc.) that are closed source or crippled by a patent, we would prefer that you choose another firmware or, better yet, make your own. diff --git a/buildroot/bin/build_all_examples b/buildroot/bin/build_all_examples index a6d6ede47d..a77259bb36 100755 --- a/buildroot/bin/build_all_examples +++ b/buildroot/bin/build_all_examples @@ -14,7 +14,9 @@ # build_all_examples [...] branch [resume-from] # -. mfutil +HERE=`dirname $0` + +. "$HERE/mfutil" GITREPO=https://github.com/MarlinFirmware/Configurations.git STAT_FILE=./.pio/.buildall @@ -123,7 +125,7 @@ CONF_TREE=$( ls -d "$TMP"/config/examples/*/ "$TMP"/config/examples/*/*/ "$TMP"/ for CONF in $CONF_TREE ; do # Get a config's directory name - DIR=$( echo $CONF | sed "s|$TMP/config/examples/||" ) + DIR=$( echo $CONF | "$SED" "s|$TMP/config/examples/||" ) # If looking for a config, skip others [[ $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue diff --git a/buildroot/bin/build_example b/buildroot/bin/build_example index a8878e8d9f..dabc4c572c 100755 --- a/buildroot/bin/build_example +++ b/buildroot/bin/build_example @@ -5,7 +5,9 @@ # Usage: build_example internal config-home config-folder # -. mfutil +HERE=`dirname $0` + +. "$HERE/mfutil" # Require 'internal' as the first argument [[ "$1" == "internal" ]] || { echo "Don't call this script directly, use build_all_examples instead." ; exit 1 ; } @@ -36,6 +38,6 @@ unset IFS; set +f echo -e "\n#define NO_CONTROLLER_CUSTOM_WIRING_WARNING" >> Marlin/Configuration.h echo "Building the firmware now..." -$HERE/mftest -s -a -n1 || { echo "Failed"; exit 1; } +"$HERE/mftest" -s -a -n1 || { echo "Failed"; exit 1; } echo "Success" diff --git a/buildroot/bin/mfutil b/buildroot/bin/mfutil index 75a2791cfe..1699dd9adf 100755 --- a/buildroot/bin/mfutil +++ b/buildroot/bin/mfutil @@ -7,13 +7,12 @@ which curl 1>/dev/null 2>&1 || { echo "curl not found! Please install it."; exit ; } which git 1>/dev/null 2>&1 || { echo "git not found! Please install it."; exit ; } -SED=$(command -v gsed 2>/dev/null || command -v sed 2>/dev/null) +SED=$(which gsed sed | head -n1) [[ -z "$SED" ]] && { echo "No sed found, please install sed" ; exit 1 ; } OPEN=$( which gnome-open xdg-open open | head -n1 ) SELF=`basename "$0"` -HERE=`dirname "$0"` # Check if called in the right location [[ -e "Marlin/src" ]] || { echo -e "This script must be called from a Marlin working copy with:\n ./buildroot/bin/$SELF $1" ; exit ; } diff --git a/buildroot/bin/restore_configs b/buildroot/bin/restore_configs index ea998484c2..e1a601679b 100755 --- a/buildroot/bin/restore_configs +++ b/buildroot/bin/restore_configs @@ -7,5 +7,6 @@ if [[ $1 == '-d' || $1 == '--default' ]]; then else git checkout Marlin/Configuration.h 2>/dev/null git checkout Marlin/Configuration_adv.h 2>/dev/null - git checkout Marlin/src/pins/ramps/pins_RAMPS.h 2>/dev/null + git checkout Marlin/config.ini 2>/dev/null + git checkout Marlin/src/pins/*/pins_*.h 2>/dev/null fi diff --git a/buildroot/share/PlatformIO/boards/marlin_at90usb1286.json b/buildroot/share/PlatformIO/boards/marlin_at90usb1286.json index 3282722b04..27bd8a57aa 100644 --- a/buildroot/share/PlatformIO/boards/marlin_at90usb1286.json +++ b/buildroot/share/PlatformIO/boards/marlin_at90usb1286.json @@ -14,7 +14,7 @@ "maximum_ram_size": 8192, "maximum_size": 122880, "require_upload_port": true, - "protocol": "" + "protocol": "teensy-gui" }, "url": "https://github.com/MarlinFirmware/Marlin", "vendor": "various" diff --git a/buildroot/share/PlatformIO/scripts/collect-code-tests.py b/buildroot/share/PlatformIO/scripts/collect-code-tests.py new file mode 100644 index 0000000000..a0e0e86b11 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/collect-code-tests.py @@ -0,0 +1,59 @@ +# +# collect-code-tests.py +# Convenience script to collect all code tests. Used by env:linux_native_test in native.ini. +# + +import pioutil +if pioutil.is_pio_build(): + + import os, re + Import("env") + Import("projenv") + + os.environ['PATH'] = f"./buildroot/bin/:./buildroot/tests/:{os.environ['PATH']}" + + def collect_test_suites(): + """Get all the test suites""" + from pathlib import Path + return sorted(list(Path("./test").glob("*.ini"))) + + def register_test_suites(): + """Register all the test suites""" + targets = [] + test_suites = collect_test_suites() + for path in test_suites: + name = re.sub(r'^\d+-|\.ini$', '', path.name) + targets += [name]; + + env.AddCustomTarget( + name = f"marlin_{name}", + dependencies = None, + actions = [ + f"echo ====== Configuring for marlin_{name} ======", + "restore_configs", + f"cp -f {path} ./Marlin/config.ini", + "python ./buildroot/share/PlatformIO/scripts/configuration.py", + f"platformio test -e linux_native_test -f {name}", + "restore_configs", + ], + title = "Marlin: {}".format(name.lower().title().replace("_", " ")), + description = ( + f"Run a Marlin test suite, with the appropriate configuration, " + f"that sits in {path}" + ) + ) + + env.AddCustomTarget( + name = "test-marlin", + dependencies = None, + actions = [ + f"platformio run -t marlin_{name} -e linux_native_test" + for name in targets + ], + title = "Marlin: Test all code test suites", + description = ( + f"Run all Marlin code test suites ({len(targets)} found)." + ), + ) + + register_test_suites() diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index 2e4ab5c92d..2a5f98dbbf 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -71,7 +71,9 @@ if pioutil.is_pio_build(): config = env.GetProjectConfig() result = check_envs("env:"+build_env, board_envs, config) - if not result: + # Make sure board is compatible with the build environment. Skip for _test, + # since the board is manipulated as each unit test is executed. + if not result and build_env != "linux_native_test": err = "Error: Build environment '%s' is incompatible with %s. Use one of these environments: %s" % \ ( build_env, motherboard, ", ".join([ e[4:] for e in board_envs if e.startswith("env:") ]) ) raise SystemExit(err) diff --git a/buildroot/share/PlatformIO/scripts/signature.py b/buildroot/share/PlatformIO/scripts/signature.py index 2d024c3662..820e6b7d65 100755 --- a/buildroot/share/PlatformIO/scripts/signature.py +++ b/buildroot/share/PlatformIO/scripts/signature.py @@ -18,13 +18,13 @@ def enabled_defines(filepath): Each entry is a dictionary with a 'name' and a 'section' key. We end up with: { MOTHERBOARD: { name: "MOTHERBOARD", section: "hardware" }, ... } - The 'name' key might get dropped as redundant, but it's useful for debugging. + TODO: Drop the 'name' key as redundant. For now it's useful for debugging. + + This list is only used to filter config-defined options from those defined elsewhere. Because the option names are the keys, only the last occurrence is retained. - Use the Schema class for a more complete list of options, soon with full parsing. - - This list is used to filter what is actually a config-defined option versus - defines from elsewhere. + This means the actual used value might not be reflected by this function. + The Schema class does more complete parsing for a more accurate list of options. While the Schema class parses the configurations on its own, this script will get the preprocessor output and get the intersection of the enabled options from @@ -44,13 +44,10 @@ def enabled_defines(filepath): # This will avoid false positives from #defines in comments f = re.sub(r'/\*.*?\*/', '', '\n'.join(f), flags=re.DOTALL).split("\n") - a = [] for line in f: sline = line.strip() m = re.match(spatt, sline) # @section ... - if m: - section = m.group(1).strip() - continue + if m: section = m.group(1).strip() ; continue if sline[:7] == "#define": # Extract the key here (we don't care about the value) kv = sline[8:].strip().split() @@ -79,6 +76,7 @@ def compute_build_signature(env): Compute the build signature by extracting all configuration settings and building a unique reversible signature that can be included in the binary. The signature can be reversed to get a 1:1 equivalent configuration file. + Used by common-dependencies.py after filtering build files by feature. ''' if 'BUILD_SIGNATURE' in env: return env.Append(BUILD_SIGNATURE=1) diff --git a/buildroot/share/PlatformIO/scripts/tronxy_cxy_446_v10.py b/buildroot/share/PlatformIO/scripts/tronxy_cxy_446_v10.py new file mode 100644 index 0000000000..f3cb94a062 --- /dev/null +++ b/buildroot/share/PlatformIO/scripts/tronxy_cxy_446_v10.py @@ -0,0 +1,41 @@ +# +# tronxy_cxy_446_v10.py +# Build customizations for env:TRONXY_CXY_446_V10 +# +import pioutil +if pioutil.is_pio_build(): + + import marlin, os + + from SCons.Script import DefaultEnvironment + + env = DefaultEnvironment() + + # Check whether the "update" folder exists + outpath = "update" + if not os.path.exists(outpath): os.makedirs(outpath) + + # Build "fmw_tronxy.hex" and place in "update" folder + def output_target_hex(): + tar_hex = f"{outpath}/fmw_tronxy.hex" + env.AddPostAction( + "$BUILD_DIR/${PROGNAME}.elf", + env.VerboseAction(" ".join([ + "$OBJCOPY", "-O", "ihex", "-R", ".eeprom", + "$BUILD_DIR/${PROGNAME}.elf", tar_hex + ]), "Building %s" % tar_hex) + ) + + # Build "fmw_tronxy.bin" and place in "update" folder + def output_target_bin(): + tar_bin = f"{outpath}/fmw_tronxy.bin" + env.AddPostAction( + "$BUILD_DIR/${PROGNAME}.elf", + env.VerboseAction(" ".join([ + "$OBJCOPY", "-O", "binary", "-R", ".eeprom", + "$BUILD_DIR/${PROGNAME}.elf", tar_bin + ]), "Building %s" % tar_bin) + ) + + output_target_hex() + output_target_bin() diff --git a/buildroot/share/cmake/CMakeLists.txt b/buildroot/share/cmake/CMakeLists.txt index 0316c7fc0b..5f15d26680 100644 --- a/buildroot/share/cmake/CMakeLists.txt +++ b/buildroot/share/cmake/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_minimum_required(VERSION 3.5) # and add the path to the module path # #====================================================================# -set(SCRIPT_BRANCH 1.0.2) #Set to wanted marlin-cmake release tag or branch +set(SCRIPT_BRANCH 1.0.2) # Set to wanted marlin-cmake release tag or branch if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake) @@ -82,13 +82,13 @@ message("-- Running CMake version: " ${CMAKE_VERSION}) # Replace the CMake Ver. in the Arduino.cmake file(READ "${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/Platform/Arduino.cmake" ORIGINAL_FILE_CONTENTS) -string(REPLACE "cmake_minimum_required(VERSION 2.8.5)" "cmake_minimum_required(VERSION 3.5)" NEW_FILE_CONTENTS "${ORIGINAL_FILE_CONTENTS}") +string(REGEX REPLACE "cmake_minimum_required\\(VERSION[^\n]*\n" "cmake_minimum_required(VERSION 3.5)\n" NEW_FILE_CONTENTS "${ORIGINAL_FILE_CONTENTS}") file(WRITE "${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/Platform/Arduino.cmake" "${NEW_FILE_CONTENTS}") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/modules) #====================================================================# -# Custom path to Arduino SDK can be set here. # +# Custom path to Arduino SDK can be set here # # It can also be set from command line. eg.: # # cmake .. -DARDUINO_SDK_PATH="/path/to/arduino-1.x.x" # #====================================================================# @@ -113,14 +113,14 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/toolchain/Arduin # If you receive this error: # # 'Unknown CMake command "_cmake_record_install_prefix".' # # # -# Go to the file in your CMake directory. # +# Go to the file in your CMake directory # # # # For Windows: cmake\Modules\Platform\WindowsPaths.cmake # # For Linux: cmake/Modules/Platform/UnixPaths.cmake # # # # Comment out "_cmake_record_install_prefix()" # # - OR - # -# Add "include(CMakeSystemSpecificInformation)" above the line. # +# Add "include(CMakeSystemSpecificInformation)" above the line # # # #====================================================================# project(Marlin C CXX) diff --git a/buildroot/share/dwin/bin/DWIN_ICO.py b/buildroot/share/dwin/bin/DWIN_ICO.py index 436a98701d..4594e55017 100644 --- a/buildroot/share/dwin/bin/DWIN_ICO.py +++ b/buildroot/share/dwin/bin/DWIN_ICO.py @@ -76,23 +76,19 @@ class DWIN_ICO_File(): self._parseHeader(infile) self._splitEntryData(infile, outDir) - return - def _parseHeader(self, infile): maxEntries = 256 count = 0 - validEntries = 0 + icon_nums = _iconNames.keys() while count < maxEntries: rawBytes = infile.read(16) entry = Entry() entry.parseRawData(rawBytes) # check that it is valid: is offset nonzero? - # Special case: treat 39 as valid - if (entry.offset > 0) or (count == 39): - validEntries += 1 + # Special case: treat missing numbers as valid + if (entry.offset > 0) or count not in icon_nums: self.entries.append(entry) count += 1 - return def _splitEntryData(self, infile, outDir): print('Splitting Entry Data...') @@ -110,18 +106,16 @@ class DWIN_ICO_File(): if entry.length == 0: count += 1 continue - # Seek file position, read length bytes, and write to new output file. - print('%02d: offset: 0x%06x len: 0x%04x width: %d height: %d' % - (count, entry.offset, entry.length, entry.width, entry.height)) - outfilename = os.path.join(outDir, '%03d-ICON_%s.jpg' % (count, _iconNames7[count])) + outfilename = os.path.join(outDir, '%03d-ICON_%s.jpg' % (count, _iconNames.get(count, "UNKNOWN"))) with open(outfilename, 'wb') as outfile: infile.seek(entry.offset) blob = infile.read(entry.length) outfile.write(blob) - print('Wrote %d bytes to %s' % (entry.length, outfilename)) + # Seek file position, read length bytes, and write to new output file. + print('(%3d: width=%3d height=%3d offset=%6d len=%4d) ... %s' % + (count, entry.width, entry.height, entry.offset, entry.length, os.path.basename(outfilename))) count += 1 - return def createFile(self, iconDir, filename): '''Create a new .ico file from the contents of iconDir. @@ -179,7 +173,6 @@ class DWIN_ICO_File(): offset += e.length #print('%03d: (%d x %d) len=%d off=%d' % # (i, e.width, e.height, e.length, e.offset)) - return def _combineAndWriteIcoFile(self, filename): """Write out final .ico file. @@ -198,7 +191,6 @@ class DWIN_ICO_File(): if 0 == e.length: continue guts = self._getFileContents(e.filename, e.length) outfile.write(guts) - return def _getFileContents(self, filename, length): """Read contents of filename, and return bytes""" @@ -232,7 +224,6 @@ class Entry(): self.height = h self.offset = off self.length = len3 * 65536 + len21 - return def serialize(self): """Convert this Entry's information into a 16-byte @@ -245,97 +236,112 @@ class Entry(): 0, 0, 0, 0, 0) return rawdata -_iconNames7 = { - 0 : "LOGO_Creality", - 1 : "Print_0", - 2 : "Print_1", - 3 : "Prepare_0", - 4 : "Prepare_1", - 5 : "Control_0", - 6 : "Control_1", - 7 : "Leveling_0", - 8 : "Leveling_1", - 9 : "HotendTemp", - 10 : "BedTemp", - 11 : "Speed", - 12 : "Zoffset", - 13 : "Back", - 14 : "File", - 15 : "PrintTime", - 16 : "RemainTime", - 17 : "Setup_0", - 18 : "Setup_1", - 19 : "Pause_0", - 20 : "Pause_1", - 21 : "Continue_0", - 22 : "Continue_1", - 23 : "Stop_0", - 24 : "Stop_1", - 25 : "Bar", - 26 : "More", - 27 : "Axis", - 28 : "CloseMotor", - 29 : "Homing", - 30 : "SetHome", - 31 : "PLAPreheat", - 32 : "ABSPreheat", - 33 : "Cool", - 34 : "Language", - 35 : "MoveX", - 36 : "MoveY", - 37 : "MoveZ", - 38 : "Extruder", - # Skip 39 - 40 : "Temperature", - 41 : "Motion", - 42 : "WriteEEPROM", - 43 : "ReadEEPROM", - 44 : "ResetEEPROM", - 45 : "Info", - 46 : "SetEndTemp", - 47 : "SetBedTemp", - 48 : "FanSpeed", - 49 : "SetPLAPreheat", - 50 : "SetABSPreheat", - 51 : "MaxSpeed", - 52 : "MaxAccelerated", - 53 : "MaxJerk", - 54 : "Step", - 55 : "PrintSize", - 56 : "Version", - 57 : "Contact", - 58 : "StockConfiguraton", - 59 : "MaxSpeedX", - 60 : "MaxSpeedY", - 61 : "MaxSpeedZ", - 62 : "MaxSpeedE", - 63 : "MaxAccX", - 64 : "MaxAccY", - 65 : "MaxAccZ", - 66 : "MaxAccE", - 67 : "MaxSpeedJerkX", - 68 : "MaxSpeedJerkY", - 69 : "MaxSpeedJerkZ", - 70 : "MaxSpeedJerkE", - 71 : "StepX", - 72 : "StepY", - 73 : "StepZ", - 74 : "StepE", - 75 : "Setspeed", - 76 : "SetZOffset", - 77 : "Rectangle", - 78 : "BLTouch", - 79 : "TempTooLow", - 80 : "AutoLeveling", - 81 : "TempTooHigh", - 82 : "NoTips_C", - 83 : "NoTips_E", - 84 : "Continue_C", - 85 : "Continue_E", - 86 : "Cancel_C", - 87 : "Cancel_E", - 88 : "Confirm_C", - 89 : "Confirm_E", - 90 : "Info_0", - 91 : "Info_1" +_iconNames = { + 0 : "LOGO_Creality", + 1 : "Print_0", + 2 : "Print_1", + 3 : "Prepare_0", + 4 : "Prepare_1", + 5 : "Control_0", + 6 : "Control_1", + 7 : "Leveling_0", + 8 : "Leveling_1", + 9 : "HotendTemp", + 10 : "BedTemp", + 11 : "Speed", + 12 : "Zoffset", + 13 : "Back", + 14 : "File", + 15 : "PrintTime", + 16 : "RemainTime", + 17 : "Setup_0", + 18 : "Setup_1", + 19 : "Pause_0", + 20 : "Pause_1", + 21 : "Continue_0", + 22 : "Continue_1", + 23 : "Stop_0", + 24 : "Stop_1", + 25 : "Bar", + 26 : "More", + 27 : "Axis", + 28 : "CloseMotor", + 29 : "Homing", + 30 : "SetHome", + 31 : "PLAPreheat", + 32 : "ABSPreheat", + 33 : "Cool", + 34 : "Language", + 35 : "MoveX", + 36 : "MoveY", + 37 : "MoveZ", + 38 : "Extruder", + # Skip 39 + 40 : "Temperature", + 41 : "Motion", + 42 : "WriteEEPROM", + 43 : "ReadEEPROM", + 44 : "ResetEEPROM", + 45 : "Info", + 46 : "SetEndTemp", + 47 : "SetBedTemp", + 48 : "FanSpeed", + 49 : "SetPLAPreheat", + 50 : "SetABSPreheat", + 51 : "MaxSpeed", + 52 : "MaxAccelerated", + 53 : "MaxJerk", + 54 : "Step", + 55 : "PrintSize", + 56 : "Version", + 57 : "Contact", + 58 : "StockConfiguraton", + 59 : "MaxSpeedX", + 60 : "MaxSpeedY", + 61 : "MaxSpeedZ", + 62 : "MaxSpeedE", + 63 : "MaxAccX", + 64 : "MaxAccY", + 65 : "MaxAccZ", + 66 : "MaxAccE", + 67 : "MaxSpeedJerkX", + 68 : "MaxSpeedJerkY", + 69 : "MaxSpeedJerkZ", + 70 : "MaxSpeedJerkE", + 71 : "StepX", + 72 : "StepY", + 73 : "StepZ", + 74 : "StepE", + 75 : "Setspeed", + 76 : "SetZOffset", + 77 : "Rectangle", + 78 : "BLTouch", + 79 : "TempTooLow", + 80 : "AutoLeveling", + 81 : "TempTooHigh", + 82 : "NoTips_C", + 83 : "NoTips_E", + 84 : "Continue_C", + 85 : "Continue_E", + 86 : "Cancel_C", + 87 : "Cancel_E", + 88 : "Confirm_C", + 89 : "Confirm_E", + 90 : "Info_0", + 91 : "Info_1", + 92 : "DegreesC", + 93 : "Printer_0", + 200 : "Checkbox_F", + 201 : "Checkbox_T", + 202 : "Fade", + 203 : "Mesh", + 204 : "Tilt", + 205 : "Brightness", + 206 : "Probe", + 249 : "AxisD", + 250 : "AxisBR", + 251 : "AxisTR", + 252 : "AxisBL", + 253 : "AxisTL", + 254 : "AxisC" } diff --git a/buildroot/share/dwin/bin/README.md b/buildroot/share/dwin/bin/README.md index a00d679bf8..c78f4eb97f 100644 --- a/buildroot/share/dwin/bin/README.md +++ b/buildroot/share/dwin/bin/README.md @@ -4,7 +4,7 @@ Tools for processing `.ICO` files used by DWIN displays. ## Introduction -The DWIN LCDs that come with the Creality Ender-3 v2 and other 3D printers contain image and container files stored on them which are used to draw various the UI elements. +The DWIN LCDs that come with the Creality Ender-3 V2 and other 3D printers contain image and container files stored on them which are used to draw various the UI elements. Standard `.JPG` files can be installed for things like the boot screen, and `.ICO` files can contain several images within a structured file format. @@ -48,9 +48,11 @@ Pillow is most easily installed with pip: These tools process an `.ICO` file that you specify. The safest method is to create a folder and copy your `.ICO` file there. For example: +``` $ mkdir hackicons - $ cp 9.ICO hackicons + $ cp 7.ICO hackicons $ cd hackicons +``` The following explanations will refer back to this layout. @@ -58,35 +60,68 @@ The following explanations will refer back to this layout. If you want to edit the individual icons stored in an ICO file (or add more images) you'll first need to extract all the images from the archive using `splitIco.py`. -**Usage:** `splitIco.py #.ICO foldername`. +#### Usage: +``` +splitIco.py #.ICO foldername +``` -**Example:** +#### Splitting .ICO FIle In Windows: +- Create `Split-ICO.bat` file in this folder with the following code: + - `for /f %%f in ('dir *.ICO /B /O:-D') do splitico.py %%f %%f-icons` +- Paste `.ICO` file into this folder +- Run `Split-ICO.bat` +- A new folder should appear containing all icons -In this example we're extracting the constituent JPEG files from `9.ICO` and storing them in a folder named `icons`. As each file is extracted the script reports its index number, byte offset, size, dimensions, and filename: +#### Example: - $ cd buildroot/share/dwin - $ ./bin/splitIco.py 9.ICO icons-9 - Splitting 9.ICO into dir icons - Splitting Entry Data... - 00: offset: 0x001000 len: 0x10a2 width: 130 height: 17 - Wrote 4258 bytes to icons/000-ICON_LOGO.jpg - 01: offset: 0x0020a2 len: 0x0eac width: 110 height: 100 - Wrote 3756 bytes to icons/001-ICON_Print_0.jpg - 02: offset: 0x002f4e len: 0x0eaa width: 110 height: 100 - Wrote 3754 bytes to icons/002-ICON_Print_1.jpg - ... - 91: offset: 0x0345fc len: 0x0d89 width: 110 height: 100 - Wrote 3465 bytes to icons/091-ICON_Info_1.jpg +In this example we're extracting the constituent JPEG files from `7.ICO` and storing them in a folder named `icons-7`. As each file is extracted the script reports its index number, byte offset, size, dimensions, and filename: + +``` +$ cd buildroot/share/dwin +$ ./bin/splitIco.py 7.ICO icons-7 + Splitting 7.ICO into dir icons-7 + Splitting Entry Data... + 00: offset: 0x001000 len: 0x10a2 width: 130 height: 17 + Wrote 4258 bytes to icons-7/000-ICON_LOGO.jpg + 01: offset: 0x0020a2 len: 0x0eac width: 110 height: 100 + Wrote 3756 bytes to icons-7/001-ICON_Print_0.jpg + 02: offset: 0x002f4e len: 0x0eaa width: 110 height: 100 + Wrote 3754 bytes to icons-7/002-ICON_Print_1.jpg + ... + 91: offset: 0x0345fc len: 0x0d89 width: 110 height: 100 + Wrote 3465 bytes to icons-7/091-ICON_Info_1.jpg +``` Once the individual JPEG files have been saved they can be edited using common graphics applications like Photoshop. JPEG files are inherently lossy and will usually contain ugly artifacts, so cleanup may be needed before they are re-exported. Keep the limits of bank size in mind when exporting images and try to find the best balance between compressed size and image quality. ### `makeIco.py` - Combine JPEGs into `ICO` archive -After editing images you'll create a new `9.ICO` archive with `makeIco.py` like so: +If you want to create an ICO file you'll need to use `makeIco.py`. - $ cd buildroot/share/dwin - $ ./bin/makeIco.py icons-3 3.ICO - Making .ico file '3.ICO' from contents of 'icons-3' - Scanning icon directory icons-3 - ...Scanned 16 icon files - Scanning done. 16 icons included. +#### Usage: +``` +makeIco.py foldername #.ICO +``` + +#### Making .ICO FIle In Windows: +- Create `Make-ICO.bat` file in this folder with the following code: + - ``` + setlocal enabledelayedexpansion + for /f %%f in ('dir *-icons /B /O:-D') do set f=%%f & makeico.py %%f !f:~0,-7! + ``` +- Paste folder containing all icons into this folder +- Run `Make-ICO.bat` +- A new `.ICO` file should appear + +#### Example: + +After editing images you'll create a new `7.ICO` archive with `makeIco.py` like so: + +``` +$ cd buildroot/share/dwin +$ ./bin/makeIco.py icons-7 7.ICO + Making .ico file '7.ICO' from contents of 'icons-7' + Scanning icon directory icons-7 + ...Scanned 16 icon files + Scanning done. 16 icons included. +``` diff --git a/buildroot/share/dwin/icons-4/016-ICON_Bedline.jpg b/buildroot/share/dwin/icons-4/016-ICON_Bedline.jpg new file mode 100644 index 0000000000..68d65dc5fe Binary files /dev/null and b/buildroot/share/dwin/icons-4/016-ICON_Bedline.jpg differ diff --git a/buildroot/share/dwin/icons-4/017-ICON_BedLeveledOff.jpg b/buildroot/share/dwin/icons-4/017-ICON_BedLeveledOff.jpg new file mode 100644 index 0000000000..853fa5159b Binary files /dev/null and b/buildroot/share/dwin/icons-4/017-ICON_BedLeveledOff.jpg differ diff --git a/buildroot/share/dwin/icons-4/018-ICON_BedLeveledOn.jpg b/buildroot/share/dwin/icons-4/018-ICON_BedLeveledOn.jpg new file mode 100644 index 0000000000..d495b57c0a Binary files /dev/null and b/buildroot/share/dwin/icons-4/018-ICON_BedLeveledOn.jpg differ diff --git a/buildroot/share/dwin/icons-7/009-ICON_HotendTemp.jpg b/buildroot/share/dwin/icons-7/009-ICON_HotendTemp.jpg index 0bf1437c64..b3551f3c5c 100644 Binary files a/buildroot/share/dwin/icons-7/009-ICON_HotendTemp.jpg and b/buildroot/share/dwin/icons-7/009-ICON_HotendTemp.jpg differ diff --git a/buildroot/share/dwin/icons-7/010-ICON_BedTemp.jpg b/buildroot/share/dwin/icons-7/010-ICON_BedTemp.jpg index 186d02ad3b..2d46d13b84 100644 Binary files a/buildroot/share/dwin/icons-7/010-ICON_BedTemp.jpg and b/buildroot/share/dwin/icons-7/010-ICON_BedTemp.jpg differ diff --git a/buildroot/share/dwin/icons-7/011-ICON_Speed.jpg b/buildroot/share/dwin/icons-7/011-ICON_Speed.jpg index 387c166566..83da633221 100644 Binary files a/buildroot/share/dwin/icons-7/011-ICON_Speed.jpg and b/buildroot/share/dwin/icons-7/011-ICON_Speed.jpg differ diff --git a/buildroot/share/dwin/icons-7/012-ICON_Zoffset.jpg b/buildroot/share/dwin/icons-7/012-ICON_Zoffset.jpg index 2e74ee3986..8956690a75 100644 Binary files a/buildroot/share/dwin/icons-7/012-ICON_Zoffset.jpg and b/buildroot/share/dwin/icons-7/012-ICON_Zoffset.jpg differ diff --git a/buildroot/share/dwin/icons-7/019-ICON_Pause_0.jpg b/buildroot/share/dwin/icons-7/019-ICON_Pause_0.jpg index 2f6e831109..227f0dd8f4 100644 Binary files a/buildroot/share/dwin/icons-7/019-ICON_Pause_0.jpg and b/buildroot/share/dwin/icons-7/019-ICON_Pause_0.jpg differ diff --git a/buildroot/share/dwin/icons-7/020-ICON_Pause_1.jpg b/buildroot/share/dwin/icons-7/020-ICON_Pause_1.jpg index 746b943c14..e54823be72 100644 Binary files a/buildroot/share/dwin/icons-7/020-ICON_Pause_1.jpg and b/buildroot/share/dwin/icons-7/020-ICON_Pause_1.jpg differ diff --git a/buildroot/share/dwin/icons-7/030-ICON_SetHome.jpg b/buildroot/share/dwin/icons-7/030-ICON_SetHome.jpg index 14aedc0dd0..bd55f6f929 100644 Binary files a/buildroot/share/dwin/icons-7/030-ICON_SetHome.jpg and b/buildroot/share/dwin/icons-7/030-ICON_SetHome.jpg differ diff --git a/buildroot/share/dwin/icons-7/034-ICON_Language.jpg b/buildroot/share/dwin/icons-7/034-ICON_Language.jpg index 055b4c1ae8..8cebfa76c7 100644 Binary files a/buildroot/share/dwin/icons-7/034-ICON_Language.jpg and b/buildroot/share/dwin/icons-7/034-ICON_Language.jpg differ diff --git a/buildroot/share/dwin/icons-7/035-ICON_MoveX.jpg b/buildroot/share/dwin/icons-7/035-ICON_MoveX.jpg index 54f834caaf..20f2aab40c 100644 Binary files a/buildroot/share/dwin/icons-7/035-ICON_MoveX.jpg and b/buildroot/share/dwin/icons-7/035-ICON_MoveX.jpg differ diff --git a/buildroot/share/dwin/icons-7/036-ICON_MoveY.jpg b/buildroot/share/dwin/icons-7/036-ICON_MoveY.jpg index b82a5b25cd..72841e97bd 100644 Binary files a/buildroot/share/dwin/icons-7/036-ICON_MoveY.jpg and b/buildroot/share/dwin/icons-7/036-ICON_MoveY.jpg differ diff --git a/buildroot/share/dwin/icons-7/037-ICON_MoveZ.jpg b/buildroot/share/dwin/icons-7/037-ICON_MoveZ.jpg index 487d6e4e44..4af56c25a6 100644 Binary files a/buildroot/share/dwin/icons-7/037-ICON_MoveZ.jpg and b/buildroot/share/dwin/icons-7/037-ICON_MoveZ.jpg differ diff --git a/buildroot/share/dwin/icons-7/038-ICON_Extruder.jpg b/buildroot/share/dwin/icons-7/038-ICON_Extruder.jpg index 155b9a5857..69e456c499 100644 Binary files a/buildroot/share/dwin/icons-7/038-ICON_Extruder.jpg and b/buildroot/share/dwin/icons-7/038-ICON_Extruder.jpg differ diff --git a/buildroot/share/dwin/icons-7/040-ICON_Temperature.jpg b/buildroot/share/dwin/icons-7/040-ICON_Temperature.jpg index eaea25bbd8..b0eef7e420 100644 Binary files a/buildroot/share/dwin/icons-7/040-ICON_Temperature.jpg and b/buildroot/share/dwin/icons-7/040-ICON_Temperature.jpg differ diff --git a/buildroot/share/dwin/icons-7/041-ICON_Motion.jpg b/buildroot/share/dwin/icons-7/041-ICON_Motion.jpg index 472a6354e4..ad083a208b 100644 Binary files a/buildroot/share/dwin/icons-7/041-ICON_Motion.jpg and b/buildroot/share/dwin/icons-7/041-ICON_Motion.jpg differ diff --git a/buildroot/share/dwin/icons-7/045-ICON_Info.jpg b/buildroot/share/dwin/icons-7/045-ICON_Info.jpg index 34e63e587a..9cfcf912c8 100644 Binary files a/buildroot/share/dwin/icons-7/045-ICON_Info.jpg and b/buildroot/share/dwin/icons-7/045-ICON_Info.jpg differ diff --git a/buildroot/share/dwin/icons-7/046-ICON_SetEndTemp.jpg b/buildroot/share/dwin/icons-7/046-ICON_SetEndTemp.jpg index 33f5004183..7565e5defe 100644 Binary files a/buildroot/share/dwin/icons-7/046-ICON_SetEndTemp.jpg and b/buildroot/share/dwin/icons-7/046-ICON_SetEndTemp.jpg differ diff --git a/buildroot/share/dwin/icons-7/047-ICON_SetBedTemp.jpg b/buildroot/share/dwin/icons-7/047-ICON_SetBedTemp.jpg index 09e5072ab9..186d02ad3b 100644 Binary files a/buildroot/share/dwin/icons-7/047-ICON_SetBedTemp.jpg and b/buildroot/share/dwin/icons-7/047-ICON_SetBedTemp.jpg differ diff --git a/buildroot/share/dwin/icons-7/051-ICON_MaxSpeed.jpg b/buildroot/share/dwin/icons-7/051-ICON_MaxSpeed.jpg index eaaa21255b..d8b416827d 100644 Binary files a/buildroot/share/dwin/icons-7/051-ICON_MaxSpeed.jpg and b/buildroot/share/dwin/icons-7/051-ICON_MaxSpeed.jpg differ diff --git a/buildroot/share/dwin/icons-7/052-ICON_MaxAccelerated.jpg b/buildroot/share/dwin/icons-7/052-ICON_MaxAccelerated.jpg index 4e9c3ad6e4..dda2a55659 100644 Binary files a/buildroot/share/dwin/icons-7/052-ICON_MaxAccelerated.jpg and b/buildroot/share/dwin/icons-7/052-ICON_MaxAccelerated.jpg differ diff --git a/buildroot/share/dwin/icons-7/053-ICON_MaxJerk.jpg b/buildroot/share/dwin/icons-7/053-ICON_MaxJerk.jpg index 119df1a03d..05190db4c3 100644 Binary files a/buildroot/share/dwin/icons-7/053-ICON_MaxJerk.jpg and b/buildroot/share/dwin/icons-7/053-ICON_MaxJerk.jpg differ diff --git a/buildroot/share/dwin/icons-7/054-ICON_Step.jpg b/buildroot/share/dwin/icons-7/054-ICON_Step.jpg index 4a0da4a487..3f240655a5 100644 Binary files a/buildroot/share/dwin/icons-7/054-ICON_Step.jpg and b/buildroot/share/dwin/icons-7/054-ICON_Step.jpg differ diff --git a/buildroot/share/dwin/icons-7/058-ICON_StockConfiguraton.jpg b/buildroot/share/dwin/icons-7/058-ICON_StockConfiguraton.jpg index 8e2b6fedbe..7a64b70378 100644 Binary files a/buildroot/share/dwin/icons-7/058-ICON_StockConfiguraton.jpg and b/buildroot/share/dwin/icons-7/058-ICON_StockConfiguraton.jpg differ diff --git a/buildroot/share/dwin/icons-7/059-ICON_MaxSpeedX.jpg b/buildroot/share/dwin/icons-7/059-ICON_MaxSpeedX.jpg index c60504f326..5950063543 100644 Binary files a/buildroot/share/dwin/icons-7/059-ICON_MaxSpeedX.jpg and b/buildroot/share/dwin/icons-7/059-ICON_MaxSpeedX.jpg differ diff --git a/buildroot/share/dwin/icons-7/060-ICON_MaxSpeedY.jpg b/buildroot/share/dwin/icons-7/060-ICON_MaxSpeedY.jpg index c3b3cc7ce1..f069adeb02 100644 Binary files a/buildroot/share/dwin/icons-7/060-ICON_MaxSpeedY.jpg and b/buildroot/share/dwin/icons-7/060-ICON_MaxSpeedY.jpg differ diff --git a/buildroot/share/dwin/icons-7/061-ICON_MaxSpeedZ.jpg b/buildroot/share/dwin/icons-7/061-ICON_MaxSpeedZ.jpg index fe79df3746..9b604bca12 100644 Binary files a/buildroot/share/dwin/icons-7/061-ICON_MaxSpeedZ.jpg and b/buildroot/share/dwin/icons-7/061-ICON_MaxSpeedZ.jpg differ diff --git a/buildroot/share/dwin/icons-7/062-ICON_MaxSpeedE.jpg b/buildroot/share/dwin/icons-7/062-ICON_MaxSpeedE.jpg index 519f1b448c..1625ed2c6a 100644 Binary files a/buildroot/share/dwin/icons-7/062-ICON_MaxSpeedE.jpg and b/buildroot/share/dwin/icons-7/062-ICON_MaxSpeedE.jpg differ diff --git a/buildroot/share/dwin/icons-7/063-ICON_MaxAccX.jpg b/buildroot/share/dwin/icons-7/063-ICON_MaxAccX.jpg index 9258c8618f..57122f127b 100644 Binary files a/buildroot/share/dwin/icons-7/063-ICON_MaxAccX.jpg and b/buildroot/share/dwin/icons-7/063-ICON_MaxAccX.jpg differ diff --git a/buildroot/share/dwin/icons-7/064-ICON_MaxAccY.jpg b/buildroot/share/dwin/icons-7/064-ICON_MaxAccY.jpg index 1a16331456..d7183b716b 100644 Binary files a/buildroot/share/dwin/icons-7/064-ICON_MaxAccY.jpg and b/buildroot/share/dwin/icons-7/064-ICON_MaxAccY.jpg differ diff --git a/buildroot/share/dwin/icons-7/065-ICON_MaxAccZ.jpg b/buildroot/share/dwin/icons-7/065-ICON_MaxAccZ.jpg index 23255ce0e5..ccf17d2b41 100644 Binary files a/buildroot/share/dwin/icons-7/065-ICON_MaxAccZ.jpg and b/buildroot/share/dwin/icons-7/065-ICON_MaxAccZ.jpg differ diff --git a/buildroot/share/dwin/icons-7/066-ICON_MaxAccE.jpg b/buildroot/share/dwin/icons-7/066-ICON_MaxAccE.jpg index 5bd3fedd6e..12bb8c1ea9 100644 Binary files a/buildroot/share/dwin/icons-7/066-ICON_MaxAccE.jpg and b/buildroot/share/dwin/icons-7/066-ICON_MaxAccE.jpg differ diff --git a/buildroot/share/dwin/icons-7/067-ICON_MaxSpeedJerkX.jpg b/buildroot/share/dwin/icons-7/067-ICON_MaxSpeedJerkX.jpg index c316c750b5..d00fa1156d 100644 Binary files a/buildroot/share/dwin/icons-7/067-ICON_MaxSpeedJerkX.jpg and b/buildroot/share/dwin/icons-7/067-ICON_MaxSpeedJerkX.jpg differ diff --git a/buildroot/share/dwin/icons-7/068-ICON_MaxSpeedJerkY.jpg b/buildroot/share/dwin/icons-7/068-ICON_MaxSpeedJerkY.jpg index c7cda89503..6b8888a910 100644 Binary files a/buildroot/share/dwin/icons-7/068-ICON_MaxSpeedJerkY.jpg and b/buildroot/share/dwin/icons-7/068-ICON_MaxSpeedJerkY.jpg differ diff --git a/buildroot/share/dwin/icons-7/069-ICON_MaxSpeedJerkZ.jpg b/buildroot/share/dwin/icons-7/069-ICON_MaxSpeedJerkZ.jpg index be450cd460..f06a69ae2e 100644 Binary files a/buildroot/share/dwin/icons-7/069-ICON_MaxSpeedJerkZ.jpg and b/buildroot/share/dwin/icons-7/069-ICON_MaxSpeedJerkZ.jpg differ diff --git a/buildroot/share/dwin/icons-7/070-ICON_MaxSpeedJerkE.jpg b/buildroot/share/dwin/icons-7/070-ICON_MaxSpeedJerkE.jpg index 3c926b8565..9a018367ff 100644 Binary files a/buildroot/share/dwin/icons-7/070-ICON_MaxSpeedJerkE.jpg and b/buildroot/share/dwin/icons-7/070-ICON_MaxSpeedJerkE.jpg differ diff --git a/buildroot/share/dwin/icons-7/071-ICON_StepX.jpg b/buildroot/share/dwin/icons-7/071-ICON_StepX.jpg index f1015b8218..432b10626c 100644 Binary files a/buildroot/share/dwin/icons-7/071-ICON_StepX.jpg and b/buildroot/share/dwin/icons-7/071-ICON_StepX.jpg differ diff --git a/buildroot/share/dwin/icons-7/072-ICON_StepY.jpg b/buildroot/share/dwin/icons-7/072-ICON_StepY.jpg index 9bb3e6e6be..9348ef0424 100644 Binary files a/buildroot/share/dwin/icons-7/072-ICON_StepY.jpg and b/buildroot/share/dwin/icons-7/072-ICON_StepY.jpg differ diff --git a/buildroot/share/dwin/icons-7/073-ICON_StepZ.jpg b/buildroot/share/dwin/icons-7/073-ICON_StepZ.jpg index 78dce2a369..93434107e6 100644 Binary files a/buildroot/share/dwin/icons-7/073-ICON_StepZ.jpg and b/buildroot/share/dwin/icons-7/073-ICON_StepZ.jpg differ diff --git a/buildroot/share/dwin/icons-7/074-ICON_StepE.jpg b/buildroot/share/dwin/icons-7/074-ICON_StepE.jpg index 58eaff5650..9102da951d 100644 Binary files a/buildroot/share/dwin/icons-7/074-ICON_StepE.jpg and b/buildroot/share/dwin/icons-7/074-ICON_StepE.jpg differ diff --git a/buildroot/share/dwin/icons-7/075-ICON_Setspeed.jpg b/buildroot/share/dwin/icons-7/075-ICON_Setspeed.jpg index 94b808f716..a0d1568947 100644 Binary files a/buildroot/share/dwin/icons-7/075-ICON_Setspeed.jpg and b/buildroot/share/dwin/icons-7/075-ICON_Setspeed.jpg differ diff --git a/buildroot/share/dwin/icons-7/076-ICON_SetZOffset.jpg b/buildroot/share/dwin/icons-7/076-ICON_SetZOffset.jpg index 14aedc0dd0..e9851c75f8 100644 Binary files a/buildroot/share/dwin/icons-7/076-ICON_SetZOffset.jpg and b/buildroot/share/dwin/icons-7/076-ICON_SetZOffset.jpg differ diff --git a/buildroot/share/dwin/icons-7/078-ICON_BLTouch.jpg b/buildroot/share/dwin/icons-7/078-ICON_BLTouch.jpg index b3234d45aa..fa4b87b8a9 100644 Binary files a/buildroot/share/dwin/icons-7/078-ICON_BLTouch.jpg and b/buildroot/share/dwin/icons-7/078-ICON_BLTouch.jpg differ diff --git a/buildroot/share/dwin/icons-7/079-ICON_TempTooLow.jpg b/buildroot/share/dwin/icons-7/079-ICON_TempTooLow.jpg index c403c328f5..b4ba9b3af0 100644 Binary files a/buildroot/share/dwin/icons-7/079-ICON_TempTooLow.jpg and b/buildroot/share/dwin/icons-7/079-ICON_TempTooLow.jpg differ diff --git a/buildroot/share/dwin/icons-7/081-ICON_TempTooHigh.jpg b/buildroot/share/dwin/icons-7/081-ICON_TempTooHigh.jpg index 07aae4e5ec..61ca9f41d7 100644 Binary files a/buildroot/share/dwin/icons-7/081-ICON_TempTooHigh.jpg and b/buildroot/share/dwin/icons-7/081-ICON_TempTooHigh.jpg differ diff --git a/buildroot/share/dwin/icons-7/092-ICON_DegreesC.jpg b/buildroot/share/dwin/icons-7/092-ICON_DegreesC.jpg new file mode 100644 index 0000000000..a5622bf9be Binary files /dev/null and b/buildroot/share/dwin/icons-7/092-ICON_DegreesC.jpg differ diff --git a/buildroot/share/dwin/icons-7/093-ICON_Printer_0.jpg b/buildroot/share/dwin/icons-7/093-ICON_Printer_0.jpg new file mode 100644 index 0000000000..7175b7194e Binary files /dev/null and b/buildroot/share/dwin/icons-7/093-ICON_Printer_0.jpg differ diff --git a/buildroot/share/dwin/icons-7/200-ICON_Checkbox_F.jpg b/buildroot/share/dwin/icons-7/200-ICON_Checkbox_F.jpg new file mode 100644 index 0000000000..8c2c3481b8 Binary files /dev/null and b/buildroot/share/dwin/icons-7/200-ICON_Checkbox_F.jpg differ diff --git a/buildroot/share/dwin/icons-7/201-ICON_Checkbox_T.jpg b/buildroot/share/dwin/icons-7/201-ICON_Checkbox_T.jpg new file mode 100644 index 0000000000..4eabacad4d Binary files /dev/null and b/buildroot/share/dwin/icons-7/201-ICON_Checkbox_T.jpg differ diff --git a/buildroot/share/dwin/icons-7/202-ICON_Fade.jpg b/buildroot/share/dwin/icons-7/202-ICON_Fade.jpg new file mode 100644 index 0000000000..7d327ae9b9 Binary files /dev/null and b/buildroot/share/dwin/icons-7/202-ICON_Fade.jpg differ diff --git a/buildroot/share/dwin/icons-7/203-ICON_Mesh.jpg b/buildroot/share/dwin/icons-7/203-ICON_Mesh.jpg new file mode 100644 index 0000000000..65c94be0dd Binary files /dev/null and b/buildroot/share/dwin/icons-7/203-ICON_Mesh.jpg differ diff --git a/buildroot/share/dwin/icons-7/204-ICON_Tilt.jpg b/buildroot/share/dwin/icons-7/204-ICON_Tilt.jpg new file mode 100644 index 0000000000..a1689e05ea Binary files /dev/null and b/buildroot/share/dwin/icons-7/204-ICON_Tilt.jpg differ diff --git a/buildroot/share/dwin/icons-7/205-ICON_Brightness.jpg b/buildroot/share/dwin/icons-7/205-ICON_Brightness.jpg new file mode 100644 index 0000000000..22eda81168 Binary files /dev/null and b/buildroot/share/dwin/icons-7/205-ICON_Brightness.jpg differ diff --git a/buildroot/share/dwin/icons-7/206-ICON_Probe.jpg b/buildroot/share/dwin/icons-7/206-ICON_Probe.jpg new file mode 100644 index 0000000000..5de52da607 Binary files /dev/null and b/buildroot/share/dwin/icons-7/206-ICON_Probe.jpg differ diff --git a/buildroot/share/dwin/icons-7/249-ICON_AxisD.jpg b/buildroot/share/dwin/icons-7/249-ICON_AxisD.jpg new file mode 100644 index 0000000000..14730dfa42 Binary files /dev/null and b/buildroot/share/dwin/icons-7/249-ICON_AxisD.jpg differ diff --git a/buildroot/share/dwin/icons-7/250-ICON_AxisBR.jpg b/buildroot/share/dwin/icons-7/250-ICON_AxisBR.jpg new file mode 100644 index 0000000000..89d5ef05ce Binary files /dev/null and b/buildroot/share/dwin/icons-7/250-ICON_AxisBR.jpg differ diff --git a/buildroot/share/dwin/icons-7/251-ICON_AxisTR.jpg b/buildroot/share/dwin/icons-7/251-ICON_AxisTR.jpg new file mode 100644 index 0000000000..716b9f7314 Binary files /dev/null and b/buildroot/share/dwin/icons-7/251-ICON_AxisTR.jpg differ diff --git a/buildroot/share/dwin/icons-7/252-ICON_AxisBL.jpg b/buildroot/share/dwin/icons-7/252-ICON_AxisBL.jpg new file mode 100644 index 0000000000..c94915dd25 Binary files /dev/null and b/buildroot/share/dwin/icons-7/252-ICON_AxisBL.jpg differ diff --git a/buildroot/share/dwin/icons-7/253-ICON_AxisTL.jpg b/buildroot/share/dwin/icons-7/253-ICON_AxisTL.jpg new file mode 100644 index 0000000000..7fb5de6e9c Binary files /dev/null and b/buildroot/share/dwin/icons-7/253-ICON_AxisTL.jpg differ diff --git a/buildroot/share/dwin/icons-7/254-ICON_AxisC.jpg b/buildroot/share/dwin/icons-7/254-ICON_AxisC.jpg new file mode 100644 index 0000000000..3dd02c52b0 Binary files /dev/null and b/buildroot/share/dwin/icons-7/254-ICON_AxisC.jpg differ diff --git a/buildroot/share/extras/uncrustify.cfg b/buildroot/share/extras/uncrustify.cfg index f332d2daf4..73ccadc5e3 100644 --- a/buildroot/share/extras/uncrustify.cfg +++ b/buildroot/share/extras/uncrustify.cfg @@ -1014,7 +1014,7 @@ sp_cmt_cpp_region = ignore # ignore/add/remove/force/not_defined # If true, space added with sp_cmt_cpp_start will be added after Doxygen # sequences like '///', '///<', '//!' and '//!<'. -sp_cmt_cpp_doxygen = force # true/false +sp_cmt_cpp_doxygen = true # true/false # If true, space added with sp_cmt_cpp_start will be added after Qt translator # or meta-data comments like '//:', '//=', and '//~'. diff --git a/buildroot/share/git/mfhelp b/buildroot/share/git/mfhelp index 46a0ebfc53..aff34b866f 100755 --- a/buildroot/share/git/mfhelp +++ b/buildroot/share/git/mfhelp @@ -41,6 +41,6 @@ Modify Configuration.h / Configuration_adv.h: Modify pins files: pins_set ............. Set the value of a pin in a pins file - pinsformat.js ........ Node.js script to format pins files + pinsformat.py ........ Python script to format pins files THIS diff --git a/buildroot/share/scripts/get_test_targets.py b/buildroot/share/scripts/get_test_targets.py index f51951ae12..b187de9cac 100644 --- a/buildroot/share/scripts/get_test_targets.py +++ b/buildroot/share/scripts/get_test_targets.py @@ -5,7 +5,7 @@ Extract the builds used in Github CI, so that we can run them locally import yaml # Set the yaml file to parse -yaml_file = '.github/workflows/test-builds.yml' +yaml_file = '.github/workflows/ci-build-tests.yml' # Parse the yaml file, and load it into a dictionary (github_configuration) with open(yaml_file) as f: diff --git a/buildroot/share/scripts/pinsformat.js b/buildroot/share/scripts/pinsformat.js deleted file mode 100755 index 16e9dcb88f..0000000000 --- a/buildroot/share/scripts/pinsformat.js +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/bin/env node - -// -// Formatter script for pins_MYPINS.h files -// -// Usage: mffmt [infile] [outfile] -// -// With no parameters convert STDIN to STDOUT -// - -const fs = require("fs"); - -var do_log = false -function logmsg(msg, line='') { - if (do_log) console.log(msg, line); -} - -// String lpad / rpad -String.prototype.lpad = function(len, chr) { - if (!len) return this; - if (chr === undefined) chr = ' '; - var s = this+'', need = len - s.length; - if (need > 0) s = new Array(need+1).join(chr) + s; - return s; -}; - -String.prototype.rpad = function(len, chr) { - if (!len) return this; - if (chr === undefined) chr = ' '; - var s = this+'', need = len - s.length; - if (need > 0) s += new Array(need+1).join(chr); - return s; -}; - -// Concatenate a string, adding a space if necessary -// to avoid merging two words -String.prototype.concat_with_space = function(str) { - const c = this.substr(-1), d = str.charAt(0); - if (c !== ' ' && c !== '' && d !== ' ' && d !== '') - str = ' ' + str; - return this + str; -}; - -const mpatt = [ '-?\\d{1,3}', 'P[A-I]\\d+', 'P\\d_\\d+', 'Pin[A-Z]\\d\\b' ], - definePatt = new RegExp(`^\\s*(//)?#define\\s+[A-Z_][A-Z0-9_]+\\s+(${mpatt.join('|')})\\s*(//.*)?$`, 'gm'), - ppad = [ 3, 4, 5, 5 ], - col_comment = 50, - col_value_rj = col_comment - 3; - -var mexpr = []; -for (let m of mpatt) mexpr.push(new RegExp('^' + m + '$')); - -const argv = process.argv.slice(2), argc = argv.length; - -var src_file = 0, dst_file; -if (argc > 0) { - let ind = 0; - if (argv[0] == '-v') { do_log = true; ind++; } - dst_file = src_file = argv[ind++]; - if (ind < argc) dst_file = argv[ind]; -} - -// Read from file or STDIN until it terminates -const filtered = process_text(fs.readFileSync(src_file).toString()); -if (dst_file) - fs.writeFileSync(dst_file, filtered); -else - console.log(filtered); - -// Find the pin pattern so non-pin defines can be skipped -function get_pin_pattern(txt) { - var r, m = 0, match_count = [ 0, 0, 0, 0 ]; - var max_match_count = 0, max_match_index = -1; - definePatt.lastIndex = 0; - while ((r = definePatt.exec(txt)) !== null) { - let ind = -1; - if (mexpr.some((p) => { - ind++; - const didmatch = r[2].match(p); - return r[2].match(p); - }) ) { - const m = ++match_count[ind]; - if (m > max_match_count) { - max_match_count = m; - max_match_index = ind; - } - } - } - if (max_match_index === -1) return null; - - return { match:mpatt[max_match_index], pad:ppad[max_match_index] }; -} - -function process_text(txt) { - if (!txt.length) return '(no text)'; - const patt = get_pin_pattern(txt); - if (!patt) return txt; - const pindefPatt = new RegExp(`^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s+(${patt.match})\\s*(//.*)?$`), - noPinPatt = new RegExp(`^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s+(-1)\\s*(//.*)?$`), - skipPatt1 = new RegExp('^(\\s*(//)?#define)\\s+(AT90USB|USBCON|(BOARD|DAC|FLASH|HAS|IS|USE)_.+|.+_(ADDRESS|AVAILABLE|BAUDRATE|CLOCK|CONNECTION|DEFAULT|ERROR|EXTRUDERS|FREQ|ITEM|MKS_BASE_VERSION|MODULE|NAME|ONLY|ORIENTATION|PERIOD|RANGE|RATE|READ_RETRIES|SERIAL|SIZE|SPI|STATE|STEP|TIMER|VERSION))\\s+(.+)\\s*(//.*)?$'), - skipPatt2 = new RegExp('^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s+(0x[0-9A-Fa-f]+|\d+|.+[a-z].+)\\s*(//.*)?$'), - skipPatt3 = /^\s*#e(lse|ndif)\b.*$/, - aliasPatt = new RegExp('^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s+([A-Z_][A-Z0-9_()]+)\\s*(//.*)?$'), - switchPatt = new RegExp('^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s*(//.*)?$'), - undefPatt = new RegExp('^(\\s*(//)?#undef)\\s+([A-Z_][A-Z0-9_]+)\\s*(//.*)?$'), - defPatt = new RegExp('^(\\s*(//)?#define)\\s+([A-Z_][A-Z0-9_]+)\\s+([-_\\w]+)\\s*(//.*)?$'), - condPatt = new RegExp('^(\\s*(//)?#(if|ifn?def|elif)(\\s+\\S+)*)\\s+(//.*)$'), - commPatt = new RegExp('^\\s{20,}(//.*)?$'); - const col_value_lj = col_comment - patt.pad - 2; - var r, out = '', check_comment_next = false; - txt.split('\n').forEach((line) => { - if (check_comment_next) - check_comment_next = ((r = commPatt.exec(line)) !== null); - - if (check_comment_next) - // Comments in column 45 - line = ''.rpad(col_comment) + r[1]; - - else if (skipPatt1.exec(line) !== null) { - // - // #define SKIP_ME - // - logmsg("skip:", line); - } - else if ((r = pindefPatt.exec(line)) !== null) { - // - // #define MY_PIN [pin] - // - logmsg("pin:", line); - const pinnum = r[4].charAt(0) == 'P' ? r[4] : r[4].lpad(patt.pad); - line = r[1] + ' ' + r[3]; - line = line.rpad(col_value_lj).concat_with_space(pinnum); - if (r[5]) line = line.rpad(col_comment).concat_with_space(r[5]); - } - else if ((r = noPinPatt.exec(line)) !== null) { - // - // #define MY_PIN -1 - // - logmsg("pin -1:", line); - line = r[1] + ' ' + r[3]; - line = line.rpad(col_value_lj).concat_with_space('-1'); - if (r[5]) line = line.rpad(col_comment).concat_with_space(r[5]); - } - else if (skipPatt2.exec(line) !== null || skipPatt3.exec(line) !== null) { - // - // #define SKIP_ME - // #else, #endif - // - logmsg("skip:", line); - } - else if ((r = aliasPatt.exec(line)) !== null) { - // - // #define ALIAS OTHER - // - logmsg("alias:", line); - line = r[1] + ' ' + r[3]; - line = line.concat_with_space(r[4].lpad(col_value_rj + 1 - line.length)); - if (r[5]) line = line.rpad(col_comment).concat_with_space(r[5]); - } - else if ((r = switchPatt.exec(line)) !== null) { - // - // #define SWITCH - // - logmsg("switch:", line); - line = r[1] + ' ' + r[3]; - if (r[4]) line = line.rpad(col_comment).concat_with_space(r[4]); - check_comment_next = true; - } - else if ((r = defPatt.exec(line)) !== null) { - // - // #define ... - // - logmsg("def:", line); - line = r[1] + ' ' + r[3] + ' '; - line = line.concat_with_space(r[4].lpad(col_value_rj + 1 - line.length)); - if (r[5]) line = line.rpad(col_comment - 1) + ' ' + r[5]; - } - else if ((r = undefPatt.exec(line)) !== null) { - // - // #undef ... - // - logmsg("undef:", line); - line = r[1] + ' ' + r[3]; - if (r[4]) line = line.rpad(col_comment).concat_with_space(r[4]); - } - else if ((r = condPatt.exec(line)) !== null) { - // - // #if, #ifdef, #ifndef, #elif ... - // - logmsg("cond:", line); - line = r[1].rpad(col_comment).concat_with_space(r[5]); - check_comment_next = true; - } - out += line + '\n'; - }); - return out.replace(/\n\n+/g, '\n\n').replace(/\n\n$/g, '\n'); -} diff --git a/buildroot/share/scripts/pinsformat.py b/buildroot/share/scripts/pinsformat.py index b49ae4931d..7b041c86fc 100755 --- a/buildroot/share/scripts/pinsformat.py +++ b/buildroot/share/scripts/pinsformat.py @@ -27,6 +27,13 @@ def rpad(astr, fill, c=' '): need = fill - len(astr) return astr if need <= 0 else astr + (need * c) +# Concatenate a string, adding a space if necessary +# to avoid merging two words +def concat_with_space(s1, s2): + if not s1.endswith(' ') and not s2.startswith(' '): + s1 += ' ' + return s1 + s2 + # Pin patterns mpatt = [ r'-?\d{1,3}', r'P[A-I]\d+', r'P\d_\d+', r'Pin[A-Z]\d\b' ] mstr = '|'.join(mpatt) @@ -45,6 +52,7 @@ def format_pins(argv): scnt = 0 for arg in argv: if arg == '-v': + global do_log do_log = True elif scnt == 0: # Get a source file if specified. Default destination is the same file @@ -135,7 +143,7 @@ def process_text(txt): logmsg("pin:", line) pinnum = r[4] if r[4][0] == 'P' else lpad(r[4], patt['pad']) line = f'{r[1]} {r[3]}' - line = rpad(line, col_value_lj) + pinnum + line = concat_with_space(rpad(line, col_value_lj), pinnum) if r[5]: line = rpad(line, col_comment) + r[5] d['line'] = line return True @@ -149,7 +157,7 @@ def process_text(txt): if r == None: return False logmsg("pin -1:", line) line = f'{r[1]} {r[3]}' - line = rpad(line, col_value_lj) + '-1' + line = concat_with_space(rpad(line, col_value_lj), '-1') if r[5]: line = rpad(line, col_comment) + r[5] d['line'] = line return True @@ -179,8 +187,8 @@ def process_text(txt): if r == None: return False logmsg("alias:", line) line = f'{r[1]} {r[3]}' - line += lpad(r[4], col_value_rj + 1 - len(line)) - if r[5]: line = rpad(line, col_comment) + r[5] + line = concat_with_space(line, lpad(r[4], col_value_rj + 1 - len(line))) + if r[5]: line = concat_with_space(rpad(line, col_comment), r[5]) d['line'] = line return True @@ -193,7 +201,7 @@ def process_text(txt): if r == None: return False logmsg("switch:", line) line = f'{r[1]} {r[3]}' - if r[4]: line = rpad(line, col_comment) + r[4] + if r[4]: line = concat_with_space(rpad(line, col_comment), r[4]) d['line'] = line d['check_comment_next'] = True return True @@ -207,7 +215,7 @@ def process_text(txt): if r == None: return False logmsg("def:", line) line = f'{r[1]} {r[3]} ' - line += lpad(r[4], col_value_rj + 1 - len(line)) + line = concat_with_space(line, lpad(r[4], col_value_rj + 1 - len(line))) if r[5]: line = rpad(line, col_comment - 1) + ' ' + r[5] d['line'] = line return True @@ -221,7 +229,7 @@ def process_text(txt): if r == None: return False logmsg("undef:", line) line = f'{r[1]} {r[3]}' - if r[4]: line = rpad(line, col_comment) + r[4] + if r[4]: line = concat_with_space(rpad(line, col_comment), r[4]) d['line'] = line return True @@ -233,7 +241,7 @@ def process_text(txt): r = condPatt.match(line) if r == None: return False logmsg("cond:", line) - line = rpad(r[1], col_comment) + r[5] + line = concat_with_space(rpad(r[1], col_comment), r[5]) d['line'] = line d['check_comment_next'] = True return True @@ -263,7 +271,7 @@ def process_text(txt): elif tryUndef(wDict): pass #undef ... elif tryCond(wDict): pass #if|ifdef|ifndef|elif ... - out += wDict['line'] + '\n' + out += wDict['line'].rstrip() + '\n' return re.sub('\n\n$', '\n', re.sub(r'\n\n+', '\n\n', out)) diff --git a/buildroot/share/scripts/rle_compress_bitmap.py b/buildroot/share/scripts/rle_compress_bitmap.py index c3f673c616..12d25a7e4a 100755 --- a/buildroot/share/scripts/rle_compress_bitmap.py +++ b/buildroot/share/scripts/rle_compress_bitmap.py @@ -10,6 +10,8 @@ import sys,struct import re def addCompressedData(input_file, output_file): + input_lines = input_file.readlines() + input_file.close() ofile = open(output_file, 'wt') datatype = "uint8_t" @@ -18,8 +20,7 @@ def addCompressedData(input_file, output_file): arrname = '' c_data_section = False ; c_skip_data = False ; c_footer = False - while True: - line = input_file.readline() + for line in input_lines: if not line: break if not c_footer: @@ -56,8 +57,6 @@ def addCompressedData(input_file, output_file): arrname = line.split('[')[0].split(' ')[-1] print("Found data array", arrname) - input_file.close() - #print("\nRaw Bitmap Data", raw_data) # @@ -190,11 +189,11 @@ if len(sys.argv) <= 2: print('Usage: rle_compress_bitmap.py INPUT_FILE OUTPUT_FILE') exit(1) -output_cpp = sys.argv[2] +output_h = sys.argv[2] inname = sys.argv[1].replace('//', '/') try: - input_cpp = open(inname) + input_h = open(inname) print("Processing", inname, "...") - addCompressedData(input_cpp, output_cpp) + addCompressedData(input_h, output_h) except OSError: print("Can't find input file", inname) diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py index 9fb927c426..ae7f7e6261 100644 --- a/buildroot/share/scripts/upload.py +++ b/buildroot/share/scripts/upload.py @@ -157,14 +157,14 @@ def Upload(source, target, env): marlin_string_config_h_author = _GetMarlinEnv(MarlinEnv, 'STRING_CONFIG_H_AUTHOR') # Get firmware upload params - upload_firmware_source_name = env['PROGNAME'] + '.bin' if 'PROGNAME' in env else str(source[0]) + upload_firmware_source_path = os.path.join(env["PROJECT_BUILD_DIR"], env["PIOENV"], f"{env['PROGNAME']}.bin") if 'PROGNAME' in env else str(source[0]) # Source firmware filename upload_speed = env['UPLOAD_SPEED'] if 'UPLOAD_SPEED' in env else 115200 # baud rate of serial connection upload_port = _GetUploadPort(env) # Serial port to use # Set local upload params - upload_firmware_target_name = os.path.basename(upload_firmware_source_name) + upload_firmware_target_name = os.path.basename(upload_firmware_source_path) # Target firmware filename upload_timeout = 1000 # Communication timout, lossy/slow connections need higher values upload_blocksize = 512 # Transfer block size. 512 = Autodetect @@ -216,7 +216,7 @@ def Upload(source, target, env): print(f' LONG_FILENAME_WRITE_SUPPORT : {marlin_longname_write}') print(f' CUSTOM_FIRMWARE_UPLOAD : {marlin_custom_firmware_upload}') print('---- Upload parameters ------------------------') - print(f' Source : {upload_firmware_source_name}') + print(f' Source : {upload_firmware_source_path}') print(f' Target : {upload_firmware_target_name}') print(f' Port : {upload_port} @ {upload_speed} baudrate') print(f' Timeout : {upload_timeout}') @@ -271,14 +271,14 @@ def Upload(source, target, env): # WARNING! The serial port must be closed here because the serial transfer that follow needs it! # Upload firmware file - debugPrint(f"Copy '{upload_firmware_source_name}' --> '{upload_firmware_target_name}'") + debugPrint(f"Copy '{upload_firmware_source_path}' --> '{upload_firmware_target_name}'") protocol = MarlinBinaryProtocol.Protocol(upload_port, upload_speed, upload_blocksize, float(upload_error_ratio), int(upload_timeout)) #echologger = MarlinBinaryProtocol.EchoProtocol(protocol) protocol.connect() # Mark the rollback (delete broken transfer) from this point on rollback = True filetransfer = MarlinBinaryProtocol.FileTransferProtocol(protocol) - transferOK = filetransfer.copy(upload_firmware_source_name, upload_firmware_target_name, upload_compression, upload_test) + transferOK = filetransfer.copy(upload_firmware_source_path, upload_firmware_target_name, upload_compression, upload_test) protocol.disconnect() # Notify upload completed diff --git a/buildroot/share/vscode/avrdude.conf b/buildroot/share/vscode/avrdude.conf index 991d255750..a1a3ef4ba4 100644 --- a/buildroot/share/vscode/avrdude.conf +++ b/buildroot/share/vscode/avrdude.conf @@ -240,8 +240,8 @@ #define AT86RF401 0xD0 #define AT89START 0xE0 -#define AT89S51 0xE0 -#define AT89S52 0xE1 +#define AT89S51 0xE0 +#define AT89S52 0xE1 # The following table lists the devices in the original AVR910 # appnote: @@ -293,15 +293,15 @@ # in the Internet. These add the following codes (only devices that # actually exist are listed): -# ATmega8515 0x3A -# ATmega128 0x43 -# ATmega64 0x45 -# ATtiny26 0x5E -# ATmega8535 0x69 -# ATmega32 0x72 -# ATmega16 0x74 -# ATmega8 0x76 -# ATmega169 0x78 +# ATmega8515 0x3A +# ATmega128 0x43 +# ATmega64 0x45 +# ATtiny26 0x5E +# ATmega8535 0x69 +# ATmega32 0x72 +# ATmega16 0x74 +# ATmega8 0x76 +# ATmega169 0x78 # # Overall avrdude defaults @@ -894,63 +894,63 @@ programmer # This is an HVSP-only device. part - id = "t11"; - desc = "ATtiny11"; - stk500_devcode = 0x11; - signature = 0x1e 0x90 0x04; - chip_erase_delay = 20000; + id = "t11"; + desc = "ATtiny11"; + stk500_devcode = 0x11; + signature = 0x1e 0x90 0x04; + chip_erase_delay = 20000; - timeout = 200; - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, - 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, - 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 50; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; - programfusepolltimeout = 25; - programlockpolltimeout = 25; + timeout = 200; + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, + 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; - memory "eeprom" - size = 64; - blocksize = 64; - readsize = 256; - delay = 5; - ; + memory "eeprom" + size = 64; + blocksize = 64; + readsize = 256; + delay = 5; + ; - memory "flash" - size = 1024; - blocksize = 128; - readsize = 256; - delay = 3; - ; + memory "flash" + size = 1024; + blocksize = 128; + readsize = 256; + delay = 3; + ; - memory "signature" - size = 3; - ; + memory "signature" + size = 3; + ; - memory "lock" - size = 1; - ; + memory "lock" + size = 1; + ; - memory "calibration" - size = 1; - ; + memory "calibration" + size = 1; + ; - memory "fuse" - size = 1; - ; + memory "fuse" + size = 1; + ; ; #------------------------------------------------------------ @@ -958,132 +958,132 @@ part #------------------------------------------------------------ part - id = "t12"; - desc = "ATtiny12"; - stk500_devcode = 0x12; - avr910_devcode = 0x55; - signature = 0x1e 0x90 0x05; - chip_erase_delay = 20000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "t12"; + desc = "ATtiny12"; + stk500_devcode = 0x12; + avr910_devcode = 0x55; + signature = 0x1e 0x90 0x05; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, - 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, - 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 50; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; - programfusepolltimeout = 25; - programlockpolltimeout = 25; + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, + 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; - memory "eeprom" - size = 64; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 x x x x x x x x", - "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 64; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 x x x x x x x x", - "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; - mode = 0x04; - delay = 8; - blocksize = 64; - readsize = 256; - ; + mode = 0x04; + delay = 8; + blocksize = 64; + readsize = 256; + ; - memory "flash" - size = 1024; - min_write_delay = 4500; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + size = 1024; + min_write_delay = 4500; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - write_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 5; - blocksize = 128; - readsize = 256; - ; + mode = 0x04; + delay = 5; + blocksize = 128; + readsize = 256; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x x x x x x o o x"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "fuse" - size = 1; - read = "0 1 0 1 0 0 0 0 x x x x x x x x", - "x x x x x x x x o o o o o o o o"; + memory "fuse" + size = 1; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 x x x x x", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 x x x x x", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; ; #------------------------------------------------------------ @@ -1091,170 +1091,170 @@ part #------------------------------------------------------------ part - id = "t13"; - desc = "ATtiny13"; - has_debugwire = yes; - flash_instr = 0xB4, 0x0E, 0x1E; - eeprom_instr = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x0E, 0xB4, 0x0E, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; - stk500_devcode = 0x14; - signature = 0x1e 0x90 0x07; - chip_erase_delay = 4000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "t13"; + desc = "ATtiny13"; + has_debugwire = yes; + flash_instr = 0xB4, 0x0E, 0x1E; + eeprom_instr = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x0E, 0xB4, 0x0E, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; + stk500_devcode = 0x14; + signature = 0x1e 0x90 0x07; + chip_erase_delay = 4000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - hvsp_controlstack = + hvsp_controlstack = 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 90; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; - programfusepolltimeout = 25; - programlockpolltimeout = 25; + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 90; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; - memory "eeprom" - size = 64; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", - "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 64; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", - "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " x x a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 5; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 5; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 1024; - page_size = 32; - num_pages = 32; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 0 0 0 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 1024; + page_size = 32; + num_pages = 32; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 0 0 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 0 0 0 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 0 0 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 0 0 0 a8", - " a7 a6 a5 a4 x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 0 0 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 32; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "calibration" - size = 2; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 a0 o o o o o o o o"; - ; + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + ; ; @@ -1264,132 +1264,132 @@ part #------------------------------------------------------------ part - id = "t15"; - desc = "ATtiny15"; - stk500_devcode = 0x13; - avr910_devcode = 0x56; - signature = 0x1e 0x90 0x06; - chip_erase_delay = 8200; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "t15"; + desc = "ATtiny15"; + stk500_devcode = 0x13; + avr910_devcode = 0x56; + signature = 0x1e 0x90 0x06; + chip_erase_delay = 8200; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, - 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, - 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - hvspcmdexedelay = 5; - synchcycles = 6; - latchcycles = 16; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 50; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; - programfusepolltimeout = 25; - programlockpolltimeout = 25; + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, + 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + hvspcmdexedelay = 5; + synchcycles = 6; + latchcycles = 16; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; - memory "eeprom" - size = 64; - min_write_delay = 8200; - max_write_delay = 8200; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 x x x x x x x x", - "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 64; + min_write_delay = 8200; + max_write_delay = 8200; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 x x x x x x x x", - "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; - mode = 0x04; - delay = 10; - blocksize = 64; - readsize = 256; - ; + mode = 0x04; + delay = 10; + blocksize = 64; + readsize = 256; + ; - memory "flash" - size = 1024; - min_write_delay = 4100; - max_write_delay = 4100; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + size = 1024; + min_write_delay = 4100; + max_write_delay = 4100; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - write_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 5; - blocksize = 128; - readsize = 256; - ; + mode = 0x04; + delay = 5; + blocksize = 128; + readsize = 256; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x x x x x x o o x"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "fuse" - size = 1; - read = "0 1 0 1 0 0 0 0 x x x x x x x x", - "x x x x x x x x o o o o x x o o"; + memory "fuse" + size = 1; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x o o o o x x o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 x x x x x", - "x x x x x x x x i i i i 1 1 i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 x x x x x", + "x x x x x x x x i i i i 1 1 i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; ; #------------------------------------------------------------ @@ -1397,114 +1397,114 @@ part #------------------------------------------------------------ part - id = "1200"; - desc = "AT90S1200"; - stk500_devcode = 0x33; - avr910_devcode = 0x13; - signature = 0x1e 0x90 0x01; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 20000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "1200"; + desc = "AT90S1200"; + stk500_devcode = 0x33; + avr910_devcode = 0x13; + signature = 0x1e 0x90 0x01; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 1; - bytedelay = 0; - pollindex = 0; - pollvalue = 0xFF; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 1; + bytedelay = 0; + pollindex = 0; + pollvalue = 0xFF; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; - programlockpolltimeout = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; - memory "eeprom" - size = 64; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 x x x x x x x x", - "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 64; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 x x x x x x x x", - "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x x a5 a4 a3 a2 a1 a0 i i i i i i i i"; - mode = 0x04; - delay = 20; - blocksize = 32; - readsize = 256; - ; - memory "flash" - size = 1024; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x04; + delay = 20; + blocksize = 32; + readsize = 256; + ; + memory "flash" + size = 1024; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - write_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x02; - delay = 15; - blocksize = 128; - readsize = 256; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "fuse" - size = 1; - ; - memory "lock" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - ; + mode = 0x02; + delay = 15; + blocksize = 128; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + ; ; #------------------------------------------------------------ @@ -1512,112 +1512,112 @@ part #------------------------------------------------------------ part - id = "4414"; - desc = "AT90S4414"; - stk500_devcode = 0x50; - avr910_devcode = 0x28; - signature = 0x1e 0x92 0x01; - chip_erase_delay = 20000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "4414"; + desc = "AT90S4414"; + stk500_devcode = 0x50; + avr910_devcode = 0x28; + signature = 0x1e 0x92 0x01; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; - programlockpolltimeout = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; - memory "eeprom" - size = 256; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x80; - readback_p2 = 0x7f; - read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 256; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x80; + readback_p2 = 0x7f; + read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 64; - readsize = 256; - ; - memory "flash" - size = 4096; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x7f; - readback_p2 = 0x7f; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; + memory "flash" + size = 4096; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x7f; + readback_p2 = 0x7f; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write_lo = " 0 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - write_hi = " 0 1 0 0 1 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 64; - readsize = 256; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "fuse" - size = 1; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + min_write_delay = 9000; + max_write_delay = 9000; + ; ; #------------------------------------------------------------ @@ -1625,112 +1625,112 @@ part #------------------------------------------------------------ part - id = "2313"; - desc = "AT90S2313"; - stk500_devcode = 0x40; - avr910_devcode = 0x20; - signature = 0x1e 0x91 0x01; - chip_erase_delay = 20000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "2313"; + desc = "AT90S2313"; + stk500_devcode = 0x40; + avr910_devcode = 0x20; + signature = 0x1e 0x91 0x01; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; - programlockpolltimeout = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; - memory "eeprom" - size = 128; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0x80; - readback_p2 = 0x7f; - read = "1 0 1 0 0 0 0 0 x x x x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 128; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x80; + readback_p2 = 0x7f; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 x x x x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 64; - readsize = 256; - ; - memory "flash" - size = 2048; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0x7f; - readback_p2 = 0x7f; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; + memory "flash" + size = 2048; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x7f; + readback_p2 = 0x7f; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - write_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "fuse" - size = 1; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x i i x", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x i i x", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; ; #------------------------------------------------------------ @@ -1738,126 +1738,126 @@ part #------------------------------------------------------------ part - id = "2333"; + id = "2333"; ##### WARNING: No XML file for device 'AT90S2333'! ##### - desc = "AT90S2333"; - stk500_devcode = 0x42; - avr910_devcode = 0x34; - signature = 0x1e 0x91 0x05; - chip_erase_delay = 20000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + desc = "AT90S2333"; + stk500_devcode = 0x42; + avr910_devcode = 0x34; + signature = 0x1e 0x91 0x05; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; - programlockpolltimeout = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; - memory "eeprom" - size = 128; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x00; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 x x x x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 128; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 x x x x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; - memory "flash" - size = 2048; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + size = 2048; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - write_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "fuse" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - pwroff_after_write = yes; - read = "0 1 0 1 0 0 0 0 x x x x x x x x", - "x x x x x x x x x x o o o o o o"; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + pwroff_after_write = yes; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", - "x x x x x x x x x x x x x x x x"; - ; - memory "lock" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x x x x x x o o x"; + write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", + "x x x x x x x x x x x x x x x x"; + ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + ; ; @@ -1866,122 +1866,122 @@ part #------------------------------------------------------------ part - id = "2343"; - desc = "AT90S2343"; - stk500_devcode = 0x43; - avr910_devcode = 0x4c; - signature = 0x1e 0x91 0x03; - chip_erase_delay = 18000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "2343"; + desc = "AT90S2343"; + stk500_devcode = 0x43; + avr910_devcode = 0x4c; + signature = 0x1e 0x91 0x03; + chip_erase_delay = 18000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, - 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, - 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 0; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 50; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; - programfusepolltimeout = 25; - programlockpolltimeout = 25; + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x00, + 0x68, 0x78, 0x68, 0x68, 0x00, 0x00, 0x68, 0x78, + 0x78, 0x00, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 0; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 50; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; - memory "eeprom" - size = 128; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x00; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0", - "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 128; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0", - "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 64; - readsize = 256; - ; - memory "flash" - size = 2048; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; + memory "flash" + size = 2048; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - write_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 128; - readsize = 128; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "fuse" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x o o o x x x x o"; + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 128; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x o o o x x x x o"; - write = "1 0 1 0 1 1 0 0 1 0 1 1 1 1 1 i", - "x x x x x x x x x x x x x x x x"; - ; - memory "lock" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x o o o x x x x o"; + write = "1 0 1 0 1 1 0 0 1 0 1 1 1 1 1 i", + "x x x x x x x x x x x x x x x x"; + ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x o o o x x x x o"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + ; ; @@ -1990,123 +1990,123 @@ part #------------------------------------------------------------ part - id = "4433"; - desc = "AT90S4433"; - stk500_devcode = 0x51; - avr910_devcode = 0x30; - signature = 0x1e 0x92 0x03; - chip_erase_delay = 20000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "4433"; + desc = "AT90S4433"; + stk500_devcode = 0x51; + avr910_devcode = 0x30; + signature = 0x1e 0x92 0x03; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; - programlockpolltimeout = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; - memory "eeprom" - size = 256; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x00; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0 x x x x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 256; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0 x x x x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; - memory "flash" - size = 4096; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "flash" + size = 4096; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write_lo = " 0 1 0 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - write_hi = " 0 1 0 0 1 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "fuse" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - pwroff_after_write = yes; - read = "0 1 0 1 0 0 0 0 x x x x x x x x", - "x x x x x x x x x x o o o o o o"; + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + pwroff_after_write = yes; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", - "x x x x x x x x x x x x x x x x"; - ; - memory "lock" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x x x x x x o o x"; + write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", + "x x x x x x x x x x x x x x x x"; + ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + ; ; #------------------------------------------------------------ @@ -2114,82 +2114,82 @@ part #------------------------------------------------------------ part - id = "4434"; + id = "4434"; ##### WARNING: No XML file for device 'AT90S4434'! ##### - desc = "AT90S4434"; - stk500_devcode = 0x52; - avr910_devcode = 0x6c; - signature = 0x1e 0x92 0x02; - chip_erase_delay = 20000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + desc = "AT90S4434"; + stk500_devcode = 0x52; + avr910_devcode = 0x6c; + signature = 0x1e 0x92 0x02; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - memory "eeprom" - size = 256; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x00; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0 x x x x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 256; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0 x x x x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - ; - memory "flash" - size = 4096; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + write = " 1 1 0 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + ; + memory "flash" + size = 4096; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write_lo = " 0 1 0 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - write_hi = " 0 1 0 0 1 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "fuse" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - read = "0 1 0 1 0 0 0 0 x x x x x x x x", - "x x x x x x x x x x o o o o o o"; + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", - "x x x x x x x x x x x x x x x x"; - ; - memory "lock" - size = 1; - min_write_delay = 9000; - max_write_delay = 20000; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x x x x x x o o x"; + write = "1 0 1 0 1 1 0 0 1 0 1 i i i i i", + "x x x x x x x x x x x x x x x x"; + ; + memory "lock" + size = 1; + min_write_delay = 9000; + max_write_delay = 20000; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + ; ; #------------------------------------------------------------ @@ -2197,113 +2197,113 @@ part #------------------------------------------------------------ part - id = "8515"; - desc = "AT90S8515"; - stk500_devcode = 0x60; - avr910_devcode = 0x38; - signature = 0x1e 0x93 0x01; - chip_erase_delay = 20000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "8515"; + desc = "AT90S8515"; + stk500_devcode = 0x60; + avr910_devcode = 0x38; + signature = 0x1e 0x93 0x01; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = + pp_controlstack = 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; - programlockpolltimeout = 1; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; - memory "eeprom" - size = 512; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0x80; - readback_p2 = 0x7f; - read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 512; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x80; + readback_p2 = 0x7f; + read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; - memory "flash" - size = 8192; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0x7f; - readback_p2 = 0x7f; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "flash" + size = 8192; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x7f; + readback_p2 = 0x7f; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write_lo = " 0 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - write_hi = " 0 1 0 0 1 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "fuse" - size = 1; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + min_write_delay = 9000; + max_write_delay = 9000; + ; ; #------------------------------------------------------------ @@ -2311,120 +2311,120 @@ part #------------------------------------------------------------ part - id = "8535"; - desc = "AT90S8535"; - stk500_devcode = 0x61; - avr910_devcode = 0x68; - signature = 0x1e 0x93 0x03; - chip_erase_delay = 20000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "8535"; + desc = "AT90S8535"; + stk500_devcode = 0x61; + avr910_devcode = 0x68; + signature = 0x1e 0x93 0x03; + chip_erase_delay = 20000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; - programlockpolltimeout = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 1; - memory "eeprom" - size = 512; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0x00; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 512; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0x00; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; - memory "flash" - size = 8192; - min_write_delay = 9000; - max_write_delay = 20000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "flash" + size = 8192; + min_write_delay = 9000; + max_write_delay = 20000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write_lo = " 0 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_lo = " 0 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - write_hi = " 0 1 0 0 1 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write_hi = " 0 1 0 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 128; - readsize = 256; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "fuse" - size = 1; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", + mode = 0x04; + delay = 12; + blocksize = 128; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "fuse" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", "x x x x x x x x x x x x x x x o"; - write = "1 0 1 0 1 1 0 0 1 0 1 1 1 1 1 i", + write = "1 0 1 0 1 1 0 0 1 0 1 1 1 1 1 i", "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", + min_write_delay = 9000; + max_write_delay = 9000; + ; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", "x x x x x x x x o o x x x x x x"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + min_write_delay = 9000; + max_write_delay = 9000; + ; ; #------------------------------------------------------------ @@ -2432,138 +2432,138 @@ part #------------------------------------------------------------ part - id = "m103"; - desc = "ATMEGA103"; - stk500_devcode = 0xB1; - avr910_devcode = 0x41; - signature = 0x1e 0x97 0x01; - chip_erase_delay = 112000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m103"; + desc = "ATMEGA103"; + stk500_devcode = 0xB1; + avr910_devcode = 0x41; + signature = 0x1e 0x97 0x01; + chip_erase_delay = 112000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x8E, 0x9E, 0x2E, 0x3E, 0xAE, 0xBE, - 0x4E, 0x5E, 0xCE, 0xDE, 0x6E, 0x7E, 0xEE, 0xDE, - 0x66, 0x76, 0xE6, 0xF6, 0x6A, 0x7A, 0xEA, 0x7A, - 0x7F, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 15; - chiperasepolltimeout = 0; - programfusepulsewidth = 2; - programfusepolltimeout = 0; - programlockpulsewidth = 0; - programlockpolltimeout = 10; + pp_controlstack = + 0x0E, 0x1E, 0x8E, 0x9E, 0x2E, 0x3E, 0xAE, 0xBE, + 0x4E, 0x5E, 0xCE, 0xDE, 0x6E, 0x7E, 0xEE, 0xDE, + 0x66, 0x76, 0xE6, 0xF6, 0x6A, 0x7A, 0xEA, 0x7A, + 0x7F, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 15; + chiperasepolltimeout = 0; + programfusepulsewidth = 2; + programfusepolltimeout = 0; + programlockpulsewidth = 0; + programlockpolltimeout = 10; - memory "eeprom" - size = 4096; - min_write_delay = 4000; - max_write_delay = 9000; - readback_p1 = 0x80; - readback_p2 = 0x7f; + memory "eeprom" + size = 4096; + min_write_delay = 4000; + max_write_delay = 9000; + readback_p1 = 0x80; + readback_p2 = 0x7f; read = " 1 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 64; - readsize = 256; - ; + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 22000; - max_write_delay = 56000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 22000; + max_write_delay = 56000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x11; - delay = 70; - blocksize = 256; - readsize = 256; - ; + mode = 0x11; + delay = 70; + blocksize = 256; + readsize = 256; + ; - memory "fuse" - size = 1; - read = "0 1 0 1 0 0 0 0 x x x x x x x x", - "x x x x x x x x x x o x o 1 o o"; + memory "fuse" + size = 1; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x x x o x o 1 o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 1 i 1 i i", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 1 i 1 i i", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x x x x x x o o x"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x o o x"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 i i 1", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; @@ -2572,177 +2572,177 @@ part #------------------------------------------------------------ part - id = "m64"; - desc = "ATMEGA64"; - has_jtag = yes; - stk500_devcode = 0xA0; - avr910_devcode = 0x45; - signature = 0x1e 0x96 0x02; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m64"; + desc = "ATMEGA64"; + has_jtag = yes; + stk500_devcode = 0xA0; + avr910_devcode = 0x45; + signature = 0x1e 0x96 0x02; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x22; - spmcr = 0x68; - allowfullpagebitstream = yes; + idr = 0x22; + spmcr = 0x68; + allowfullpagebitstream = yes; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 2048; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 20; - blocksize = 64; - readsize = 256; - ; + mode = 0x04; + delay = 20; + blocksize = 64; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 6; - blocksize = 128; - readsize = 256; - ; + mode = 0x21; + delay = 6; + blocksize = 128; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 4; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; @@ -2753,177 +2753,177 @@ part #------------------------------------------------------------ part - id = "m128"; - desc = "ATMEGA128"; - has_jtag = yes; - stk500_devcode = 0xB2; - avr910_devcode = 0x43; - signature = 0x1e 0x97 0x02; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m128"; + desc = "ATMEGA128"; + has_jtag = yes; + stk500_devcode = 0xB2; + avr910_devcode = 0x43; + signature = 0x1e 0x97 0x02; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x22; - spmcr = 0x68; - rampz = 0x3b; - allowfullpagebitstream = yes; + idr = 0x22; + spmcr = 0x68; + rampz = 0x3b; + allowfullpagebitstream = yes; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 12; - blocksize = 64; - readsize = 256; - ; + mode = 0x04; + delay = 12; + blocksize = 64; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 6; - blocksize = 128; - readsize = 256; - ; + mode = 0x21; + delay = 6; + blocksize = 128; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 4; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -2931,189 +2931,189 @@ part #------------------------------------------------------------ part - id = "c128"; - desc = "AT90CAN128"; - has_jtag = yes; - stk500_devcode = 0xB3; + id = "c128"; + desc = "AT90CAN128"; + has_jtag = yes; + stk500_devcode = 0xB3; # avr910_devcode = 0x43; - signature = 0x1e 0x97 0x81; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + signature = 0x1e 0x97 0x81; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - eecr = 0x3f; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + eecr = 0x3f; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 0 x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 0 x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 0 x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 0 x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x a11 a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x i i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -3121,189 +3121,189 @@ part #------------------------------------------------------------ part - id = "c64"; - desc = "AT90CAN64"; - has_jtag = yes; - stk500_devcode = 0xB3; + id = "c64"; + desc = "AT90CAN64"; + has_jtag = yes; + stk500_devcode = 0xB3; # avr910_devcode = 0x43; - signature = 0x1e 0x96 0x81; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + signature = 0x1e 0x96 0x81; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - eecr = 0x3f; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + eecr = 0x3f; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 2048; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 0 x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 0 x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 0 x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 0 x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x i i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -3311,189 +3311,189 @@ part #------------------------------------------------------------ part - id = "c32"; - desc = "AT90CAN32"; - has_jtag = yes; - stk500_devcode = 0xB3; + id = "c32"; + desc = "AT90CAN32"; + has_jtag = yes; + stk500_devcode = 0xB3; # avr910_devcode = 0x43; - signature = 0x1e 0x95 0x81; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + signature = 0x1e 0x95 0x81; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - eecr = 0x3f; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + eecr = 0x3f; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 1024; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 0 x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 0 x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 0 x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 0 x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 32768; - page_size = 256; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 32768; + page_size = 256; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x i i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; @@ -3502,174 +3502,174 @@ part #------------------------------------------------------------ part - id = "m16"; - desc = "ATMEGA16"; - has_jtag = yes; - stk500_devcode = 0x82; - avr910_devcode = 0x74; - signature = 0x1e 0x94 0x03; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m16"; + desc = "ATMEGA16"; + has_jtag = yes; + stk500_devcode = 0x82; + avr910_devcode = 0x74; + signature = 0x1e 0x94 0x03; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = + pp_controlstack = 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 100; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + hventerstabdelay = 100; + progmodedelay = 100; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = yes; + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = yes; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 512; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x a9 a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x04; - delay = 10; - blocksize = 128; - readsize = 256; - ; + mode = 0x04; + delay = 10; + blocksize = 128; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 6; - blocksize = 128; - readsize = 256; - ; + mode = 0x21; + delay = 6; + blocksize = 128; + readsize = 256; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "calibration" - size = 4; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "calibration" + size = 4; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; ; @@ -3680,187 +3680,187 @@ part # close to ATmega16 part - id = "m164p"; - desc = "ATMEGA164P"; - has_jtag = yes; - stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one - avr910_devcode = 0x74; - signature = 0x1e 0x94 0x0a; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m164p"; + desc = "ATMEGA164P"; + has_jtag = yes; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + signature = 0x1e 0x94 0x0a; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 512; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x a9 a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 6; - blocksize = 128; - readsize = 256; - ; + mode = 0x21; + delay = 6; + blocksize = 128; + readsize = 256; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; + memory "efuse" + size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x 1 1 1 1 1 i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; + memory "calibration" + size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; @@ -3871,187 +3871,187 @@ part # similar to ATmega164P part - id = "m324p"; - desc = "ATMEGA324P"; - has_jtag = yes; - stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one - avr910_devcode = 0x74; - signature = 0x1e 0x95 0x08; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m324p"; + desc = "ATMEGA324P"; + has_jtag = yes; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + signature = 0x1e 0x95 0x08; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 1024; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x a10 a9 a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x21; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; + memory "efuse" + size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x 1 1 1 1 1 i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; + memory "calibration" + size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; @@ -4062,187 +4062,187 @@ part # similar to ATmega164 part - id = "m644"; - desc = "ATMEGA644"; - has_jtag = yes; - stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one - avr910_devcode = 0x74; - signature = 0x1e 0x96 0x09; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m644"; + desc = "ATMEGA644"; + has_jtag = yes; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + signature = 0x1e 0x96 0x09; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 2048; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x a11 a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x21; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; + memory "efuse" + size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x 1 1 1 1 1 i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; + memory "calibration" + size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -4252,187 +4252,187 @@ part # similar to ATmega164p part - id = "m644p"; - desc = "ATMEGA644P"; - has_jtag = yes; - stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one - avr910_devcode = 0x74; - signature = 0x1e 0x96 0x0a; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m644p"; + desc = "ATMEGA644P"; + has_jtag = yes; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + signature = 0x1e 0x96 0x0a; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 2048; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x a11 a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x21; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; + memory "efuse" + size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x 1 1 1 1 1 i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; + memory "calibration" + size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; @@ -4444,187 +4444,187 @@ part # similar to ATmega164p part - id = "m1284p"; - desc = "ATMEGA1284P"; - has_jtag = yes; - stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one - avr910_devcode = 0x74; - signature = 0x1e 0x97 0x05; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m1284p"; + desc = "ATMEGA1284P"; + has_jtag = yes; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + signature = 0x1e 0x97 0x05; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x a11 a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 256; + readsize = 256; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; + memory "efuse" + size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x 1 1 1 1 1 i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; + memory "calibration" + size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; @@ -4634,193 +4634,193 @@ part #------------------------------------------------------------ part - id = "m162"; - desc = "ATMEGA162"; - has_jtag = yes; - stk500_devcode = 0x83; - avr910_devcode = 0x63; - signature = 0x1e 0x94 0x04; - chip_erase_delay = 9000; - pagel = 0xd7; - bs2 = 0xa0; + id = "m162"; + desc = "ATMEGA162"; + has_jtag = yes; + stk500_devcode = 0x83; + avr910_devcode = 0x63; + signature = 0x1e 0x94 0x04; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; - idr = 0x04; - spmcr = 0x57; - allowfullpagebitstream = yes; + idr = 0x04; + spmcr = 0x57; + allowfullpagebitstream = yes; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; - ; + ; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 512; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x a9 a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 16000; - max_write_delay = 16000; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 16000; - max_write_delay = 16000; + memory "hfuse" + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - min_write_delay = 16000; - max_write_delay = 16000; + memory "efuse" + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x 1 1 1 1 1 i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 16000; - max_write_delay = 16000; + memory "lock" + size = 1; + min_write_delay = 16000; + max_write_delay = 16000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "signature" - size = 3; + memory "signature" + size = 3; - read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; + memory "calibration" + size = 1; - read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; @@ -4830,157 +4830,157 @@ part #------------------------------------------------------------ part - id = "m163"; - desc = "ATMEGA163"; - stk500_devcode = 0x81; - avr910_devcode = 0x64; - signature = 0x1e 0x94 0x02; - chip_erase_delay = 32000; - pagel = 0xd7; - bs2 = 0xa0; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m163"; + desc = "ATMEGA163"; + stk500_devcode = 0x81; + avr910_devcode = 0x64; + signature = 0x1e 0x94 0x02; + chip_erase_delay = 32000; + pagel = 0xd7; + bs2 = 0xa0; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 30; - programfusepulsewidth = 0; - programfusepolltimeout = 2; - programlockpulsewidth = 0; - programlockpolltimeout = 2; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 30; + programfusepulsewidth = 0; + programfusepolltimeout = 2; + programlockpulsewidth = 0; + programlockpolltimeout = 2; memory "eeprom" - size = 512; - min_write_delay = 4000; - max_write_delay = 4000; - readback_p1 = 0xff; - readback_p2 = 0xff; + size = 512; + min_write_delay = 4000; + max_write_delay = 4000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 16000; - max_write_delay = 16000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 16000; + max_write_delay = 16000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x11; - delay = 20; - blocksize = 128; - readsize = 256; - ; + mode = 0x11; + delay = 20; + blocksize = 128; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o x x o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o x x o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i 1 1 i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i 1 1 i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x 1 o o o"; + memory "hfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x 1 o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x 1 1 1 1 1 i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x 0 x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x 0 x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -4988,179 +4988,179 @@ part #------------------------------------------------------------ part - id = "m169"; - desc = "ATMEGA169"; - has_jtag = yes; - stk500_devcode = 0x85; - avr910_devcode = 0x78; - signature = 0x1e 0x94 0x05; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m169"; + desc = "ATMEGA169"; + has_jtag = yes; + stk500_devcode = 0x85; + avr910_devcode = 0x78; + signature = 0x1e 0x94 0x05; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; + idr = 0x31; + spmcr = 0x57; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 512; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x i i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + ; - memory "lock" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -5168,182 +5168,182 @@ part #------------------------------------------------------------ part - id = "m329"; - desc = "ATMEGA329"; - has_jtag = yes; + id = "m329"; + desc = "ATMEGA329"; + has_jtag = yes; # stk500_devcode = 0x85; # no STK500 support, only STK500v2 # avr910_devcode = 0x?; # try the ATmega169 one: - avr910_devcode = 0x75; - signature = 0x1e 0x95 0x03; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + avr910_devcode = 0x75; + signature = 0x1e 0x95 0x03; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; + idr = 0x31; + spmcr = 0x57; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 1024; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x a9 a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -5352,182 +5352,182 @@ part # Identical to ATmega329 except of the signature part - id = "m329p"; - desc = "ATMEGA329P"; - has_jtag = yes; + id = "m329p"; + desc = "ATMEGA329P"; + has_jtag = yes; # stk500_devcode = 0x85; # no STK500 support, only STK500v2 # avr910_devcode = 0x?; # try the ATmega169 one: - avr910_devcode = 0x75; - signature = 0x1e 0x95 0x0b; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + avr910_devcode = 0x75; + signature = 0x1e 0x95 0x0b; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; + idr = 0x31; + spmcr = 0x57; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 1024; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x a9 a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -5537,182 +5537,182 @@ part # identical to ATmega329 part - id = "m3290"; - desc = "ATMEGA3290"; - has_jtag = yes; + id = "m3290"; + desc = "ATMEGA3290"; + has_jtag = yes; # stk500_devcode = 0x85; # no STK500 support, only STK500v2 # avr910_devcode = 0x?; # try the ATmega169 one: - avr910_devcode = 0x75; - signature = 0x1e 0x95 0x04; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + avr910_devcode = 0x75; + signature = 0x1e 0x95 0x04; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; + idr = 0x31; + spmcr = 0x57; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 1024; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x a9 a8", " a7 a6 a5 a4 a3 a3 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -5722,182 +5722,182 @@ part # identical to ATmega3290 except of the signature part - id = "m3290p"; - desc = "ATMEGA3290P"; - has_jtag = yes; + id = "m3290p"; + desc = "ATMEGA3290P"; + has_jtag = yes; # stk500_devcode = 0x85; # no STK500 support, only STK500v2 # avr910_devcode = 0x?; # try the ATmega169 one: - avr910_devcode = 0x75; - signature = 0x1e 0x95 0x0c; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + avr910_devcode = 0x75; + signature = 0x1e 0x95 0x0c; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; + idr = 0x31; + spmcr = 0x57; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 1024; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x a9 a8", " a7 a6 a5 a4 a3 a3 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -5905,182 +5905,182 @@ part #------------------------------------------------------------ part - id = "m649"; - desc = "ATMEGA649"; - has_jtag = yes; + id = "m649"; + desc = "ATMEGA649"; + has_jtag = yes; # stk500_devcode = 0x85; # no STK500 support, only STK500v2 # avr910_devcode = 0x?; # try the ATmega169 one: - avr910_devcode = 0x75; - signature = 0x1e 0x96 0x03; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + avr910_devcode = 0x75; + signature = 0x1e 0x96 0x03; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; + idr = 0x31; + spmcr = 0x57; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 2048; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -6090,192 +6090,192 @@ part # identical to ATmega649 part - id = "m6490"; - desc = "ATMEGA6490"; - has_jtag = yes; + id = "m6490"; + desc = "ATMEGA6490"; + has_jtag = yes; # stk500_devcode = 0x85; # no STK500 support, only STK500v2 # avr910_devcode = 0x?; # try the ATmega169 one: - avr910_devcode = 0x75; - signature = 0x1e 0x96 0x04; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + avr910_devcode = 0x75; + signature = 0x1e 0x96 0x04; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; + idr = 0x31; + spmcr = 0x57; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 2048; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -6283,174 +6283,174 @@ part #------------------------------------------------------------ part - id = "m32"; - desc = "ATMEGA32"; - has_jtag = yes; - stk500_devcode = 0x91; - avr910_devcode = 0x72; - signature = 0x1e 0x95 0x02; - chip_erase_delay = 9000; - pagel = 0xd7; - bs2 = 0xa0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m32"; + desc = "ATMEGA32"; + has_jtag = yes; + stk500_devcode = 0x91; + avr910_devcode = 0x72; + signature = 0x1e 0x95 0x02; + chip_erase_delay = 9000; + pagel = 0xd7; + bs2 = 0xa0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = yes; + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = yes; memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 1024; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x a9 a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x04; - delay = 10; - blocksize = 64; - readsize = 256; - ; + mode = 0x04; + delay = 10; + blocksize = 64; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 6; - blocksize = 64; - readsize = 256; - ; + mode = 0x21; + delay = 6; + blocksize = 64; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 4; - read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -6458,138 +6458,138 @@ part #------------------------------------------------------------ part - id = "m161"; - desc = "ATMEGA161"; - stk500_devcode = 0x80; - avr910_devcode = 0x60; - signature = 0x1e 0x94 0x01; - chip_erase_delay = 28000; - pagel = 0xd7; - bs2 = 0xa0; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m161"; + desc = "ATMEGA161"; + stk500_devcode = 0x80; + avr910_devcode = 0x60; + signature = 0x1e 0x94 0x01; + chip_erase_delay = 28000; + pagel = 0xd7; + bs2 = 0xa0; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 0; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 30; - programfusepulsewidth = 0; - programfusepolltimeout = 2; - programlockpulsewidth = 0; - programlockpolltimeout = 2; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 30; + programfusepulsewidth = 0; + programfusepolltimeout = 2; + programlockpulsewidth = 0; + programlockpolltimeout = 2; memory "eeprom" - size = 512; - min_write_delay = 3400; - max_write_delay = 3400; - readback_p1 = 0xff; - readback_p2 = 0xff; + size = 512; + min_write_delay = 3400; + max_write_delay = 3400; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " x x x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " x x x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 5; - blocksize = 128; - readsize = 256; - ; + mode = 0x04; + delay = 5; + blocksize = 128; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 14000; - max_write_delay = 14000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 14000; + max_write_delay = 14000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 16; - blocksize = 128; - readsize = 256; - ; + mode = 0x21; + delay = 16; + blocksize = 128; + readsize = 256; + ; - memory "fuse" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 0 0 0 0 x x x x x x x x", - "x x x x x x x x x o x o o o o o"; + memory "fuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 x x x x x x x x", + "x x x x x x x x x o x o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 x x x x x", - "x x x x x x x x 1 i 1 i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 x x x x x", + "x x x x x x x x 1 i 1 i i i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; @@ -6598,158 +6598,158 @@ part #------------------------------------------------------------ part - id = "m8"; - desc = "ATMEGA8"; - stk500_devcode = 0x70; - avr910_devcode = 0x76; - signature = 0x1e 0x93 0x07; - pagel = 0xd7; - bs2 = 0xc2; - chip_erase_delay = 10000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m8"; + desc = "ATMEGA8"; + stk500_devcode = 0x70; + avr910_devcode = 0x76; + signature = 0x1e 0x93 0x07; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 10000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = + pp_controlstack = 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 2; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - size = 512; - page_size = 4; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + size = 512; + page_size = 4; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 20; - blocksize = 128; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x04; + delay = 20; + blocksize = 128; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 0 x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 0 x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 10; - blocksize = 64; - readsize = 256; - ; + mode = 0x21; + delay = 10; + blocksize = 64; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "calibration" - size = 4; - read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; @@ -6759,154 +6759,154 @@ part #------------------------------------------------------------ part - id = "m8515"; - desc = "ATMEGA8515"; - stk500_devcode = 0x63; - avr910_devcode = 0x3A; - signature = 0x1e 0x93 0x06; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m8515"; + desc = "ATMEGA8515"; + stk500_devcode = 0x63; + avr910_devcode = 0x3A; + signature = 0x1e 0x93 0x06; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - size = 512; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 10; - blocksize = 128; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x04; + delay = 10; + blocksize = 128; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 0 x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 0 x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 6; - blocksize = 64; - readsize = 256; - ; + mode = 0x21; + delay = 6; + blocksize = 64; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "calibration" - size = 4; - read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; @@ -6917,156 +6917,156 @@ part #------------------------------------------------------------ part - id = "m8535"; - desc = "ATMEGA8535"; - stk500_devcode = 0x64; - avr910_devcode = 0x69; - signature = 0x1e 0x93 0x08; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m8535"; + desc = "ATMEGA8535"; + stk500_devcode = 0x64; + avr910_devcode = 0x69; + signature = 0x1e 0x93 0x08; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - size = 512; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + size = 512; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 x x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 x x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - mode = 0x04; - delay = 10; - blocksize = 128; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x04; + delay = 10; + blocksize = 128; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 0 x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 0 x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 6; - blocksize = 64; - readsize = 256; - ; + mode = 0x21; + delay = 6; + blocksize = 64; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 2000; - max_write_delay = 2000; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 2000; + max_write_delay = 2000; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "calibration" - size = 4; - read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 0 0 x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; @@ -7075,153 +7075,153 @@ part #------------------------------------------------------------ part - id = "t26"; - desc = "ATTINY26"; - stk500_devcode = 0x21; - avr910_devcode = 0x5e; - signature = 0x1e 0x91 0x09; - pagel = 0xb3; - bs2 = 0xb2; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "t26"; + desc = "ATTINY26"; + stk500_devcode = 0x21; + avr910_devcode = 0x5e; + signature = 0x1e 0x91 0x09; + pagel = 0xb3; + bs2 = 0xb2; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, - 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, - 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, - 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 2; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, + 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, + 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, + 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - size = 128; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 x x x x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 128; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 x x x x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - mode = 0x04; - delay = 10; - blocksize = 64; - readsize = 256; - ; + mode = 0x04; + delay = 10; + blocksize = 64; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 2048; - page_size = 32; - num_pages = 64; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; - mode = 0x21; - delay = 6; - blocksize = 16; - readsize = 256; - ; + mode = 0x21; + delay = 6; + blocksize = 16; + readsize = 256; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x x x x x x x o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x x o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x x x x i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x x x x i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 4; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "calibration" + size = 4; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; ; @@ -7232,185 +7232,185 @@ part # Close to ATtiny26 part - id = "t261"; - desc = "ATTINY261"; - has_debugwire = yes; - flash_instr = 0xB4, 0x00, 0x10; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; + id = "t261"; + desc = "ATTINY261"; + has_debugwire = yes; + flash_instr = 0xB4, 0x00, 0x10; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; # stk500_devcode = 0x21; # avr910_devcode = 0x5e; - signature = 0x1e 0x91 0x0c; - pagel = 0xb3; - bs2 = 0xb2; - chip_erase_delay = 4000; + signature = 0x1e 0x91 0x0c; + pagel = 0xb3; + bs2 = 0xb2; + chip_erase_delay = 4000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, - 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, - 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, - 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 2; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, + 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, + 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, + 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - paged = no; - size = 128; - page_size = 4; - num_pages = 32; - min_write_delay = 4000; - max_write_delay = 4000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; + size = 128; + page_size = 4; + num_pages = 32; + min_write_delay = 4000; + max_write_delay = 4000; + readback_p1 = 0xff; + readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 x x x x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + read = "1 0 1 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 x x x x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 x x x x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " x a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 2048; - page_size = 32; - num_pages = 64; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x x x x a9 a8", - " a7 a6 a5 a4 x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x x x x a9 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 32; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x x x x x x x o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x x o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x x x o"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x x x o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; @@ -7421,185 +7421,185 @@ part # Close to ATtiny261 part - id = "t461"; - desc = "ATTINY461"; - has_debugwire = yes; - flash_instr = 0xB4, 0x00, 0x10; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; + id = "t461"; + desc = "ATTINY461"; + has_debugwire = yes; + flash_instr = 0xB4, 0x00, 0x10; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; # stk500_devcode = 0x21; # avr910_devcode = 0x5e; - signature = 0x1e 0x92 0x08; - pagel = 0xb3; - bs2 = 0xb2; - chip_erase_delay = 4000; + signature = 0x1e 0x92 0x08; + pagel = 0xb3; + bs2 = 0xb2; + chip_erase_delay = 4000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, - 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, - 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, - 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 2; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, + 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, + 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, + 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - paged = no; - size = 256; - page_size = 4; - num_pages = 64; - min_write_delay = 4000; - max_write_delay = 4000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; + size = 256; + page_size = 4; + num_pages = 64; + min_write_delay = 4000; + max_write_delay = 4000; + readback_p1 = 0xff; + readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0 x x x x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + read = " 1 0 1 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0 x x x x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0 x x x x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 4096; - page_size = 64; - num_pages = 64; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 64; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x x x x x x x o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x x o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x x x o"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x x x o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; @@ -7610,185 +7610,185 @@ part # Close to ATtiny461 part - id = "t861"; - desc = "ATTINY861"; - has_debugwire = yes; - flash_instr = 0xB4, 0x00, 0x10; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; + id = "t861"; + desc = "ATTINY861"; + has_debugwire = yes; + flash_instr = 0xB4, 0x00, 0x10; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x00, 0xB4, 0x00, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; # stk500_devcode = 0x21; # avr910_devcode = 0x5e; - signature = 0x1e 0x93 0x0d; - pagel = 0xb3; - bs2 = 0xb2; - chip_erase_delay = 4000; + signature = 0x1e 0x93 0x0d; + pagel = 0xb3; + bs2 = 0xb2; + chip_erase_delay = 4000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 0; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; - pp_controlstack = - 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, - 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, - 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, - 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 2; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0xC4, 0xE4, 0xC4, 0xE4, 0xCC, 0xEC, 0xCC, 0xEC, + 0xD4, 0xF4, 0xD4, 0xF4, 0xDC, 0xFC, 0xDC, 0xFC, + 0xC8, 0xE8, 0xD8, 0xF8, 0x4C, 0x6C, 0x5C, 0x7C, + 0xEC, 0xBC, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 2; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - paged = no; - size = 512; - num_pages = 128; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4000; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; + size = 512; + num_pages = 128; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4000; + readback_p1 = 0xff; + readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + read = " 1 0 1 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0 x x x x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_lo = " 0 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 64; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 x x x x x x x x", - "x x x x x x x x x x x x x x o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 x x x x x x x x", + "x x x x x x x x x x x x x x o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", - "x x x x x x x x x x x x x x x x"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 1 1 1 i i", + "x x x x x x x x x x x x x x x x"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x x x o"; - min_write_delay = 4500; - max_write_delay = 4500; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x x x o"; + min_write_delay = 4500; + max_write_delay = 4500; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; @@ -7798,185 +7798,185 @@ part #------------------------------------------------------------ part - id = "m48"; - desc = "ATMEGA48"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x59; + id = "m48"; + desc = "ATMEGA48"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x59; # avr910_devcode = 0x; - signature = 0x1e 0x92 0x05; - pagel = 0xd7; - bs2 = 0xc2; - chip_erase_delay = 45000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + signature = 0x1e 0x92 0x05; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 45000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = + pp_controlstack = 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - paged = no; - page_size = 4; - size = 256; - min_write_delay = 3600; - max_write_delay = 3600; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; + page_size = 4; + size = 256; + min_write_delay = 3600; + max_write_delay = 3600; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 0 x x x x x", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 0 x x x x x", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 0 x x x x x", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 5; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 4096; - page_size = 64; - num_pages = 64; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 5; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 64; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x x x o"; + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x x x o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; @@ -7985,185 +7985,185 @@ part #------------------------------------------------------------ part - id = "m88"; - desc = "ATMEGA88"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x73; + id = "m88"; + desc = "ATMEGA88"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x73; # avr910_devcode = 0x; - signature = 0x1e 0x93 0x0a; - pagel = 0xd7; - bs2 = 0xc2; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + signature = 0x1e 0x93 0x0a; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = + pp_controlstack = 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - paged = no; - page_size = 4; - size = 512; - min_write_delay = 3600; - max_write_delay = 3600; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; + page_size = 4; + size = 512; + min_write_delay = 3600; + max_write_delay = 3600; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 0 x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 0 x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 0 x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 0 x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 5; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 5; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 64; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x o o o"; + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -8171,187 +8171,187 @@ part #------------------------------------------------------------ part - id = "m168"; - desc = "ATMEGA168"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x86; - # avr910_devcode = 0x; - signature = 0x1e 0x94 0x06; - pagel = 0xd7; - bs2 = 0xc2; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + id = "m168"; + desc = "ATMEGA168"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x86; + # avr910_devcode = 0x; + signature = 0x1e 0x94 0x06; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = + pp_controlstack = 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - paged = no; - page_size = 4; - size = 512; - min_write_delay = 3600; - max_write_delay = 3600; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0", - " 0 0 0 x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; + page_size = 4; + size = 512; + min_write_delay = 3600; + max_write_delay = 3600; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 x x x x a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 x x x x a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 5; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 5; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 128; - readsize = 256; + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; - ; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x o o o"; + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -8359,185 +8359,185 @@ part #------------------------------------------------------------ part - id = "t88"; - desc = "attiny88"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x73; + id = "t88"; + desc = "attiny88"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x73; # avr910_devcode = 0x; - signature = 0x1e 0x93 0x11; - pagel = 0xd7; - bs2 = 0xc2; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + signature = 0x1e 0x93 0x11; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = + pp_controlstack = 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - paged = no; - page_size = 4; - size = 64; - min_write_delay = 3600; - max_write_delay = 3600; - readback_p1 = 0xff; - readback_p2 = 0xff; + memory "eeprom" + paged = no; + page_size = 4; + size = 64; + min_write_delay = 3600; + max_write_delay = 3600; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 0 x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 0 x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " x a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 5; - blocksize = 4; - readsize = 64; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 5; + blocksize = 4; + readsize = 64; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 64; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; - memory "lfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "lfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + memory "hfuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x o o o"; + memory "efuse" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x x x x x x o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; + ; - memory "lock" - size = 1; - min_write_delay = 4500; - max_write_delay = 4500; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + min_write_delay = 4500; + max_write_delay = 4500; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -8545,100 +8545,100 @@ part #------------------------------------------------------------ part - id = "m328p"; - desc = "ATMEGA328P"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + id = "m328p"; + desc = "ATMEGA328P"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x86; - # avr910_devcode = 0x; - signature = 0x1e 0x95 0x0F; - pagel = 0xd7; - bs2 = 0xc2; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + stk500_devcode = 0x86; + # avr910_devcode = 0x; + signature = 0x1e 0x95 0x0F; + pagel = 0xd7; + bs2 = 0xc2; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = + pp_controlstack = 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - resetdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - paged = no; - page_size = 4; - size = 1024; + memory "eeprom" + paged = no; + page_size = 4; + size = 1024; min_write_delay = 3600; max_write_delay = 3600; - readback_p1 = 0xff; - readback_p2 = 0xff; + readback_p1 = 0xff; + readback_p2 = 0xff; read = " 1 0 1 0 0 0 0 0", - " 0 0 0 x x x a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + " 0 0 0 x x x a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; write = " 1 1 0 0 0 0 0 0", - " 0 0 0 x x x a9 a8", + " 0 0 0 x x x a9 a8", " a7 a6 a5 a4 a3 a2 a1 a0", " i i i i i i i i"; loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; writepage = " 1 1 0 0 0 0 1 0", - " 0 0 x x x x a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + " 0 0 x x x x a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; - mode = 0x41; - delay = 5; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 5; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; min_write_delay = 4500; max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; + readback_p1 = 0xff; + readback_p2 = 0xff; read_lo = " 0 0 1 0 0 0 0 0", " 0 0 a13 a12 a11 a10 a9 a8", " a7 a6 a5 a4 a3 a2 a1 a0", @@ -8650,82 +8650,82 @@ part " o o o o o o o o"; loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 0 x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + " 0 0 0 x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; writepage = " 0 1 0 0 1 1 0 0", - " 0 0 a13 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + " 0 0 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 128; - readsize = 256; + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; - ; + ; - memory "lfuse" + memory "lfuse" size = 1; min_write_delay = 4500; max_write_delay = 4500; read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; + "x x x x x x x x o o o o o o o o"; write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + "x x x x x x x x i i i i i i i i"; + ; - memory "hfuse" + memory "hfuse" size = 1; min_write_delay = 4500; max_write_delay = 4500; read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; + "x x x x x x x x o o o o o o o o"; write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; - ; + "x x x x x x x x i i i i i i i i"; + ; - memory "efuse" + memory "efuse" size = 1; min_write_delay = 4500; max_write_delay = 4500; read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x o o o"; + "x x x x x x x x x x x x x o o o"; write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; - ; + "x x x x x x x x x x x x x i i i"; + ; - memory "lock" + memory "lock" size = 1; min_write_delay = 4500; max_write_delay = 4500; read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + "x x x x x x x x x x o o o o o o"; write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - ; + "x x x x x x x x 1 1 i i i i i i"; + ; - memory "calibration" + memory "calibration" size = 1; read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" + memory "signature" size = 3; read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -8733,186 +8733,186 @@ part #------------------------------------------------------------ part - id = "t2313"; - desc = "ATtiny2313"; - has_debugwire = yes; - flash_instr = 0xB2, 0x0F, 0x1F; - eeprom_instr = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; - stk500_devcode = 0x23; + id = "t2313"; + desc = "ATtiny2313"; + has_debugwire = yes; + flash_instr = 0xB2, 0x0F, 0x1F; + eeprom_instr = 0xBB, 0xFE, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBA, 0x0F, 0xB2, 0x0F, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; + stk500_devcode = 0x23; ## Use the ATtiny26 devcode: - avr910_devcode = 0x5e; - signature = 0x1e 0x91 0x0a; - pagel = 0xD4; - bs2 = 0xD6; - reset = io; - chip_erase_delay = 9000; + avr910_devcode = 0x5e; + signature = 0x1e 0x91 0x0a; + pagel = 0xD4; + bs2 = 0xD6; + reset = io; + chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, - 0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, - 0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A, - 0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0E, 0x1E, 0x2E, 0x3E, 0x2E, 0x3E, + 0x4E, 0x5E, 0x4E, 0x5E, 0x6E, 0x7E, 0x6E, 0x7E, + 0x26, 0x36, 0x66, 0x76, 0x2A, 0x3A, 0x6A, 0x7A, + 0x2E, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - size = 128; - paged = no; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 128; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " x a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 2048; - page_size = 32; - num_pages = 64; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; # The information in the data sheet of April/2004 is wrong, this works: - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; # The information in the data sheet of April/2004 is wrong, this works: - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; # The information in the data sheet of April/2004 is wrong, this works: - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 32; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; # ATtiny2313 has Signature Bytes: 0x1E 0x91 0x0A. - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; # The Tiny2313 has calibration data for both 4 MHz and 8 MHz. # The information in the data sheet of April/2004 is wrong, this works: - memory "calibration" - size = 2; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 a0 o o o o o o o o"; - ; + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -8920,181 +8920,181 @@ part #------------------------------------------------------------ part - id = "pwm2"; - desc = "AT90PWM2"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x65; + id = "pwm2"; + desc = "AT90PWM2"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x65; ## avr910_devcode = ?; - signature = 0x1e 0x93 0x81; - pagel = 0xD8; - bs2 = 0xE2; - reset = io; - chip_erase_delay = 9000; + signature = 0x1e 0x93 0x81; + pagel = 0xD8; + bs2 = 0xE2; + reset = io; + chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - size = 512; - paged = no; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 512; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 64; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; # AT90PWM2 has Signature Bytes: 0x1E 0x93 0x81. - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -9104,181 +9104,181 @@ part # Completely identical to AT90PWM2 (including the signature!) part - id = "pwm3"; - desc = "AT90PWM3"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x65; + id = "pwm3"; + desc = "AT90PWM3"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x65; ## avr910_devcode = ?; - signature = 0x1e 0x93 0x81; - pagel = 0xD8; - bs2 = 0xE2; - reset = io; - chip_erase_delay = 9000; + signature = 0x1e 0x93 0x81; + pagel = 0xD8; + bs2 = 0xE2; + reset = io; + chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - size = 512; - paged = no; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 512; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 64; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; # AT90PWM2 has Signature Bytes: 0x1E 0x93 0x81. - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -9287,180 +9287,180 @@ part # Same as AT90PWM2 but different signature. part - id = "pwm2b"; - desc = "AT90PWM2B"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x65; + id = "pwm2b"; + desc = "AT90PWM2B"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x65; ## avr910_devcode = ?; - signature = 0x1e 0x93 0x83; - pagel = 0xD8; - bs2 = 0xE2; - reset = io; - chip_erase_delay = 9000; + signature = 0x1e 0x93 0x83; + pagel = 0xD8; + bs2 = 0xE2; + reset = io; + chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - size = 512; - paged = no; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 512; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 64; - readsize = 256; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -9470,180 +9470,180 @@ part # Completely identical to AT90PWM2B (including the signature!) part - id = "pwm3b"; - desc = "AT90PWM3B"; - has_debugwire = yes; - flash_instr = 0xB6, 0x01, 0x11; - eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, - 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, - 0x99, 0xF9, 0xBB, 0xAF; - stk500_devcode = 0x65; + id = "pwm3b"; + desc = "AT90PWM3B"; + has_debugwire = yes; + flash_instr = 0xB6, 0x01, 0x11; + eeprom_instr = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00, + 0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF, + 0x99, 0xF9, 0xBB, 0xAF; + stk500_devcode = 0x65; ## avr910_devcode = ?; - signature = 0x1e 0x93 0x83; - pagel = 0xD8; - bs2 = 0xE2; - reset = io; - chip_erase_delay = 9000; + signature = 0x1e 0x93 0x83; + pagel = 0xD8; + bs2 = 0xE2; + reset = io; + chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - size = 512; - paged = no; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 512; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 64; - readsize = 256; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; + mode = 0x41; + delay = 6; + blocksize = 64; + readsize = 256; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -9651,179 +9651,179 @@ part #------------------------------------------------------------ part - id = "t25"; - desc = "ATtiny25"; - has_debugwire = yes; - flash_instr = 0xB4, 0x02, 0x12; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; + id = "t25"; + desc = "ATtiny25"; + has_debugwire = yes; + flash_instr = 0xB4, 0x02, 0x12; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; ## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; + stk500_devcode = 0x14; ## avr910_devcode = ?; ## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x91 0x08; - reset = io; - chip_erase_delay = 4500; + avr910_devcode = 0x20; + signature = 0x1e 0x91 0x08; + reset = io; + chip_erase_delay = 4500; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; - programfusepolltimeout = 25; - programlockpolltimeout = 25; + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; - memory "eeprom" - size = 128; - paged = no; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 128; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " x a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 2048; - page_size = 32; - num_pages = 64; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 32; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; # ATtiny25 has Signature Bytes: 0x1E 0x91 0x08. - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 2; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 a0 o o o o o o o o"; - ; + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -9831,178 +9831,178 @@ part #------------------------------------------------------------ part - id = "t45"; - desc = "ATtiny45"; - has_debugwire = yes; - flash_instr = 0xB4, 0x02, 0x12; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; - stk500_devcode = 0x14; + id = "t45"; + desc = "ATtiny45"; + has_debugwire = yes; + flash_instr = 0xB4, 0x02, 0x12; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; + stk500_devcode = 0x14; ## avr910_devcode = ?; ## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x92 0x06; - reset = io; - chip_erase_delay = 4500; + avr910_devcode = 0x20; + signature = 0x1e 0x92 0x06; + reset = io; + chip_erase_delay = 4500; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - hvsp_controlstack = + hvsp_controlstack = 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; - programfusepolltimeout = 25; - programlockpolltimeout = 25; + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; - memory "eeprom" - size = 256; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 256; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 4096; - page_size = 64; - num_pages = 64; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 32; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; # ATtiny45 has Signature Bytes: 0x1E 0x92 0x08. (Data sheet 2586C-AVR-06/05 (doc2586.pdf) indicates otherwise!) - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 2; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 a0 o o o o o o o o"; - ; + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -10010,179 +10010,179 @@ part #------------------------------------------------------------ part - id = "t85"; - desc = "ATtiny85"; - has_debugwire = yes; - flash_instr = 0xB4, 0x02, 0x12; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; + id = "t85"; + desc = "ATtiny85"; + has_debugwire = yes; + flash_instr = 0xB4, 0x02, 0x12; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x02, 0xB4, 0x02, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; ## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; + stk500_devcode = 0x14; ## avr910_devcode = ?; ## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x93 0x0b; - reset = io; - chip_erase_delay = 4500; + avr910_devcode = 0x20; + signature = 0x1e 0x93 0x0b; + reset = io; + chip_erase_delay = 4500; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; - programfusepolltimeout = 25; - programlockpolltimeout = 25; + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x00; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; - memory "eeprom" - size = 512; - paged = no; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 512; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", - "a8 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", + "a8 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x a8", " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 32; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; # ATtiny85 has Signature Bytes: 0x1E 0x93 0x08. - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 2; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 a0 o o o o o o o o"; - ; + memory "calibration" + size = 2; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -10191,187 +10191,187 @@ part # Almost same as ATmega1280, except for different memory sizes part - id = "m640"; - desc = "ATMEGA640"; - signature = 0x1e 0x96 0x08; - has_jtag = yes; + id = "m640"; + desc = "ATMEGA640"; + signature = 0x1e 0x96 0x08; + has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x a11 a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -10379,187 +10379,187 @@ part #------------------------------------------------------------ part - id = "m1280"; - desc = "ATMEGA1280"; - signature = 0x1e 0x97 0x03; - has_jtag = yes; + id = "m1280"; + desc = "ATMEGA1280"; + signature = 0x1e 0x97 0x03; + has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x a11 a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -10568,187 +10568,187 @@ part # Identical to ATmega1280 part - id = "m1281"; - desc = "ATMEGA1281"; - signature = 0x1e 0x97 0x04; - has_jtag = yes; + id = "m1281"; + desc = "ATMEGA1281"; + signature = 0x1e 0x97 0x04; + has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x a11 a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -10756,192 +10756,192 @@ part #------------------------------------------------------------ part - id = "m2560"; - desc = "ATMEGA2560"; - signature = 0x1e 0x98 0x01; - has_jtag = yes; + id = "m2560"; + desc = "ATMEGA2560"; + signature = 0x1e 0x98 0x01; + has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x a11 a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 262144; - page_size = 256; - num_pages = 1024; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 262144; + page_size = 256; + num_pages = 1024; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - load_ext_addr = " 0 1 0 0 1 1 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 0 a16", - " 0 0 0 0 0 0 0 0"; + load_ext_addr = " 0 1 0 0 1 1 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 0 a16", + " 0 0 0 0 0 0 0 0"; - mode = 0x41; - delay = 10; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -10949,192 +10949,192 @@ part #------------------------------------------------------------ part - id = "m2561"; - desc = "ATMEGA2561"; - signature = 0x1e 0x98 0x02; - has_jtag = yes; + id = "m2561"; + desc = "ATMEGA2561"; + signature = 0x1e 0x98 0x02; + has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x a11 a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 262144; - page_size = 256; - num_pages = 1024; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 262144; + page_size = 256; + num_pages = 1024; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - load_ext_addr = " 0 1 0 0 1 1 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 0 a16", - " 0 0 0 0 0 0 0 0"; + load_ext_addr = " 0 1 0 0 1 1 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 0 a16", + " 0 0 0 0 0 0 0 0"; - mode = 0x41; - delay = 10; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -11143,187 +11143,187 @@ part # Identical to ATmega2561 but half the ROM part - id = "m128rfa1"; - desc = "ATMEGA128RFA1"; - signature = 0x1e 0xa7 0x01; - has_jtag = yes; + id = "m128rfa1"; + desc = "ATMEGA128RFA1"; + signature = 0x1e 0xa7 0x01; + has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xE2; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xE2; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x a11 a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -11331,181 +11331,181 @@ part #------------------------------------------------------------ part - id = "t24"; - desc = "ATtiny24"; - has_debugwire = yes; - flash_instr = 0xB4, 0x07, 0x17; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; + id = "t24"; + desc = "ATtiny24"; + has_debugwire = yes; + flash_instr = 0xB4, 0x07, 0x17; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; ## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; + stk500_devcode = 0x14; ## avr910_devcode = ?; ## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x91 0x0b; - reset = io; - chip_erase_delay = 4500; + avr910_devcode = 0x20; + signature = 0x1e 0x91 0x0b; + reset = io; + chip_erase_delay = 4500; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 70; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; - programfusepolltimeout = 25; - programlockpolltimeout = 25; + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 70; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; - memory "eeprom" - size = 128; - paged = no; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 128; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", - "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "x a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " x a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 2048; - page_size = 32; - num_pages = 64; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 2048; + page_size = 32; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x x a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x x a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 32; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; # ATtiny24 has Signature Bytes: 0x1E 0x91 0x0B. - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x x x x x x x i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x x x x x x x i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 a0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -11513,181 +11513,181 @@ part #------------------------------------------------------------ part - id = "t44"; - desc = "ATtiny44"; - has_debugwire = yes; - flash_instr = 0xB4, 0x07, 0x17; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; + id = "t44"; + desc = "ATtiny44"; + has_debugwire = yes; + flash_instr = 0xB4, 0x07, 0x17; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; ## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; + stk500_devcode = 0x14; ## avr910_devcode = ?; ## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x92 0x07; - reset = io; - chip_erase_delay = 4500; + avr910_devcode = 0x20; + signature = 0x1e 0x92 0x07; + reset = io; + chip_erase_delay = 4500; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 70; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; - programfusepolltimeout = 25; - programlockpolltimeout = 25; + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 70; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; - memory "eeprom" - size = 256; - paged = no; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 256; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", - "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x x", + "a7 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " x a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 4096; - page_size = 64; - num_pages = 64; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 4096; + page_size = 64; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 32; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; # ATtiny44 has Signature Bytes: 0x1E 0x92 0x07. - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x x x x x x x i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x x x x x x x i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 a0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -11695,182 +11695,182 @@ part #------------------------------------------------------------ part - id = "t84"; - desc = "ATtiny84"; - has_debugwire = yes; - flash_instr = 0xB4, 0x07, 0x17; - eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, - 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, - 0x99, 0xE1, 0xBB, 0xAC; + id = "t84"; + desc = "ATtiny84"; + has_debugwire = yes; + flash_instr = 0xB4, 0x07, 0x17; + eeprom_instr = 0xBB, 0xFF, 0xBB, 0xEE, 0xBB, 0xCC, 0xB2, 0x0D, + 0xBC, 0x07, 0xB4, 0x07, 0xBA, 0x0D, 0xBB, 0xBC, + 0x99, 0xE1, 0xBB, 0xAC; ## no STK500 devcode in XML file, use the ATtiny45 one - stk500_devcode = 0x14; + stk500_devcode = 0x14; ## avr910_devcode = ?; ## Try the AT90S2313 devcode: - avr910_devcode = 0x20; - signature = 0x1e 0x93 0x0c; - reset = io; - chip_erase_delay = 4500; + avr910_devcode = 0x20; + signature = 0x1e 0x93 0x0c; + reset = io; + chip_erase_delay = 4500; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - hvsp_controlstack = - 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, - 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, - 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, - 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; - hventerstabdelay = 100; - hvspcmdexedelay = 0; - synchcycles = 6; - latchcycles = 1; - togglevtg = 1; - poweroffdelay = 25; - resetdelayms = 0; - resetdelayus = 70; - hvleavestabdelay = 100; - resetdelay = 25; - chiperasepolltimeout = 40; - chiperasetime = 0; - programfusepolltimeout = 25; - programlockpolltimeout = 25; + hvsp_controlstack = + 0x4C, 0x0C, 0x1C, 0x2C, 0x3C, 0x64, 0x74, 0x66, + 0x68, 0x78, 0x68, 0x68, 0x7A, 0x6A, 0x68, 0x78, + 0x78, 0x7D, 0x6D, 0x0C, 0x80, 0x40, 0x20, 0x10, + 0x11, 0x08, 0x04, 0x02, 0x03, 0x08, 0x04, 0x0F; + hventerstabdelay = 100; + hvspcmdexedelay = 0; + synchcycles = 6; + latchcycles = 1; + togglevtg = 1; + poweroffdelay = 25; + resetdelayms = 0; + resetdelayus = 70; + hvleavestabdelay = 100; + resetdelay = 25; + chiperasepolltimeout = 40; + chiperasetime = 0; + programfusepolltimeout = 25; + programlockpolltimeout = 25; - memory "eeprom" - size = 512; - paged = no; - page_size = 4; - min_write_delay = 4000; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", - "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; + memory "eeprom" + size = 512; + paged = no; + page_size = 4; + min_write_delay = 4000; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = "1 0 1 0 0 0 0 0 0 0 0 x x x x a8", + "a7 a6 a5 a4 a3 a2 a1 a0 o o o o o o o o"; - write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", - "a8 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; + write = "1 1 0 0 0 0 0 0 0 0 0 x x x x a8", + "a8 a6 a5 a4 a3 a2 a1 a0 i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x x x x", " x a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 4; - readsize = 256; - ; - memory "flash" - paged = yes; - size = 8192; - page_size = 64; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + mode = 0x41; + delay = 6; + blocksize = 4; + readsize = 256; + ; + memory "flash" + paged = yes; + size = 8192; + page_size = 64; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 x x x x x", - " x x x a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 x x x x x", + " x x x a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 32; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 32; + readsize = 256; + ; # ATtiny84 has Signature Bytes: 0x1E 0x93 0x0C. - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; - memory "lock" - size = 1; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x x x x x x x i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + memory "lock" + size = 1; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x x x x x x x i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x x x x i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x x x x i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 a0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -11878,187 +11878,187 @@ part #------------------------------------------------------------ part - id = "m32u4"; - desc = "ATmega32U4"; - signature = 0x1e 0x95 0x87; - has_jtag = yes; + id = "m32u4"; + desc = "ATmega32U4"; + signature = 0x1e 0x95 0x87; + has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 1024; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x i i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -12066,187 +12066,187 @@ part #------------------------------------------------------------ part - id = "usb646"; - desc = "AT90USB646"; - signature = 0x1e 0x96 0x82; - has_jtag = yes; + id = "usb646"; + desc = "AT90USB646"; + signature = 0x1e 0x96 0x82; + has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 2048; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x i i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -12255,187 +12255,187 @@ part # identical to AT90USB646 part - id = "usb647"; - desc = "AT90USB647"; - signature = 0x1e 0x96 0x82; - has_jtag = yes; + id = "usb647"; + desc = "AT90USB647"; + signature = 0x1e 0x96 0x82; + has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 2048; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x x a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x i i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -12443,187 +12443,187 @@ part #------------------------------------------------------------ part - id = "usb1286"; - desc = "AT90USB1286"; - signature = 0x1e 0x97 0x82; - has_jtag = yes; + id = "usb1286"; + desc = "AT90USB1286"; + signature = 0x1e 0x97 0x82; + has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x i i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -12632,187 +12632,187 @@ part # identical to AT90USB1286 part - id = "usb1287"; - desc = "AT90USB1287"; - signature = 0x1e 0x97 0x82; - has_jtag = yes; + id = "usb1287"; + desc = "AT90USB1287"; + signature = 0x1e 0x97 0x82; + has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; - chip_erase_delay = 9000; - pagel = 0xD7; - bs2 = 0xA0; - reset = dedicated; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; + chip_erase_delay = 9000; + pagel = 0xD7; + bs2 = 0xA0; + reset = dedicated; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "x x x x x x x x x x x x x x x x"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - rampz = 0x3b; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + rampz = 0x3b; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 4096; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 4096; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " x x x x a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " x x x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 a2 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", + writepage = " 1 1 0 0 0 0 1 0", " 0 0 x x x a10 a9 a8", " a7 a6 a5 a4 a3 0 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 131072; - page_size = 256; - num_pages = 512; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 131072; + page_size = 256; + num_pages = 512; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 x x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 256; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 256; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x x x x x i i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x x x i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 x x x x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 x x x x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 x x x x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; @@ -12821,179 +12821,179 @@ part #------------------------------------------------------------ part - id = "usb162"; - desc = "AT90USB162"; - has_jtag = no; - has_debugwire = yes; - signature = 0x1e 0x94 0x82; - chip_erase_delay = 9000; - reset = io; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; - pagel = 0xD7; - bs2 = 0xC6; + id = "usb162"; + desc = "AT90USB162"; + has_jtag = no; + has_debugwire = yes; + signature = 0x1e 0x94 0x82; + chip_erase_delay = 9000; + reset = io; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + pagel = 0xD7; + bs2 = 0xC6; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 512; - num_pages = 128; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + num_pages = 128; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 16384; - page_size = 128; - num_pages = 128; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 16384; + page_size = 128; + num_pages = 128; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x i i i i i i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -13005,179 +13005,179 @@ part # num_pages = 64; part - id = "usb82"; - desc = "AT90USB82"; - has_jtag = no; - has_debugwire = yes; - signature = 0x1e 0x93 0x82; - chip_erase_delay = 9000; - reset = io; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "x x x x x x x x x x x x x x x x"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", - "x x x x x x x x x x x x x x x x"; - pagel = 0xD7; - bs2 = 0xC6; + id = "usb82"; + desc = "AT90USB82"; + has_jtag = no; + has_debugwire = yes; + signature = 0x1e 0x93 0x82; + chip_erase_delay = 9000; + reset = io; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + pagel = 0xD7; + bs2 = 0xC6; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 512; - num_pages = 128; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0x00; - readback_p2 = 0x00; - read = " 1 0 1 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 512; + num_pages = 128; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", + loadpage_lo = " 1 1 0 0 0 0 0 1", " 0 0 0 0 0 0 0 0", " 0 0 0 0 0 0 a1 a0", " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", " x x x x x x x x"; - mode = 0x41; - delay = 20; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 20; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 8192; - page_size = 128; - num_pages = 64; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0x00; - readback_p2 = 0x00; - read_lo = " 0 0 1 0 0 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 8192; + page_size = 128; + num_pages = 64; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0x00; + readback_p2 = 0x00; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " x x x x x x x x", - " x x a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " x x x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - "a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; - mode = 0x41; - delay = 6; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 6; + blocksize = 128; + readsize = 256; + ; - memory "lfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "lfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "x x x x x x x x i i i i i i i i"; + memory "hfuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "x x x x x x x x i i i i i i i i"; + memory "efuse" + size = 1; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x i i i i i i i i"; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x o o o o o o o o"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", - "x x x x x x x x 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "calibration" - size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", - "x x x x x x a1 a0 o o o o o o o o"; - ; + memory "calibration" + size = 1; + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -13185,188 +13185,188 @@ part #------------------------------------------------------------ part - id = "m325"; - desc = "ATMEGA325"; - signature = 0x1e 0x95 0x05; - has_jtag = yes; + id = "m325"; + desc = "ATMEGA325"; + signature = 0x1e 0x95 0x05; + has_jtag = yes; # stk500_devcode = 0x??; # No STK500v1 support? # avr910_devcode = 0x??; # Try the ATmega16 one - avr910_devcode = 0x74; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + avr910_devcode = 0x74; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 1024; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 0 0 0 0 0", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 0 0 0 0 0", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", - "0 0 0 0 0 0 0 0 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; + memory "efuse" + size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; + memory "calibration" + size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -13374,188 +13374,188 @@ part #------------------------------------------------------------ part - id = "m645"; - desc = "ATMEGA645"; - signature = 0x1E 0x96 0x05; - has_jtag = yes; + id = "m645"; + desc = "ATMEGA645"; + signature = 0x1E 0x96 0x05; + has_jtag = yes; # stk500_devcode = 0x??; # No STK500v1 support? # avr910_devcode = 0x??; # Try the ATmega16 one - avr910_devcode = 0x74; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + avr910_devcode = 0x74; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 2048; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 8; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 0 0 0 0 0", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 0 0 0 0 0", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " 0 0 0 0 0 0 0 0"; + writepage = " 0 1 0 0 1 1 0 0", + " a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " 0 0 0 0 0 0 0 0"; - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", - "0 0 0 0 0 0 0 0 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; + memory "efuse" + size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; + memory "calibration" + size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -13563,188 +13563,188 @@ part #------------------------------------------------------------ part - id = "m3250"; - desc = "ATMEGA3250"; - signature = 0x1E 0x95 0x06; - has_jtag = yes; + id = "m3250"; + desc = "ATMEGA3250"; + signature = 0x1E 0x95 0x06; + has_jtag = yes; # stk500_devcode = 0x??; # No STK500v1 support? # avr910_devcode = 0x??; # Try the ATmega16 one - avr910_devcode = 0x74; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + avr910_devcode = 0x74; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 4; /* for parallel programming */ - size = 1024; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 4; /* for parallel programming */ + size = 1024; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 0 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 0 a1 a0", + " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 0 0 a9 a8", - " a7 a6 a5 a4 a3 a2 0 0", - " x x x x x x x x"; + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 0 0 a9 a8", + " a7 a6 a5 a4 a3 a2 0 0", + " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 32768; - page_size = 128; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 32768; + page_size = 128; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 0 0 0 0 0", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 0 0 0 0 0", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " x x x x x x x x"; + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", - "0 0 0 0 0 0 0 0 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; + memory "efuse" + size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; + memory "calibration" + size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -13752,188 +13752,188 @@ part #------------------------------------------------------------ part - id = "m6450"; - desc = "ATMEGA6450"; - signature = 0x1E 0x96 0x06; - has_jtag = yes; + id = "m6450"; + desc = "ATMEGA6450"; + signature = 0x1E 0x96 0x06; + has_jtag = yes; # stk500_devcode = 0x??; # No STK500v1 support? # avr910_devcode = 0x??; # Try the ATmega16 one - avr910_devcode = 0x74; - pagel = 0xd7; - bs2 = 0xa0; - chip_erase_delay = 9000; - pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + avr910_devcode = 0x74; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 9000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"; - timeout = 200; - stabdelay = 100; - cmdexedelay = 25; - synchloops = 32; - bytedelay = 0; - pollindex = 3; - pollvalue = 0x53; - predelay = 1; - postdelay = 1; - pollmethod = 1; + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 1; - pp_controlstack = - 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, - 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, - 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, - 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; - hventerstabdelay = 100; - progmodedelay = 0; - latchcycles = 5; - togglevtg = 1; - poweroffdelay = 15; - resetdelayms = 1; - resetdelayus = 0; - hvleavestabdelay = 15; - chiperasepulsewidth = 0; - chiperasepolltimeout = 10; - programfusepulsewidth = 0; - programfusepolltimeout = 5; - programlockpulsewidth = 0; - programlockpolltimeout = 5; + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 5; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; - idr = 0x31; - spmcr = 0x57; - allowfullpagebitstream = no; + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; - memory "eeprom" - paged = no; /* leave this "no" */ - page_size = 8; /* for parallel programming */ - size = 2048; - min_write_delay = 9000; - max_write_delay = 9000; - readback_p1 = 0xff; - readback_p2 = 0xff; - read = " 1 0 1 0 0 0 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - write = " 1 1 0 0 0 0 0 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + write = " 1 1 0 0 0 0 0 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_lo = " 1 1 0 0 0 0 0 1", - " 0 0 0 0 0 0 0 0", - " 0 0 0 0 0 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; - writepage = " 1 1 0 0 0 0 1 0", - " 0 0 0 0 0 a10 a9 a8", - " a7 a6 a5 a4 a3 0 0 0", - " x x x x x x x x"; + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 0 0 0 a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; - mode = 0x41; - delay = 10; - blocksize = 4; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 4; + readsize = 256; + ; - memory "flash" - paged = yes; - size = 65536; - page_size = 256; - num_pages = 256; - min_write_delay = 4500; - max_write_delay = 4500; - readback_p1 = 0xff; - readback_p2 = 0xff; - read_lo = " 0 0 1 0 0 0 0 0", - " a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + " a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - read_hi = " 0 0 1 0 1 0 0 0", - " a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " o o o o o o o o"; + read_hi = " 0 0 1 0 1 0 0 0", + " a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; - loadpage_lo = " 0 1 0 0 0 0 0 0", - " 0 0 0 0 0 0 0 0", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - loadpage_hi = " 0 1 0 0 1 0 0 0", - " 0 0 0 0 0 0 0 0", - " a7 a6 a5 a4 a3 a2 a1 a0", - " i i i i i i i i"; + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 0 0 0 0 0 0", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; - writepage = " 0 1 0 0 1 1 0 0", - " a15 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 a5 a4 a3 a2 a1 a0", - " 0 0 0 0 0 0 0 0"; + writepage = " 0 1 0 0 1 1 0 0", + " a15 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " 0 0 0 0 0 0 0 0"; - mode = 0x41; - delay = 10; - blocksize = 128; - readsize = 256; - ; + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; - memory "lock" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", - "x x x x x x x x x x o o o o o o"; + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", - "0 0 0 0 0 0 0 0 1 1 i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "lfuse" - size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "hfuse" - size = 1; - read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", - "0 0 0 0 0 0 0 0 i i i i i i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "0 0 0 0 0 0 0 0 i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "efuse" - size = 1; + memory "efuse" + size = 1; - read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; - write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", - "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; - min_write_delay = 9000; - max_write_delay = 9000; - ; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "0 0 0 0 0 0 0 0 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; - memory "signature" - size = 3; - read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 a1 a0 o o o o o o o o"; - ; + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 a1 a0 o o o o o o o o"; + ; - memory "calibration" - size = 1; + memory "calibration" + size = 1; - read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", - "0 0 0 0 0 0 0 0 o o o o o o o o"; - ; + read = "0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; ; #------------------------------------------------------------ @@ -13941,96 +13941,96 @@ part #------------------------------------------------------------ part - id = "x64a1"; - desc = "ATXMEGA64A1"; - signature = 0x1e 0x96 0x4e; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x64a1"; + desc = "ATXMEGA64A1"; + signature = 0x1e 0x96 0x4e; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x0800; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x0800; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00010000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00010000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00001000; - offset = 0x0080f000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00001000; + offset = 0x0080f000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00001000; - offset = 0x00810000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00001000; + offset = 0x00810000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00011000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00011000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -14038,96 +14038,96 @@ part #------------------------------------------------------------ part - id = "x128a1"; - desc = "ATXMEGA128A1"; - signature = 0x1e 0x97 0x4c; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x128a1"; + desc = "ATXMEGA128A1"; + signature = 0x1e 0x97 0x4c; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x0800; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x0800; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00020000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00020000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00002000; - offset = 0x0081e000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00002000; + offset = 0x0081e000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00002000; - offset = 0x00820000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00002000; + offset = 0x00820000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00022000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00022000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -14135,96 +14135,96 @@ part #------------------------------------------------------------ part - id = "x128a1d"; - desc = "ATXMEGA128A1REVD"; - signature = 0x1e 0x97 0x41; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x128a1d"; + desc = "ATXMEGA128A1REVD"; + signature = 0x1e 0x97 0x41; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x0800; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x0800; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00020000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00020000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00002000; - offset = 0x0081e000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00002000; + offset = 0x0081e000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00002000; - offset = 0x00820000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00002000; + offset = 0x00820000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00022000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00022000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -14232,96 +14232,96 @@ part #------------------------------------------------------------ part - id = "x192a1"; - desc = "ATXMEGA192A1"; - signature = 0x1e 0x97 0x4e; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x192a1"; + desc = "ATXMEGA192A1"; + signature = 0x1e 0x97 0x4e; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x0800; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x0800; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00030000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00030000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00002000; - offset = 0x0082e000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00002000; + offset = 0x0082e000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00002000; - offset = 0x00830000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00002000; + offset = 0x00830000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00032000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00032000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -14329,96 +14329,96 @@ part #------------------------------------------------------------ part - id = "x256a1"; - desc = "ATXMEGA256A1"; - signature = 0x1e 0x98 0x46; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x256a1"; + desc = "ATXMEGA256A1"; + signature = 0x1e 0x98 0x46; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x1000; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x1000; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00040000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00040000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00002000; - offset = 0x0083e000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00002000; + offset = 0x0083e000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00002000; - offset = 0x00840000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00002000; + offset = 0x00840000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00042000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00042000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -14426,96 +14426,96 @@ part #------------------------------------------------------------ part - id = "x64a3"; - desc = "ATXMEGA64A3"; - signature = 0x1e 0x96 0x42; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x64a3"; + desc = "ATXMEGA64A3"; + signature = 0x1e 0x96 0x42; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x0800; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x0800; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00010000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00010000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00001000; - offset = 0x0080f000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00001000; + offset = 0x0080f000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00001000; - offset = 0x00810000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00001000; + offset = 0x00810000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00011000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00011000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -14523,96 +14523,96 @@ part #------------------------------------------------------------ part - id = "x128a3"; - desc = "ATXMEGA128A3"; - signature = 0x1e 0x97 0x42; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x128a3"; + desc = "ATXMEGA128A3"; + signature = 0x1e 0x97 0x42; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x0800; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x0800; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00020000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00020000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00002000; - offset = 0x0081e000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00002000; + offset = 0x0081e000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00002000; - offset = 0x00820000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00002000; + offset = 0x00820000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00022000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00022000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -14620,96 +14620,96 @@ part #------------------------------------------------------------ part - id = "x192a3"; - desc = "ATXMEGA192A3"; - signature = 0x1e 0x97 0x44; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x192a3"; + desc = "ATXMEGA192A3"; + signature = 0x1e 0x97 0x44; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x0800; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x0800; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00030000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00030000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00002000; - offset = 0x0082e000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00002000; + offset = 0x0082e000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00002000; - offset = 0x00830000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00002000; + offset = 0x00830000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00032000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00032000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -14717,96 +14717,96 @@ part #------------------------------------------------------------ part - id = "x256a3"; - desc = "ATXMEGA256A3"; - signature = 0x1e 0x98 0x42; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x256a3"; + desc = "ATXMEGA256A3"; + signature = 0x1e 0x98 0x42; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x1000; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x1000; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00040000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00040000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00002000; - offset = 0x0083e000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00002000; + offset = 0x0083e000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00002000; - offset = 0x00840000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00002000; + offset = 0x00840000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00042000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00042000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -14814,96 +14814,96 @@ part #------------------------------------------------------------ part - id = "x256a3b"; - desc = "ATXMEGA256A3B"; - signature = 0x1e 0x98 0x43; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x256a3b"; + desc = "ATXMEGA256A3B"; + signature = 0x1e 0x98 0x43; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x1000; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x1000; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00040000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00040000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00002000; - offset = 0x0083e000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00002000; + offset = 0x0083e000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00002000; - offset = 0x00840000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00002000; + offset = 0x00840000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00042000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00042000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -14911,96 +14911,96 @@ part #------------------------------------------------------------ part - id = "x16a4"; - desc = "ATXMEGA16A4"; - signature = 0x1e 0x94 0x41; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x16a4"; + desc = "ATXMEGA16A4"; + signature = 0x1e 0x94 0x41; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x0400; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x0400; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00004000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00004000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00001000; - offset = 0x00803000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00001000; + offset = 0x00803000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00001000; - offset = 0x00804000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00001000; + offset = 0x00804000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00005000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00005000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -15008,96 +15008,96 @@ part #------------------------------------------------------------ part - id = "x32a4"; - desc = "ATXMEGA32A4"; - signature = 0x1e 0x95 0x41; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x32a4"; + desc = "ATXMEGA32A4"; + signature = 0x1e 0x95 0x41; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x0400; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x0400; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00008000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00008000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00001000; - offset = 0x00807000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00001000; + offset = 0x00807000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00001000; - offset = 0x00808000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00001000; + offset = 0x00808000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00009000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00009000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -15105,96 +15105,96 @@ part #------------------------------------------------------------ part - id = "x64a4"; - desc = "ATXMEGA64A4"; - signature = 0x1e 0x96 0x46; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x64a4"; + desc = "ATXMEGA64A4"; + signature = 0x1e 0x96 0x46; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x0800; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x0800; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00010000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00010000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00001000; - offset = 0x0080f000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00001000; + offset = 0x0080f000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00001000; - offset = 0x00810000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00001000; + offset = 0x00810000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00011000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00011000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; #------------------------------------------------------------ @@ -15202,96 +15202,96 @@ part #------------------------------------------------------------ part - id = "x128a4"; - desc = "ATXMEGA128A4"; - signature = 0x1e 0x97 0x46; - has_jtag = yes; - has_pdi = yes; - nvm_base = 0x01c0; + id = "x128a4"; + desc = "ATXMEGA128A4"; + signature = 0x1e 0x97 0x46; + has_jtag = yes; + has_pdi = yes; + nvm_base = 0x01c0; - memory "eeprom" - size = 0x0800; - offset = 0x08c0000; - page_size = 0x20; - readsize = 0x100; - ; + memory "eeprom" + size = 0x0800; + offset = 0x08c0000; + page_size = 0x20; + readsize = 0x100; + ; - memory "application" - size = 0x00020000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "application" + size = 0x00020000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "apptable" - size = 0x00002000; - offset = 0x0081e000; - page_size = 0x100; - readsize = 0x100; - ; + memory "apptable" + size = 0x00002000; + offset = 0x0081e000; + page_size = 0x100; + readsize = 0x100; + ; - memory "boot" - size = 0x00002000; - offset = 0x00820000; - page_size = 0x100; - readsize = 0x100; - ; + memory "boot" + size = 0x00002000; + offset = 0x00820000; + page_size = 0x100; + readsize = 0x100; + ; - memory "flash" - size = 0x00022000; - offset = 0x0800000; - page_size = 0x100; - readsize = 0x100; - ; + memory "flash" + size = 0x00022000; + offset = 0x0800000; + page_size = 0x100; + readsize = 0x100; + ; - memory "prodsig" - size = 0x200; - offset = 0x8e0200; - page_size = 0x100; - readsize = 0x100; - ; + memory "prodsig" + size = 0x200; + offset = 0x8e0200; + page_size = 0x100; + readsize = 0x100; + ; - memory "usersig" - size = 0x200; - offset = 0x8e0400; - page_size = 0x100; - readsize = 0x100; - ; + memory "usersig" + size = 0x200; + offset = 0x8e0400; + page_size = 0x100; + readsize = 0x100; + ; - memory "signature" - size = 3; - offset = 0x1000090; - ; + memory "signature" + size = 3; + offset = 0x1000090; + ; - memory "fuse0" - size = 1; - offset = 0x8f0020; - ; + memory "fuse0" + size = 1; + offset = 0x8f0020; + ; - memory "fuse1" - size = 1; - offset = 0x8f0021; - ; + memory "fuse1" + size = 1; + offset = 0x8f0021; + ; - memory "fuse2" - size = 1; - offset = 0x8f0022; - ; + memory "fuse2" + size = 1; + offset = 0x8f0022; + ; - memory "fuse4" - size = 1; - offset = 0x8f0024; - ; + memory "fuse4" + size = 1; + offset = 0x8f0024; + ; - memory "fuse5" - size = 1; - offset = 0x8f0025; - ; + memory "fuse5" + size = 1; + offset = 0x8f0025; + ; - memory "lock" - size = 1; - offset = 0x8f0027; - ; + memory "lock" + size = 1; + offset = 0x8f0027; + ; ; @@ -15300,20 +15300,20 @@ part #------------------------------------------------------------ part - id = "ucr2"; - desc = "32UC3A0512"; - signature = 0xED 0xC0 0x3F; - has_jtag = yes; - is_avr32 = yes; + id = "ucr2"; + desc = "32UC3A0512"; + signature = 0xED 0xC0 0x3F; + has_jtag = yes; + is_avr32 = yes; - memory "flash" - paged = yes; - page_size = 512; # bytes - readsize = 512; # bytes - num_pages = 1024; # could be set dynamicly - size = 0x00080000; # could be set dynamicly - offset = 0x80000000; - ; + memory "flash" + paged = yes; + page_size = 512; # bytes + readsize = 512; # bytes + num_pages = 1024; # could be set dynamicly + size = 0x00080000; # could be set dynamicly + offset = 0x80000000; + ; ; #------------------------------------------------------------ @@ -15321,38 +15321,38 @@ part #------------------------------------------------------------ part - id = "t4"; - desc = "ATtiny4"; - signature = 0x1e 0x8f 0x0a; - has_tpi = yes; + id = "t4"; + desc = "ATtiny4"; + signature = 0x1e 0x8f 0x0a; + has_tpi = yes; - memory "flash" - size = 512; - offset = 0x4000; - page_size = 16; - blocksize = 128; - ; + memory "flash" + size = 512; + offset = 0x4000; + page_size = 16; + blocksize = 128; + ; - memory "signature" - size = 3; - offset = 0x3fc0; - ; + memory "signature" + size = 3; + offset = 0x3fc0; + ; - memory "fuse" - size = 1; - offset = 0x3f40; - blocksize = 4; - ; + memory "fuse" + size = 1; + offset = 0x3f40; + blocksize = 4; + ; - memory "calibration" - size = 1; - offset = 0x3f80; - ; + memory "calibration" + size = 1; + offset = 0x3f80; + ; - memory "lockbits" - size = 1; - offset = 0x3f00; - ; + memory "lockbits" + size = 1; + offset = 0x3f00; + ; ; @@ -15361,38 +15361,38 @@ part #------------------------------------------------------------ part - id = "t5"; - desc = "ATtiny5"; - signature = 0x1e 0x8f 0x09; - has_tpi = yes; + id = "t5"; + desc = "ATtiny5"; + signature = 0x1e 0x8f 0x09; + has_tpi = yes; - memory "flash" - size = 512; - offset = 0x4000; - page_size = 16; - blocksize = 128; - ; + memory "flash" + size = 512; + offset = 0x4000; + page_size = 16; + blocksize = 128; + ; - memory "signature" - size = 3; - offset = 0x3fc0; - ; + memory "signature" + size = 3; + offset = 0x3fc0; + ; - memory "fuse" - size = 1; - offset = 0x3f40; - blocksize = 4; - ; + memory "fuse" + size = 1; + offset = 0x3f40; + blocksize = 4; + ; - memory "calibration" - size = 1; - offset = 0x3f80; - ; + memory "calibration" + size = 1; + offset = 0x3f80; + ; - memory "lockbits" - size = 1; - offset = 0x3f00; - ; + memory "lockbits" + size = 1; + offset = 0x3f00; + ; ; @@ -15401,38 +15401,38 @@ part #------------------------------------------------------------ part - id = "t8"; - desc = "ATtiny9"; - signature = 0x1e 0x90 0x08; - has_tpi = yes; + id = "t8"; + desc = "ATtiny9"; + signature = 0x1e 0x90 0x08; + has_tpi = yes; - memory "flash" - size = 1024; - offset = 0x4000; - page_size = 16; - blocksize = 128; - ; + memory "flash" + size = 1024; + offset = 0x4000; + page_size = 16; + blocksize = 128; + ; - memory "signature" - size = 3; - offset = 0x3fc0; - ; + memory "signature" + size = 3; + offset = 0x3fc0; + ; - memory "fuse" - size = 1; - offset = 0x3f40; - blocksize = 4; - ; + memory "fuse" + size = 1; + offset = 0x3f40; + blocksize = 4; + ; - memory "calibration" - size = 1; - offset = 0x3f80; - ; + memory "calibration" + size = 1; + offset = 0x3f80; + ; - memory "lockbits" - size = 1; - offset = 0x3f00; - ; + memory "lockbits" + size = 1; + offset = 0x3f00; + ; ; @@ -15441,38 +15441,38 @@ part #------------------------------------------------------------ part - id = "t10"; - desc = "ATtiny10"; - signature = 0x1e 0x90 0x03; - has_tpi = yes; + id = "t10"; + desc = "ATtiny10"; + signature = 0x1e 0x90 0x03; + has_tpi = yes; - memory "flash" - size = 1024; - offset = 0x4000; - page_size = 16; - blocksize = 128; - ; + memory "flash" + size = 1024; + offset = 0x4000; + page_size = 16; + blocksize = 128; + ; - memory "signature" - size = 3; - offset = 0x3fc0; - ; + memory "signature" + size = 3; + offset = 0x3fc0; + ; - memory "fuse" - size = 1; - offset = 0x3f40; - blocksize = 4; - ; + memory "fuse" + size = 1; + offset = 0x3f40; + blocksize = 4; + ; - memory "calibration" - size = 1; - offset = 0x3f80; - ; + memory "calibration" + size = 1; + offset = 0x3f80; + ; - memory "lockbits" - size = 1; - offset = 0x3f00; - ; + memory "lockbits" + size = 1; + offset = 0x3f00; + ; ; diff --git a/buildroot/tests/BIGTREE_GTR_V1_0 b/buildroot/tests/BIGTREE_GTR_V1_0 index e2e70e5f81..9323175986 100755 --- a/buildroot/tests/BIGTREE_GTR_V1_0 +++ b/buildroot/tests/BIGTREE_GTR_V1_0 @@ -27,7 +27,7 @@ opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \ Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z3_DRIVER_TYPE A4988 Z4_DRIVER_TYPE A4988 \ DEFAULT_Kp_LIST '{ 22.2, 20.0, 21.0, 19.0, 18.0 }' DEFAULT_Ki_LIST '{ 1.08 }' DEFAULT_Kd_LIST '{ 114.0, 112.0, 110.0, 108.0 }' opt_enable TOOLCHANGE_FILAMENT_SWAP TOOLCHANGE_MIGRATION_FEATURE TOOLCHANGE_FS_SLOW_FIRST_PRIME TOOLCHANGE_FS_PRIME_FIRST_USED \ - PID_PARAMS_PER_HOTEND Z_MULTI_ENDSTOPS TC_GCODE_USE_GLOBAL_X TC_GCODE_USE_GLOBAL_Y + REPRAP_DISCOUNT_SMART_CONTROLLER PID_PARAMS_PER_HOTEND Z_MULTI_ENDSTOPS TC_GCODE_USE_GLOBAL_X TC_GCODE_USE_GLOBAL_Y exec_test $1 $2 "BigTreeTech GTR | 6 Extruders | Quad Z + Endstops" "$3" restore_configs @@ -42,7 +42,7 @@ opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \ MPC_AMBIENT_XFER_COEFF '{ 0.068f, 0.068f, 0.068f }' \ 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 MPC_AUTOTUNE_MENU +opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SWITCHING_TOOLHEAD TOOL_SENSOR MPCTEMP MPC_EDIT_MENU MPC_AUTOTUNE MPC_AUTOTUNE_MENU opt_disable PIDTEMP exec_test $1 $2 "BigTreeTech GTR | MPC | Switching Toolhead | Tool Sensors" "$3" diff --git a/buildroot/tests/DUE b/buildroot/tests/DUE index 81e60c9623..590d76606c 100755 --- a/buildroot/tests/DUE +++ b/buildroot/tests/DUE @@ -27,7 +27,7 @@ opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS \ FWRETRACT ARC_SUPPORT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ PSU_CONTROL AUTO_POWER_CONTROL E_DUAL_STEPPER_DRIVERS \ PIDTEMPBED SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER \ - PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL \ + PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL MAX7219_REINIT_ON_POWERUP \ EXTENSIBLE_UI opt_add EXTUI_EXAMPLE exec_test $1 $2 "RAMPS4DUE_EFB with ABL (Bilinear), ExtUI, S-Curve, many options." "$3" diff --git a/buildroot/tests/LPC1769 b/buildroot/tests/LPC1769 index 9987d155ad..dd4f5f28ea 100755 --- a/buildroot/tests/LPC1769 +++ b/buildroot/tests/LPC1769 @@ -33,7 +33,7 @@ exec_test $1 $2 "Smoothieboard with TFTGLCD_PANEL_SPI and many features" "$3" # REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING \ # AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS \ # FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM \ -# SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \ +# SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \ # SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK GCODE_MACROS \ # VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS \ # EXTRA_FAN_SPEED FWRETRACT MENU_ADDAUTOSTART SDCARD_SORT_ALPHA diff --git a/buildroot/tests/Opulo_Lumen_REV3 b/buildroot/tests/Opulo_Lumen_REV3 index ddd8e1f3c9..f12f69011e 100755 --- a/buildroot/tests/Opulo_Lumen_REV3 +++ b/buildroot/tests/Opulo_Lumen_REV3 @@ -7,6 +7,7 @@ set -e use_example_configs Opulo/Lumen_REV3 +opt_disable TMC_DEBUG exec_test $1 $2 "Opulo Lumen REV3 Pick-and-Place" "$3" # cleanup diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index ad80605e61..44d818b624 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -11,25 +11,26 @@ set -e # use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_enable MARLIN_DEV_MODE BUFFER_MONITORING BLTOUCH AUTO_BED_LEVELING_BILINEAR Z_SAFE_HOMING -exec_test $1 $2 "Ender-3 v2 - CrealityUI" "$3" +exec_test $1 $2 "Ender-3 V2 - CrealityUI" "$3" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_disable DWIN_CREALITY_LCD opt_enable DWIN_CREALITY_LCD_JYERSUI AUTO_BED_LEVELING_BILINEAR PROBE_MANUALLY -exec_test $1 $2 "Ender-3 v2 - JyersUI (ABL Bilinear/Manual)" "$3" +exec_test $1 $2 "Ender-3 V2 - JyersUI (ABL Bilinear/Manual)" "$3" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_disable DWIN_CREALITY_LCD PIDTEMP opt_enable DWIN_MARLINUI_LANDSCAPE LCD_ENDSTOP_TEST AUTO_BED_LEVELING_UBL BLTOUCH Z_SAFE_HOMING MPCTEMP MPC_AUTOTUNE -exec_test $1 $2 "Ender-3 v2 - MarlinUI (UBL+BLTOUCH, MPCTEMP, LCD_ENDSTOP_TEST)" "$3" +exec_test $1 $2 "Ender-3 V2 - MarlinUI (UBL+BLTOUCH, MPCTEMP, LCD_ENDSTOP_TEST)" "$3" use_example_configs "Creality/Ender-3 S1/STM32F1" opt_disable DWIN_CREALITY_LCD Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN AUTO_BED_LEVELING_BILINEAR CANCEL_OBJECTS FWRETRACT EVENT_GCODE_SD_ABORT opt_enable DWIN_LCD_PROUI INDIVIDUAL_AXIS_HOMING_SUBMENU SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT 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 LCD_BED_TRAMMING \ - 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 BOOTSCREEN_TIMEOUT 1100 + LIMITED_MAX_FR_EDITING LIMITED_MAX_ACCEL_EDITING LIMITED_JERK_EDITING BAUD_RATE_GCODE \ + CASE_LIGHT_ENABLE CASE_LIGHT_MENU CASE_LIGHT_NO_BRIGHTNESS +opt_set PREHEAT_3_LABEL '"CUSTOM"' PREHEAT_3_TEMP_HOTEND 240 PREHEAT_3_TEMP_BED 60 PREHEAT_3_FAN_SPEED 128 BOOTSCREEN_TIMEOUT 1100 CASE_LIGHT_PIN 4 exec_test $1 $2 "Ender-3 S1 - ProUI (PIDTEMP)" "$3" restore_configs diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560 index c41e73640d..d61f17b51c 100755 --- a/buildroot/tests/mega2560 +++ b/buildroot/tests/mega2560 @@ -60,8 +60,8 @@ exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE | Sle # restore_configs opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO NUM_SERVOS 1 \ - EXTRUDERS 5 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 TEMP_SENSOR_3 1 TEMP_SENSOR_4 1 \ - NUM_RUNOUT_SENSORS 5 FIL_RUNOUT2_PIN 44 FIL_RUNOUT3_PIN 45 FIL_RUNOUT4_PIN 46 FIL_RUNOUT5_PIN 47 \ + EXTRUDERS 4 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 TEMP_SENSOR_3 1 TEMP_SENSOR_4 1 FAN_KICKSTART_TIME 500 \ + NUM_RUNOUT_SENSORS 4 FIL_RUNOUT2_PIN 44 FIL_RUNOUT3_PIN 45 FIL_RUNOUT4_PIN 46 FIL_RUNOUT5_PIN 47 \ FIL_RUNOUT3_STATE HIGH FILAMENT_RUNOUT_SCRIPT '"M600 T%c"' opt_enable VIKI2 BOOT_MARLIN_LOGO_ANIMATED SDSUPPORT AUTO_REPORT_SD_STATUS \ Z_PROBE_SERVO_NR Z_SERVO_ANGLES Z_SERVO_MEASURE_ANGLE DEACTIVATE_SERVOS_AFTER_MOVE Z_SERVO_DEACTIVATE_AFTER_STOW \ @@ -70,7 +70,7 @@ opt_enable VIKI2 BOOT_MARLIN_LOGO_ANIMATED SDSUPPORT AUTO_REPORT_SD_STATUS \ NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULLUP -exec_test $1 $2 "Z Servo Probe | Multiple runout sensors (x5)" "$3" +exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 4 | VIKI2 | Servo Probe | Multiple runout sensors (x4)" "$3" # # Extruder Only. No XYZ axes at all. @@ -96,7 +96,7 @@ opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO MIXING_STEPPERS 5 LCD_LANGUAGE ru \ opt_enable MIXING_EXTRUDER GRADIENT_MIX GRADIENT_VTOOL CR10_STOCKDISPLAY \ USE_CONTROLLER_FAN CONTROLLER_FAN_EDITABLE CONTROLLER_FAN_IGNORE_Z \ XY_AFTER_HOMING EVENT_GCODE_AFTER_HOMING \ - FILAMENT_RUNOUT_SENSOR ADVANCED_PAUSE_FEATURE NOZZLE_PARK_FEATURE INPUT_SHAPING_X INPUT_SHAPING_Y + FILAMENT_RUNOUT_SENSOR ADVANCED_PAUSE_FEATURE NOZZLE_PARK_FEATURE INPUT_SHAPING_X INPUT_SHAPING_Y INPUT_SHAPING_Z opt_disable DISABLE_OTHER_EXTRUDERS exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Input Shaping | Russian" "$3" diff --git a/buildroot/web-ui/data/www/index.html b/buildroot/web-ui/data/www/index.html index 1a8db1cafb..1628840634 100644 --- a/buildroot/web-ui/data/www/index.html +++ b/buildroot/web-ui/data/www/index.html @@ -384,7 +384,7 @@
-
GCode Lines
+
G-Code Lines
-
@@ -466,11 +466,11 @@
- GCode checksum value: + G-Code checksum value:  
- +
diff --git a/docs/Cutter.md b/docs/Cutter.md index c78b0551a0..8f4b7e67aa 100644 --- a/docs/Cutter.md +++ b/docs/Cutter.md @@ -4,7 +4,7 @@ With Marlin version 2.0.9.x or higher, Laser improvements were introduced that e ### Architecture -Laser selectable feature capability is defined through 4 global mode flags within gcode ,laser/spindle, planner and stepper routines. The default mode maintains the standard laser function. G-Codes are received, processed and parsed to determine what mode to set through M3, M4 and M5 commands. When the inline mode parameter set is detected, laser power processing will be driven through the planner and stepper routines. Handling of the initial power values and settings are performed by G-Code parsing and the laser/spindle routines. +Laser selectable feature capability is defined through 4 global mode flags within G-code ,laser/spindle, planner and stepper routines. The default mode maintains the standard laser function. G-Codes are received, processed and parsed to determine what mode to set through M3, M4 and M5 commands. When the inline mode parameter set is detected, laser power processing will be driven through the planner and stepper routines. Handling of the initial power values and settings are performed by G-Code parsing and the laser/spindle routines. Inline power feeds from the block->inline_power variable into the planner's laser.power when in continuous power mode. Further power adjustment will be applied if the laser power trap feature is active otherwise laser.power is used as set in the stepper for the entire block. When laser power trap is active the power levels are step incremented during acceleration and step decremented during deceleration. @@ -20,52 +20,52 @@ The following flow charts depict the flow control logic for spindle and laser op #### Spindle Mode Logic: - ┌──────────┐ ┌───────────┐ ┌───────────┐ - │M3 S-Value│ │Dir !same ?│ │Stepper │ - │Spindle │ │stop & wait│ │processes │ - ┌──┤Clockwise ├──┤ & start ├──┤moves │ - ┌─────┐ │ │ │ │spindle │ │ │ - │GCode│ │ └──────────┘ └───────────┘ └───────────┘ - │Send ├──┤ ┌──────────┐ ┌───────────┐ ┌───────────┐ - └─────┘ │ │M4 S-Value│ │Dir !same ?│ │Stepper │ - ├──┤Spindle ├──┤stop & wait├──┤processes │ - │ │Counter │ │& start │ │moves │ - │ │Clockwise │ │spindle │ │ │ - │ └──────────┘ └───────────┘ └───────────┘ - │ ┌──────────┐ ┌────────┐ - │ │M5 │ │Wait for│ - │ │Spindle ├──┤move & │ - └──┤Stop │ │disable │ - └──────────┘ └────────┘ - ┌──────────┐ ┌──────────┐ - Sensors─────┤Fault ├──┤Disable │ - └──────────┘ │power │ - └──────────┘ + ┌──────────┐ ┌───────────┐ ┌───────────┐ + │M3 S-Value│ │Dir !same ?│ │Stepper │ + │Spindle │ │stop & wait│ │processes │ + ┌──┤Clockwise ├──┤ & start ├──┤moves │ + ┌──────┐ │ │ │ │spindle │ │ │ + │G-Code│ │ └──────────┘ └───────────┘ └───────────┘ + │Send ├──┤ ┌──────────┐ ┌───────────┐ ┌───────────┐ + └──────┘ │ │M4 S-Value│ │Dir !same ?│ │Stepper │ + ├──┤Spindle ├──┤stop & wait├──┤processes │ + │ │Counter │ │& start │ │moves │ + │ │Clockwise │ │spindle │ │ │ + │ └──────────┘ └───────────┘ └───────────┘ + │ ┌──────────┐ ┌────────┐ + │ │M5 │ │Wait for│ + │ │Spindle ├──┤move & │ + └──┤Stop │ │disable │ + └──────────┘ └────────┘ + ┌──────────┐ ┌──────────┐ + Sensors─────┤Fault ├──┤Disable │ + └──────────┘ │power │ + └──────────┘ #### Laser Mode Logic: - ┌──────────┐ ┌─────────────┐ ┌───────────┐ - │M3,M4,M5 I│ │Set power │ │Stepper │ - ┌──┤Standard ├──┤Immediately &├──┤processes │ - │ │Default │ │wait for move│ │moves │ - │ │ │ │completion │ │ │ - │ └──────────┘ └─────────────┘ └───────────┘ - │ ┌──────────┐ ┌───────────┐ ┌───────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌───────────┐ - ┌─────┐ │ │M3 I │ │G0,G1,G2,G4│ │Planner │ │Planner │ │Planner fan │ │Planner │ │Stepper │ - │GCode│ │ │Continuous│ │M3 receive │ │sets block │ │sync power ?│ │sync power ?│ │trap power ?│ │uses block │ - │Send ├──┼──┤Inline ├──┤power from ├──┤power using├──┤process M3 ├──┤process fan ├──┤adjusts for ├──┤values to │ - └─────┘ │ │ │ │S-Value │ │Gx S-Value │ │power inline│ │power inline│ │accel/decel │ │apply power│ - │ └──────────┘ └───────────┘ └───────────┘ └────────────┘ └────────────┘ └────────────┘ └───────────┘ - │ ┌──────────┐ ┌───────────┐ ┌────────────────┐ ┌───────────┐ - │ │M4 I │ │Gx F-Value │ │Planner │ │Stepper │ - │ │Dynamic │ │set power │ │Calc & set block│ │uses block │ - └──┤Inline ├──┤or use ├──┤block power ├──┤values to │ - │ │ │default │ │using F-Value │ │apply power│ - └──────────┘ └───────────┘ └────────────────┘ └───────────┘ - ┌──────────┐ ┌──────────┐ - Sensors─────┤Fault ├──┤Disable │ - └──────────┘ │Power │ - └──────────┘ + ┌──────────┐ ┌─────────────┐ ┌───────────┐ + │M3,M4,M5 I│ │Set power │ │Stepper │ + ┌──┤Standard ├──┤Immediately &├──┤processes │ + │ │Default │ │wait for move│ │moves │ + │ │ │ │completion │ │ │ + │ └──────────┘ └─────────────┘ └───────────┘ + │ ┌──────────┐ ┌───────────┐ ┌───────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌───────────┐ + ┌──────┐ │ │M3 I │ │G0,G1,G2,G4│ │Planner │ │Planner │ │Planner fan │ │Planner │ │Stepper │ + │G-Code│ │ │Continuous│ │M3 receive │ │sets block │ │sync power ?│ │sync power ?│ │trap power ?│ │uses block │ + │Send ├──┼──┤Inline ├──┤power from ├──┤power using├──┤process M3 ├──┤process fan ├──┤adjusts for ├──┤values to │ + └──────┘ │ │ │ │S-Value │ │Gx S-Value │ │power inline│ │power inline│ │accel/decel │ │apply power│ + │ └──────────┘ └───────────┘ └───────────┘ └────────────┘ └────────────┘ └────────────┘ └───────────┘ + │ ┌──────────┐ ┌───────────┐ ┌────────────────┐ ┌───────────┐ + │ │M4 I │ │Gx F-Value │ │Planner │ │Stepper │ + │ │Dynamic │ │set power │ │Calc & set block│ │uses block │ + └──┤Inline ├──┤or use ├──┤block power ├──┤values to │ + │ │ │default │ │using F-Value │ │apply power│ + └──────────┘ └───────────┘ └────────────────┘ └───────────┘ + ┌──────────┐ ┌──────────┐ + Sensors─────┤Fault ├──┤Disable │ + └──────────┘ │Power │ + └──────────┘ @@ -81,7 +81,7 @@ A reduced entry laser power factor is based on the entry step rate to cruise ste block entry laser power = laser power * ( entry step rate / cruise step rate ) -The initial power will be set to no less than the laser_power_floor or the inital power calculation. +The initial power will be set to no less than the laser_power_floor or the initial power calculation. The reduced final power factor is based on the final step rate to cruise step rate ratio for deceleration. diff --git a/ini/features.ini b/ini/features.ini index 8e0cb964f1..cb3b96c402 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -28,8 +28,6 @@ SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub HAS_MOTOR_CURRENT_(I2C|DAC|SPI|PWM) = build_src_filter=+ HAS_MOTOR_CURRENT_I2C = SlowSoftI2CMaster build_src_filter=+ -HAS_TMC26X = TMC26XStepper=https://github.com/MarlinFirmware/TMC26XStepper/archive/a7d7c92a13.zip - build_src_filter=+ LIB_INTERNAL_MAX31865 = build_src_filter=+ NEOPIXEL_LED = adafruit/Adafruit NeoPixel@~1.8.0 build_src_filter=+ @@ -245,7 +243,7 @@ HAS_FANMUX = build_src_filter=+ + FWRETRACT = build_src_filter=+ + HOST_ACTION_COMMANDS = build_src_filter=+ -HOTEND_IDLE_TIMEOUT = build_src_filter=+ + +HOTEND_IDLE_TIMEOUT = build_src_filter=+ + JOYSTICK = build_src_filter=+ BLINKM = build_src_filter=+ HAS_COLOR_LEDS = build_src_filter=+ + @@ -301,7 +299,7 @@ SD_ABORT_ON_ENDSTOP_HIT = build_src_filter=+ HAS_SMART_EFF_MOD = build_src_filter=+ COOLANT_CONTROL|AIR_ASSIST = build_src_filter=+ -AIR_EVACUATION = build_src_filter=+ +AIR_EVACUATION = build_src_filter=+ HAS_SOFTWARE_ENDSTOPS = build_src_filter=+ SERVO_DETACH_GCODE = build_src_filter=+ HAS_DUPLICATION_MODE = build_src_filter=+ @@ -316,7 +314,6 @@ HAS_ZV_SHAPING = build_src_filter=+ GRADIENT_MIX = build_src_filter=+ NONLINEAR_EXTRUSION = build_src_filter=+ -OTA_FIRMWARE_UPDATE = build_src_filter=+ HAS_SAVED_POSITIONS = build_src_filter=+ + PARK_HEAD_ON_PAUSE = build_src_filter=+ FILAMENT_LOAD_UNLOAD_GCODES = build_src_filter=+ @@ -342,6 +339,7 @@ TOUCH_SCREEN_CALIBRATION = build_src_filter=+ GCODE_MOTION_MODES = build_src_filter=+ BABYSTEPPING = build_src_filter=+ + +OTA_FIRMWARE_UPDATE = build_src_filter=+ Z_PROBE_SLED = build_src_filter=+ G38_PROBE_TARGET = build_src_filter=+ MAGNETIC_PARKING_EXTRUDER = build_src_filter=+ @@ -365,6 +363,7 @@ NEED_LSF = build_src_filter=+ + NOZZLE_CLEAN_FEATURE = build_src_filter=+ + DELTA = build_src_filter=+ + +POLAR = build_src_filter=+ POLARGRAPH = build_src_filter=+ BEZIER_CURVE_SUPPORT = build_src_filter=+ + PRINTCOUNTER = build_src_filter=+ diff --git a/ini/hc32.ini b/ini/hc32.ini index d25ef4e7be..c9533bad17 100644 --- a/ini/hc32.ini +++ b/ini/hc32.ini @@ -33,22 +33,14 @@ build_src_filter = ${common.default_src_filter} + + +# Environment specifically for unit testing through the Makefile +# This is somewhat unorthodox, in that it uses the PlatformIO Unity testing framework, +# but actual targets are dynamically generated during the build. This seems to prevent +# Unity from being automatically included, so it is added here. +[env:linux_native_test] +extends = env:linux_native +extra_scripts = ${common.extra_scripts} + post:buildroot/share/PlatformIO/scripts/collect-code-tests.py +build_src_filter = ${env:linux_native.build_src_filter} + +lib_deps = throwtheswitch/Unity@^2.5.2 +test_build_src = true +build_unflags = +build_flags = ${env:linux_native.build_flags} -Werror + # # Native Simulation # Builds with a small subset of available features @@ -36,19 +49,20 @@ build_src_filter = ${common.default_src_filter} + [simulator_common] platform = native framework = -build_flags = ${common.build_flags} -std=gnu++17 -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS +build_flags = ${common.build_flags} -std=gnu++17 -I/usr/include/SDL2 -IMarlin -IMarlin/src/HAL/NATIVE_SIM/u8g + -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS -DGLM_ENABLE_EXPERIMENTAL build_src_flags = -Wall -Wno-expansion-to-defined -Wno-deprecated-declarations -Wcast-align release_flags = -g0 -O3 -flto 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/8791f3ff43.zip - Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/c6b319f447.zip - LiquidCrystal=https://github.com/p3p/LiquidCrystal/archive/322fb5fc23.zip -extra_scripts = ${common.extra_scripts} - pre:buildroot/share/PlatformIO/scripts/simulator.py + MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/66a2b82c8f.zip + Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/c6b319f447.zip + LiquidCrystal=https://github.com/p3p/LiquidCrystal/archive/322fb5fc23.zip +extra_scripts = ${common.extra_scripts} + pre:buildroot/share/PlatformIO/scripts/simulator.py [simulator_linux] extends = simulator_common diff --git a/ini/renamed.ini b/ini/renamed.ini index 84f6acd7fa..85f2df2862 100644 --- a/ini/renamed.ini +++ b/ini/renamed.ini @@ -95,3 +95,6 @@ extends = renamed [env:STM32F407ZE_btt_USB] ;=> STM32F407ZE_btt_usb_flash_drive extends = renamed + +[env:STM32F446_tronxy] ;=> TRONXY_CXY_446_V10 +extends = renamed diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index de0a5c7d37..9c6f751746 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -111,7 +111,7 @@ extends = stm32_variant board = marlin_opulo_lumen_rev3 build_flags = ${stm32_variant.build_flags} -DARDUINO_BLACK_F407VE - -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS + -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS -DHAS_STM32_UID extra_scripts = ${stm32_variant.extra_scripts} # @@ -122,7 +122,7 @@ extends = stm32_variant board = marlin_opulo_lumen_rev4 build_flags = ${stm32_variant.build_flags} -DARDUINO_BLACK_F407VE - -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS + -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS -DHAS_STM32_UID extra_scripts = ${stm32_variant.extra_scripts} # @@ -812,17 +812,29 @@ upload_protocol = dfu upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE" # -# STM32F446ZET6 ARM Cortex-M4 +# TRONXY_CXY_446_V10 (STM32F446ZET6 ARM Cortex-M4) # -[env:STM32F446_tronxy] -extends = stm32_variant -board = marlin_STM32F446ZET_tronxy -board_build.offset = 0x10000 -board_build.rename = fmw_tronxy.bin -build_flags = ${stm32_variant.build_flags} - -DSTM32F4xx -build_unflags = ${stm32_variant.build_unflags} -fno-rtti - -DUSBCON -DUSBD_USE_CDC +[env:TRONXY_CXY_446_V10] +extends = stm32_variant +board = marlin_STM32F446ZET_tronxy +board_build.ldscript = buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/ldscript.ld +board_build.offset = 0x10000 +board_build.rename = fmw_tronxy.bin +build_flags = ${stm32_variant.build_flags} + -DSTM32F4xx -DUSE_USB_HS + -DUSE_USB_HS_IN_FS +build_unflags = ${stm32_variant.build_unflags} -fno-rtti + -fno-threadsafe-statics -fno-exceptions + -DUSBD_USE_CDC -DUSBCON +extra_scripts = ${stm32_variant.extra_scripts} + buildroot/share/PlatformIO/scripts/tronxy_cxy_446_v10.py + +# +# TRONXY_CXY_446_V10 (STM32F446ZET6 ARM Cortex-M4) with USB Flash Drive Support +# +[env:TRONXY_CXY_446_V10_usb_flash_drive] +extends = env:TRONXY_CXY_446_V10 +platform_packages = ${stm_flash_drive.platform_packages} # # Blackpill diff --git a/ini/stm32g0.ini b/ini/stm32g0.ini index 8da5ab230f..77bdde7438 100644 --- a/ini/stm32g0.ini +++ b/ini/stm32g0.ini @@ -57,6 +57,7 @@ board_build.offset = 0x2000 board_upload.offset_address = 0x08002000 build_flags = ${stm32_variant.build_flags} -DPIN_SERIAL4_RX=PC_11 -DPIN_SERIAL4_TX=PC_10 + -DPIN_SERIAL5_RX=PD_2 -DPIN_SERIAL5_TX=PD_3 -DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024 -DTIMER_SERVO=TIM3 -DTIMER_TONE=TIM4 -DSTEP_TIMER_IRQ_PRIO=0 diff --git a/test/001-default.ini b/test/001-default.ini new file mode 100644 index 0000000000..b98042cc2d --- /dev/null +++ b/test/001-default.ini @@ -0,0 +1,8 @@ +# This file should remain empty except for the motherboard. +# If changes are needed by tests, it should be performed in another configuration. + +[config:base] +ini_use_config = base + +# Unit tests must use BOARD_SIMULATED to run natively in Linux +motherboard = BOARD_SIMULATED diff --git a/test/002-extruders_1_runout.ini b/test/002-extruders_1_runout.ini new file mode 100644 index 0000000000..74afa0f02f --- /dev/null +++ b/test/002-extruders_1_runout.ini @@ -0,0 +1,18 @@ +# +# Test configuration with a single extruder and a filament runout sensor +# +[config:base] +ini_use_config = base + +# Unit tests must use BOARD_SIMULATED to run natively in Linux +motherboard = BOARD_SIMULATED + +# Options to support runout sensors test +filament_runout_sensor = on +fil_runout_pin = 4 # dummy +advanced_pause_feature = on +emergency_parser = on +nozzle_park_feature = on + +# Option to support testing parsing with parentheses comments enabled +paren_comments = on diff --git a/test/003-extruders_3_runout.ini b/test/003-extruders_3_runout.ini new file mode 100644 index 0000000000..e473faeec3 --- /dev/null +++ b/test/003-extruders_3_runout.ini @@ -0,0 +1,23 @@ +# +# Test configuration with three extruders and filament runout sensors +# +[config:base] +ini_use_config = base + +# Unit tests must use BOARD_SIMULATED to run natively in Linux +motherboard = BOARD_SIMULATED + +# Options to support runout sensor tests on three extruders. +# Options marked "dummy" are simply required to pass sanity checks. +extruders = 3 +temp_sensor_1 = 1 +temp_sensor_2 = 1 +num_runout_sensors = 3 +filament_runout_sensor = on +fil_runout_pin = 4 # dummy +fil_runout2_pin = 4 # dummy +fil_runout3_pin = 4 # dummy +filament_runout_script = "M600 %%c" +advanced_pause_feature = on +emergency_parser = on +nozzle_park_feature = on diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000000..19b4cd7d59 --- /dev/null +++ b/test/README.md @@ -0,0 +1,40 @@ +# Testing Marlin + +Marlin included two types of automated tests: +- [Build Tests](../buildroot/tests) to catch syntax and code build errors. +- Unit Tests (this folder) to catch implementation errors. + +This document focuses on Unit tests. + +## Unit tests + +Unit testing allows for functional testing of Marlin logic on a local machine. This strategy is available to all developers, and will be able to be used on generic GitHub workers to automate testing. While PlatformIO does support the execution of unit tests on target controllers, that is not yet implemented and not really practical. This would require dedicated testing labs, and would be less broadly usable than testing directly on the development or build machine. + +Unit tests verify the behavior of small discrete sections of Marlin code. By thoroughly unit testing important parts of Marlin code, we effectively provide "guard rails" which will prevent major regressions in behavior. As long as all submissions go through the Pull Request process and execute automated checks, it is possible to catch most major issues prior to completion of a PR. + +## What unit tests can and can't do + +Unit tests can be used to validate the logic of single functions or whole features, as long as that function or feature doesn't depend on real hardware. So, for example, we can test whether a G-code command is parsed correctly and produces all the expected state changes, but we can't test whether a G-code triggered an endstop or the filament runout sensor without adding a new layer to simulate pins. + +Generally speaking, the types of errors caught by unit tests are most often caught in the initial process of writing the tests, and thereafter they shore up the codebase against regressions, especially in core classes and types, which can be very useful for refactoring. + +### Unit test FAQ + +#### Q: Isn't writing unit tests a lot of work? +A: Yes, and it can be especially difficult with existing code that wasn't designed for unit testing. Some common sense should be used to decide where to employ unit testing, and at what level to perform it. While unit testing takes effort, it pays dividends in preventing regressions, and helping to pinpoint the source of failures when they do occur. + +#### Q: Will this make refactoring harder? +A: Yes and No. Of course if you refactor code that unit tests use directly, it will have to be reworked as well. It actually can make refactoring more efficient, by providing assurance that the mechanism still works as intended. + +#### Q: How can I debug one of these failing unit tests? +A: That's a great question, without a known immediate answer. It is likely possible to debug them interactively through PlatformIO, but that can at times take some creativity to configure. Unit tests are generally extremely small, so even without interactive debugging it can get you fairly close to the cause of the problem. + +### Unit test architecture +We are currently using [PlatformIO unit tests](https://docs.platformio.org/en/latest/plus/unit-testing.html). + +Since Marlin only compiles code required by the configuration, a separate test binary must be generated for any configuration change. The following process is used to unit test a variety of configurations: + +1. This folder contains a set of INI configuration files (See `config.ini`), each containing a distinct set of configuration options for unit testing. All applicable unit tests will be run for each of these configurations. +2. The `Marlin/tests` folder contains the CPP code for all Unit Tests. Marlin macros (`ENABLED(feature)`, `TERN(FEATURE, A, B)`, etc.) are used to determine which tests should be registered and to alter test behavior. +3. The `linux_native_test` PlatformIO environment specifies a script to collect all the tests from this folder and add them to PlatformIO's list of test targets. +4. Tests are built and executed by the `Makefile` commands `unit-test-all-local` or `unit-test-all-local-docker`. diff --git a/test/unit_tests.cpp b/test/unit_tests.cpp new file mode 100644 index 0000000000..e22aa529d0 --- /dev/null +++ b/test/unit_tests.cpp @@ -0,0 +1,53 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Provide the main() function used for all compiled unit test binaries. + * It collects all the tests defined in the code and runs them through Unity. + */ + +#include "unit_tests.h" + +static std::list all_marlin_tests; + +MarlinTest::MarlinTest(const std::string _name, const void(*_test)(), const char *_file, const int _line) +: name(_name), test(_test), file(_file), line(_line) { + all_marlin_tests.push_back(this); +} + +void MarlinTest::run() { + Unity.TestFile = file.c_str(); + UnityDefaultTestRun((UnityTestFunction)test, name.c_str(), line); +} + +void run_all_marlin_tests() { + for (const auto registration : all_marlin_tests) { + registration->run(); + } +} + +int main(int argc, char **argv) { + UNITY_BEGIN(); + run_all_marlin_tests(); + UNITY_END(); + return 0; +} diff --git a/test/unit_tests.h b/test/unit_tests.h new file mode 100644 index 0000000000..53bb64074a --- /dev/null +++ b/test/unit_tests.h @@ -0,0 +1,74 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include +#include +#include + +// Include MarlinConfig so configurations are available to all tests +#include "src/inc/MarlinConfig.h" + +/** + * Class that allows us to dynamically collect tests + */ +class MarlinTest { +public: + MarlinTest(const std::string name, const void(*test)(), const char *_file, const int line); + /** + * Run the test via Unity + */ + void run(); + + /** + * The name, a pointer to the function, and the line number. These are + * passed to the Unity test framework. + */ + const std::string name; + const void(*test)(); + const std::string file; + const int line; +}; + +/** + * Internal macros used by MARLIN_TEST + */ +#define _MARLIN_TEST_CLASS_NAME(SUITE, NAME) MarlinTestClass_##SUITE##_##NAME +#define _MARLIN_TEST_INSTANCE_NAME(SUITE, NAME) MarlinTestClass_##SUITE##_##NAME##_instance + +/** + * Macro to define a test. This will create a class with the test body and + * register it with the global list of tests. + * + * Usage: + * MARLIN_TEST(test_suite_name, test_name) { + * // Test body + * } + */ +#define MARLIN_TEST(SUITE, NAME) \ + class _MARLIN_TEST_CLASS_NAME(SUITE, NAME) : public MarlinTest { \ + public: \ + _MARLIN_TEST_CLASS_NAME(SUITE, NAME)() : MarlinTest(#SUITE "___" #NAME, (const void(*)())&TestBody, __FILE__, __LINE__) {} \ + static void TestBody(); \ + }; \ + const _MARLIN_TEST_CLASS_NAME(SUITE, NAME) _MARLIN_TEST_INSTANCE_NAME(SUITE, NAME); \ + void _MARLIN_TEST_CLASS_NAME(SUITE, NAME)::TestBody()