Compare commits

..

2 Commits

Author SHA1 Message Date
InsanityAutomation 2af4a5dd93 Update pins_RAMPS.h 2024-04-10 21:19:44 -04:00
InsanityAutomation 82c21461c4 Allows RAMPS to auto assign HW SPI Pins for TMC 2024-04-10 19:38:31 -04:00
324 changed files with 2681 additions and 5749 deletions
-73
View File
@@ -1,73 +0,0 @@
#
# 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
-51
View File
@@ -1,51 +0,0 @@
#
# 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
@@ -1,9 +1,9 @@
# #
# ci-build-tests.yml # test-builds.yml
# Do test builds to catch compile errors # Do test builds to catch compile errors
# #
name: CI - Build Tests name: CI
on: on:
pull_request: pull_request:
@@ -14,8 +14,6 @@ on:
- config/** - config/**
- data/** - data/**
- docs/** - docs/**
- test/**
- Marlin/tests/**
- '**/*.md' - '**/*.md'
push: push:
branches: branches:
@@ -25,13 +23,11 @@ on:
- config/** - config/**
- data/** - data/**
- docs/** - docs/**
- test/**
- Marlin/tests/**
- '**/*.md' - '**/*.md'
jobs: jobs:
test_builds: test_builds:
name: Build Test name: Run All Tests
if: github.repository == 'MarlinFirmware/Marlin' if: github.repository == 'MarlinFirmware/Marlin'
runs-on: ubuntu-latest runs-on: ubuntu-latest
+7 -46
View File
@@ -2,23 +2,17 @@ SCRIPTS_DIR := buildroot/share/scripts
CONTAINER_RT_BIN := docker CONTAINER_RT_BIN := docker
CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio
CONTAINER_IMAGE := marlin-dev CONTAINER_IMAGE := marlin-dev
UNIT_TEST_CONFIG ?= default
help: help:
@echo "Tasks for local development:" @echo "Tasks for local development:"
@echo "make marlin : Build marlin for the configured board" @echo "make marlin : Build marlin for the configured board"
@echo "make format-pins -j : Reformat all pins files (-j for parallel execution)" @echo "make format-pins : Reformat all pins files"
@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-ci : Run a single test from inside the CI"
@echo "make tests-single-local : Run a single test locally" @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-single-local-docker : Run a single test locally, using docker"
@echo "make tests-all-local : Run all tests locally" @echo "make tests-all-local : Run all tests locally"
@echo "make tests-all-local-docker : Run all tests locally, using docker" @echo "make tests-all-local-docker : Run all tests locally, using docker"
@echo "make unit-test-single-local : Run unit tests for a single config locally" @echo "make setup-local-docker : Build the local docker image"
@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 ""
@echo "Options for testing:" @echo "Options for testing:"
@echo " TEST_TARGET Set when running tests-single-*, to select the" @echo " TEST_TARGET Set when running tests-single-*, to select the"
@@ -28,9 +22,6 @@ help:
@echo " run on GitHub CI" @echo " run on GitHub CI"
@echo " ONLY_TEST Limit tests to only those that contain this, or" @echo " ONLY_TEST Limit tests to only those that contain this, or"
@echo " the index of the test (1-based)" @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 " 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 " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:"
@echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!" @echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!"
@@ -52,53 +43,23 @@ tests-single-local:
tests-single-local-docker: tests-single-local-docker:
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local-docker" ; return 1; fi @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> 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 @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: 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 PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
&& for TEST_TARGET in $$(python $(SCRIPTS_DIR)/get_test_targets.py) ; do \ && for TEST_TARGET in $$($(SCRIPTS_DIR)/get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done
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: tests-all-local-docker:
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; 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-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: setup-local-docker:
$(CONTAINER_RT_BIN) buildx build -t $(CONTAINER_IMAGE) -f docker/Dockerfile . $(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h') PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')
.PHONY: $(PINS) format-pins validate-pins
$(PINS): %: $(PINS): %:
@echo "Formatting $@" @echo "Formatting $@" && node $(SCRIPTS_DIR)/pinsformat.js $@
@python $(SCRIPTS_DIR)/pinsformat.py $< $@
format-pins: $(PINS) 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)
+2 -2
View File
@@ -672,7 +672,7 @@
* MPCTEMP : Predictive Model temperature control. (~1.8K without auto-tune) * 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 PIDTEMP // See the PID Tuning Guide at https://reprap.org/wiki/PID_Tuning
//#define MPCTEMP // See https://marlinfw.org/docs/features/model_predictive_control.html //#define MPCTEMP // ** EXPERIMENTAL ** 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_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 #define PID_K1 0.95 // Smoothing factor within any PID loop
@@ -2218,7 +2218,7 @@
#if ENABLED(LCD_BED_TRAMMING) #if ENABLED(LCD_BED_TRAMMING)
#define BED_TRAMMING_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets #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_HEIGHT 0.0 // (mm) Z height of nozzle at tramming points
#define BED_TRAMMING_Z_HOP 4.0 // (mm) Z raise between tramming points #define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between tramming points
//#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner //#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner
//#define BED_TRAMMING_USE_PROBE //#define BED_TRAMMING_USE_PROBE
#if ENABLED(BED_TRAMMING_USE_PROBE) #if ENABLED(BED_TRAMMING_USE_PROBE)
+12 -12
View File
@@ -1185,19 +1185,24 @@
* Zero Vibration (ZV) Input Shaping for X and/or Y movements. * 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 * This option uses a lot of SRAM for the step buffer. The buffer size is
* calculated automatically from SHAPING_FREQ_[XYZ], DEFAULT_AXIS_STEPS_PER_UNIT, * calculated automatically from SHAPING_FREQ_[XY], DEFAULT_AXIS_STEPS_PER_UNIT,
* DEFAULT_MAX_FEEDRATE and ADAPTIVE_STEP_SMOOTHING. The default calculation can * DEFAULT_MAX_FEEDRATE and ADAPTIVE_STEP_SMOOTHING. The default calculation can
* be overridden by setting SHAPING_MIN_FREQ and/or SHAPING_MAX_FEEDRATE. * 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. * 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 * If the buffer is too small at runtime, input shaping will have reduced
* effectiveness during high speed movements. * effectiveness during high speed movements.
* *
* Tune with M593 D<factor> F<frequency> * Tune with M593 D<factor> F<frequency>:
*
* D<factor> Set the zeta/damping factor. If axes (X, Y, etc.) are not specified, set for all axes.
* F<frequency> 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.
*/ */
//#define INPUT_SHAPING_X //#define INPUT_SHAPING_X
//#define INPUT_SHAPING_Y //#define INPUT_SHAPING_Y
//#define INPUT_SHAPING_Z #if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y, INPUT_SHAPING_Z)
#if ENABLED(INPUT_SHAPING_X) #if ENABLED(INPUT_SHAPING_X)
#define SHAPING_FREQ_X 40.0 // (Hz) The default dominant resonant frequency on the X axis. #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). #define SHAPING_ZETA_X 0.15 // Damping ratio of the X axis (range: 0.0 = no damping to 1.0 = critical damping).
@@ -1206,10 +1211,6 @@
#define SHAPING_FREQ_Y 40.0 // (Hz) The default dominant resonant frequency on the Y axis. #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). #define SHAPING_ZETA_Y 0.15 // Damping ratio of the Y axis (range: 0.0 = no damping to 1.0 = critical damping).
#endif #endif
#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_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_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. //#define SHAPING_MENU // Add a menu to the LCD to set shaping parameters.
@@ -1583,7 +1584,7 @@
#if HAS_MARLINUI_U8GLIB #if HAS_MARLINUI_U8GLIB
//#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash. //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash.
#endif #endif
#if ANY(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, HAS_MARLINUI_HD44780) #if ANY(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE)
//#define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup. //#define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup.
#endif #endif
#endif #endif
@@ -2697,7 +2698,7 @@
* This feature is EXPERIMENTAL so use with caution and test thoroughly. * 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 * Enable this option to receive data on the serial ports via the onboard DMA
* controller for more stable and reliable high-speed serial communication. * controller for more stable and reliable high-speed serial communication.
* Support is currently limited to some STM32 MCUs and all HC32 MCUs. * Only some STM32 MCUs are currently supported.
* Note: This has no effect on emulated USB serial ports. * Note: This has no effect on emulated USB serial ports.
*/ */
//#define SERIAL_DMA //#define SERIAL_DMA
@@ -4260,8 +4261,7 @@
/** /**
* Instant freeze / unfreeze functionality * Instant freeze / unfreeze functionality
* Potentially useful for rapid stop that allows being resumed. Halts stepper movement. * Potentially useful for emergency stop that allows being resumed.
* Note this does NOT pause spindles, lasers, fans, heaters or any other auxiliary device.
* @section interface * @section interface
*/ */
//#define FREEZE_FEATURE //#define FREEZE_FEATURE
+1 -1
View File
@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release * here we define this default string as the date where the latest release
* version was tagged. * version was tagged.
*/ */
//#define STRING_DISTRIBUTION_DATE "2024-05-29" //#define STRING_DISTRIBUTION_DATE "2024-04-10"
/** /**
* Defines a generic printer name to be output to the LCD after booting Marlin. * Defines a generic printer name to be output to the LCD after booting Marlin.
+1 -1
View File
@@ -141,7 +141,7 @@ typedef Servo hal_servo_t;
#error "LCD_SERIAL_PORT must be from 0 to 3." #error "LCD_SERIAL_PORT must be from 0 to 3."
#endif #endif
#define LCD_SERIAL lcdSerial #define LCD_SERIAL lcdSerial
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI) #if HAS_DGUS_LCD
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free() #define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.get_tx_buffer_free()
#endif #endif
#endif #endif
+1 -1
View File
@@ -629,7 +629,7 @@ MSerialT1 customizedSerial1(MSerialT1::HasEmergencyParser);
template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >; template class MarlinSerial< LCDSerialCfg<LCD_SERIAL_PORT> >;
MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser); MSerialLCD lcdSerial(MSerialLCD::HasEmergencyParser);
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI) #if HAS_DGUS_LCD
template<typename Cfg> template<typename Cfg>
typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() { typename MarlinSerial<Cfg>::ring_buffer_pos_t MarlinSerial<Cfg>::get_tx_buffer_free() {
const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send. const ring_buffer_pos_t t = tx_buffer.tail, // next byte to send.
+1 -1
View File
@@ -205,7 +205,7 @@
static ring_buffer_pos_t available(); static ring_buffer_pos_t available();
static void write(const uint8_t c); static void write(const uint8_t c);
static void flushTX(); static void flushTX();
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI) #if HAS_DGUS_LCD
static ring_buffer_pos_t get_tx_buffer_free(); static ring_buffer_pos_t get_tx_buffer_free();
#endif #endif
+1 -1
View File
@@ -61,7 +61,7 @@
#else #else
#define G2_PWM_Z 0 #define G2_PWM_Z 0
#endif #endif
#if HAS_MOTOR_CURRENT_PWM_E #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
#define G2_PWM_E 1 #define G2_PWM_E 1
#else #else
#define G2_PWM_E 0 #define G2_PWM_E 0
+16 -14
View File
@@ -18,32 +18,32 @@ extern "C" {
void sd_mmc_spi_mem_init() { void sd_mmc_spi_mem_init() {
} }
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 !media_ready(); }
Ctrl_status sd_mmc_spi_test_unit_ready() { Ctrl_status sd_mmc_spi_test_unit_ready() {
#ifdef DISABLE_DUE_SD_MMC #ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
#endif #endif
if (!media_ready()) return CTRL_NO_PRESENT; if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
return CTRL_GOOD; return CTRL_GOOD;
} }
// NOTE: This function is defined as returning the address of the last block // NOTE: This function is defined as returning the address of the last block
// in the card, which is cardSize() - 1 // in the card, which is cardSize() - 1
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) { Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
if (!media_ready()) return CTRL_NO_PRESENT; if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
*nb_sector = card.diskIODriver()->cardSize() - 1; *nb_sector = card.diskIODriver()->cardSize() - 1;
return CTRL_GOOD; return CTRL_GOOD;
} }
bool sd_mmc_spi_unload(bool) { return true; }
bool sd_mmc_spi_wr_protect() { return false; }
bool sd_mmc_spi_removal() {
return (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted());
}
#if ACCESS_USB == true #if ACCESS_USB == true
/** /**
* \name MEM <-> USB Interface * \name MEM <-> USB Interface
@@ -61,7 +61,8 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
#ifdef DISABLE_DUE_SD_MMC #ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
#endif #endif
if (!media_ready()) return CTRL_NO_PRESENT; if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
#ifdef DEBUG_MMC #ifdef DEBUG_MMC
{ {
@@ -100,7 +101,8 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
#ifdef DISABLE_DUE_SD_MMC #ifdef DISABLE_DUE_SD_MMC
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
#endif #endif
if (!media_ready()) return CTRL_NO_PRESENT; if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.isMounted())
return CTRL_NO_PRESENT;
#ifdef DEBUG_MMC #ifdef DEBUG_MMC
{ {
+8 -8
View File
@@ -74,7 +74,7 @@
//! //!
//! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI. //! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI.
//!/ //!/
void sd_mmc_spi_mem_init(); extern void sd_mmc_spi_mem_init(void);
//! //!
//! @brief This function tests the state of the SD_MMC memory and sends it to the Host. //! @brief This function tests the state of the SD_MMC memory and sends it to the Host.
@@ -87,7 +87,7 @@ void sd_mmc_spi_mem_init();
//! Media not present -> CTRL_NO_PRESENT //! Media not present -> CTRL_NO_PRESENT
//! Media has changed -> CTRL_BUSY //! Media has changed -> CTRL_BUSY
//!/ //!/
Ctrl_status sd_mmc_spi_test_unit_ready(); extern Ctrl_status sd_mmc_spi_test_unit_ready(void);
//! //!
//! @brief This function gives the address of the last valid sector. //! @brief This function gives the address of the last valid sector.
@@ -98,7 +98,7 @@ Ctrl_status sd_mmc_spi_test_unit_ready();
//! Media ready -> CTRL_GOOD //! Media ready -> CTRL_GOOD
//! Media not present -> CTRL_NO_PRESENT //! Media not present -> CTRL_NO_PRESENT
//!/ //!/
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector); extern Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector);
/*! \brief Unload/Load the SD/MMC card selected /*! \brief Unload/Load the SD/MMC card selected
* *
@@ -109,7 +109,7 @@ Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector);
* *
* \return \c true if unload/load done success. * \return \c true if unload/load done success.
*/ */
bool sd_mmc_spi_unload(bool unload); extern bool sd_mmc_spi_unload(bool unload);
//! //!
//! @brief This function returns the write protected status of the memory. //! @brief This function returns the write protected status of the memory.
@@ -120,14 +120,14 @@ bool sd_mmc_spi_unload(bool unload);
//! //!
//! @return false -> the memory is not write-protected (always) //! @return false -> the memory is not write-protected (always)
//!/ //!/
bool sd_mmc_spi_wr_protect(); extern bool sd_mmc_spi_wr_protect(void);
//! //!
//! @brief This function tells if the memory has been removed or not. //! @brief This function tells if the memory has been removed or not.
//! //!
//! @return false -> The memory isn't removed //! @return false -> The memory isn't removed
//! //!
bool sd_mmc_spi_removal(); extern bool sd_mmc_spi_removal(void);
//---- ACCESS DATA FUNCTIONS ---- //---- ACCESS DATA FUNCTIONS ----
@@ -147,7 +147,7 @@ bool sd_mmc_spi_removal();
//! It is ready -> CTRL_GOOD //! It is ready -> CTRL_GOOD
//! A error occur -> CTRL_FAIL //! A error occur -> CTRL_FAIL
//! //!
Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector); extern Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector);
//! This function initializes the SD/MMC memory for a write operation //! This function initializes the SD/MMC memory for a write operation
//! //!
@@ -161,7 +161,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector);
//! It is ready -> CTRL_GOOD //! It is ready -> CTRL_GOOD
//! An error occurs -> CTRL_FAIL //! An error occurs -> CTRL_FAIL
//! //!
Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector); extern Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector);
#endif // #if ACCESS_USB == true #endif // #if ACCESS_USB == true
+1 -20
View File
@@ -142,31 +142,12 @@
// ADC // ADC
// //
#define HAL_ADC_VREF_MV 3300 #define HAL_ADC_VREF_MV 3300
#define HAL_ADC_RESOLUTION 12 #define HAL_ADC_RESOLUTION 10
#define GET_PIN_MAP_PIN(index) index #define GET_PIN_MAP_PIN(index) index
#define GET_PIN_MAP_INDEX(pin) pin #define GET_PIN_MAP_INDEX(pin) pin
#define PARSED_PIN_INDEX(code, dval) parser.intval(code, dval) #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 // MarlinHAL implementation
// //
+2 -33
View File
@@ -123,11 +123,6 @@ void MarlinHAL::init() {
// Register min serial // Register min serial
TERN_(POSTMORTEM_DEBUGGING, install_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() {} void MarlinHAL::init_board() {}
@@ -152,31 +147,7 @@ void MarlinHAL::delay_ms(const int ms) {
delay(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() { uint8_t MarlinHAL::get_reset_source() {
// Query reset cause from RMU // Query reset cause from RMU
@@ -232,9 +203,7 @@ int MarlinHAL::freeMemory() {
return &top - _sbrk(0); return &top - _sbrk(0);
} }
void MarlinHAL::adc_init() { void MarlinHAL::adc_init() {}
analogReadResolution(HAL_ADC_RESOLUTION);
}
void MarlinHAL::adc_enable(const pin_t pin) { void MarlinHAL::adc_enable(const pin_t pin) {
#if TEMP_SENSOR_SOC #if TEMP_SENSOR_SOC
+3 -23
View File
@@ -46,34 +46,14 @@ constexpr bool serial_handles_emergency(int port) {
// //
// Define serial ports // 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), \ MSerialT name(serial_handles_emergency(n), \
&USART##n##_config, \ &USART##n##_config, \
BOARD_USART##n##_TX_PIN, \ BOARD_USART##n##_TX_PIN, \
BOARD_USART##n##_RX_PIN); BOARD_USART##n##_RX_PIN);
// serial port where RX uses DMA and TX uses IRQs DEFINE_HWSERIAL_MARLIN(MSerial1, 1);
// all serial ports use DMA1 DEFINE_HWSERIAL_MARLIN(MSerial2, 2);
// 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 // Serial port assertions
+8 -38
View File
@@ -25,42 +25,17 @@
#include <drivers/usart/Usart.h> #include <drivers/usart/Usart.h>
// Optionally set uart IRQ priority to reduce overflow errors // Optionally set uart IRQ priority to reduce overflow errors
//#define UART_RX_IRQ_PRIO 1 // #define UART_IRQ_PRIO 1
//#define UART_TX_IRQ_PRIO 1
//#define UART_RX_DMA_IRQ_PRIO 1
struct MarlinSerial : public Usart { struct MarlinSerial : public Usart {
MarlinSerial( MarlinSerial(struct usart_config_t *usart_device, gpio_pin_t tx_pin, gpio_pin_t rx_pin) : Usart(usart_device, tx_pin, rx_pin) {}
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
}
#if defined(UART_RX_IRQ_PRIO) || defined(UART_TX_IRQ_PRIO) || defined(UART_RX_DMA_IRQ_PRIO) #ifdef UART_IRQ_PRIO
void setPriority() { void setPriority() {
#if defined(UART_RX_IRQ_PRIO) NVIC_SetPriority(c_dev()->interrupts.rx_data_available.interrupt_number, UART_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_IRQ_PRIO);
NVIC_SetPriority(c_dev()->interrupts.rx_error.interrupt_number, UART_RX_IRQ_PRIO); NVIC_SetPriority(c_dev()->interrupts.tx_buffer_empty.interrupt_number, UART_IRQ_PRIO);
#endif NVIC_SetPriority(c_dev()->interrupts.tx_complete.interrupt_number, UART_IRQ_PRIO);
#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) { void begin(uint32_t baud) {
@@ -72,12 +47,7 @@ struct MarlinSerial : public Usart {
Usart::begin(baud, config); Usart::begin(baud, config);
setPriority(); 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<MarlinSerial> MSerialT; typedef Serial1Class<MarlinSerial> MSerialT;
-75
View File
@@ -1,75 +0,0 @@
/**
* 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_
-29
View File
@@ -20,20 +20,6 @@
* *
*/ */
#pragma once #pragma once
#include <core_util.h>
#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 #ifndef BOARD_XTAL_FREQUENCY
#error "BOARD_XTAL_FREQUENCY is required for HC32F460." #error "BOARD_XTAL_FREQUENCY is required for HC32F460."
@@ -88,18 +74,3 @@
#error "HC32 HAL uses a custom panic handler. Do not define PANIC_USARTx_TX_PIN." #error "HC32 HAL uses a custom panic handler. Do not define PANIC_USARTx_TX_PIN."
#endif #endif
#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
+17 -26
View File
@@ -54,7 +54,7 @@
fn \ fn \
} }
stc_sd_handle_t *handle = nullptr; stc_sd_handle_t *handle;
bool SDIO_Init() { bool SDIO_Init() {
// Configure SDIO pins // Configure SDIO pins
@@ -66,45 +66,36 @@ bool SDIO_Init() {
GPIO_SetFunc(BOARD_SDIO_CMD, Func_Sdio); GPIO_SetFunc(BOARD_SDIO_CMD, Func_Sdio);
GPIO_SetFunc(BOARD_SDIO_DET, 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 // Create DMA configuration
stc_sdcard_dma_init_t *dmaConf = new stc_sdcard_dma_init_t; stc_sdcard_dma_init_t *dmaConf = new stc_sdcard_dma_init_t;
dmaConf->DMAx = SDIO_DMA_PERIPHERAL; dmaConf->DMAx = SDIO_DMA_PERIPHERAL;
dmaConf->enDmaCh = SDIO_DMA_CHANNEL; 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 // Create handle in DMA mode
handle = new stc_sd_handle_t; handle = new stc_sd_handle_t;
handle->SDIOCx = SDIO_PERIPHERAL; handle->SDIOCx = SDIO_PERIPHERAL;
handle->enDevMode = SdCardDmaMode; handle->enDevMode = SdCardDmaMode;
handle->pstcDmaInitCfg = dmaConf; handle->pstcDmaInitCfg = dmaConf;
//handle->pstcCardInitCfg = cardConf; // assigned in SDCARD_Init
// 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,
};
// Initialize sd card // 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); if (rc != Ok) printf("SDIO_Init() error (rc=%u)\n", rc);
return rc == Ok; return rc == Ok;
} }
bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) { bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) {
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false); CORE_ASSERT(handle != NULL, "SDIO not initialized");
CORE_ASSERT(dst != nullptr, "SDIO_ReadBlock dst is NULL", return false); CORE_ASSERT(dst != NULL, "SDIO_ReadBlock dst is NULL");
WITH_RETRY(SDIO_READ_RETRIES, { WITH_RETRY(SDIO_READ_RETRIES, {
en_result_t rc = SDCARD_ReadBlocks(handle, block, 1, dst, SDIO_READ_TIMEOUT); en_result_t rc = SDCARD_ReadBlocks(handle, block, 1, dst, SDIO_READ_TIMEOUT);
@@ -116,8 +107,8 @@ bool SDIO_ReadBlock(uint32_t block, uint8_t *dst) {
} }
bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) { bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false); CORE_ASSERT(handle != NULL, "SDIO not initialized");
CORE_ASSERT(src != nullptr, "SDIO_WriteBlock src is NULL", return false); CORE_ASSERT(src != NULL, "SDIO_WriteBlock src is NULL");
WITH_RETRY(SDIO_WRITE_RETRIES, { WITH_RETRY(SDIO_WRITE_RETRIES, {
en_result_t rc = SDCARD_WriteBlocks(handle, block, 1, (uint8_t *)src, SDIO_WRITE_TIMEOUT); en_result_t rc = SDCARD_WriteBlocks(handle, block, 1, (uint8_t *)src, SDIO_WRITE_TIMEOUT);
@@ -129,12 +120,12 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
} }
bool SDIO_IsReady() { bool SDIO_IsReady() {
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return false); CORE_ASSERT(handle != NULL, "SDIO not initialized");
return bool(handle->stcCardStatus.READY_FOR_DATA); return bool(handle->stcCardStatus.READY_FOR_DATA);
} }
uint32_t SDIO_GetCardSize() { uint32_t SDIO_GetCardSize() {
CORE_ASSERT(handle != nullptr, "SDIO not initialized", return 0); CORE_ASSERT(handle != NULL, "SDIO not initialized");
// Multiply number of blocks with block size to get size in bytes // 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); const uint64_t cardSizeBytes = uint64_t(handle->stcSdCardInfo.u32LogBlockNbr) * uint64_t(handle->stcSdCardInfo.u32LogBlockSize);
+9 -24
View File
@@ -96,44 +96,29 @@ void core_hook_sysclock_init() {
#endif #endif
#endif #endif
// sysclk is now configured according to F_CPU (i.e., 200MHz PLL output) // Setup clock divisors for sysclk = 200 MHz:
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) // Note: PCLK1 is used for step+temp timers, and need to be kept at 50 MHz (until there is a better solution)
constexpr stc_clk_sysclk_cfg_t sysClkConf = { stc_clk_sysclk_cfg_t sysClkConf = {
.enHclkDiv = ClkSysclkDiv1, // HCLK = 200 MHz (CPU) .enHclkDiv = ClkSysclkDiv1, // HCLK = 200 MHz (CPU)
.enExclkDiv = ClkSysclkDiv2, // EXCLK = 100 MHz (SDIO) .enExclkDiv = ClkSysclkDiv2, // EXCLK = 100 MHz (SDIO)
.enPclk0Div = ClkSysclkDiv2, // PCLK0 = 100 MHz (Timer6 (not used)) .enPclk0Div = ClkSysclkDiv1, // PCLK0 = 200 MHz (Timer6 (not used))
.enPclk1Div = ClkSysclkDiv4, // PCLK1 = 50 MHz (USART, SPI, I2S, Timer0 (step+temp), TimerA (Servo)) .enPclk1Div = ClkSysclkDiv4, // PCLK1 = 50 MHz (USART, SPI, I2S, Timer0 (step+temp), TimerA (Servo))
.enPclk2Div = ClkSysclkDiv8, // PCLK2 = 25 MHz (ADC) .enPclk2Div = ClkSysclkDiv4, // PCLK2 = 50 MHz (ADC)
.enPclk3Div = ClkSysclkDiv8, // PCLK3 = 25 MHz (I2C, WDT) .enPclk3Div = ClkSysclkDiv4, // PCLK3 = 50 MHz (I2C, WDT)
.enPclk4Div = ClkSysclkDiv2, // PCLK4 = 100 MHz (ADC ctl) .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); sysclock_set_clock_dividers(&sysClkConf);
// Set power mode // Set power mode
power_mode_update_pre(sysclock); #define POWER_MODE_SYSTEM_CLOCK 200000000 // 200 MHz
power_mode_update_pre(POWER_MODE_SYSTEM_CLOCK);
// Switch to MPLL as sysclk source // Switch to MPLL as sysclk source
CLK_SetSysClkSource(CLKSysSrcMPLL); CLK_SetSysClkSource(CLKSysSrcMPLL);
// Set power mode // Set power mode
power_mode_update_post(sysclock); power_mode_update_post(POWER_MODE_SYSTEM_CLOCK);
#undef POWER_MODE_SYSTEM_CLOCK
} }
#endif // ARDUINO_ARCH_HC32 #endif // ARDUINO_ARCH_HC32
+27 -31
View File
@@ -38,48 +38,44 @@ extern Timer0 step_timer;
// Timer Configurations // Timer Configurations
// //
/** // TODO: some calculations (step irq min_step_rate) require the timer rate to be known at compile time
* HAL_TIMER_RATE must be known at compile time since it's used to calculate // this is not possible with the HC32F460, as the timer rate depends on PCLK1
* STEPPER_TIMER_RATE, which is used in 'constexpr' calculations. // as a workaround, PCLK1 = 50MHz is assumed (check with clock dump in MarlinHAL::init())
* On the HC32F460 the timer rate depends on PCLK1, which is derived from the #define HAL_TIMER_RATE 50000000 // 50MHz
* system clock configured at runtime. As a workaround, we use the existing // #define HAL_TIMER_RATE TIMER0_BASE_FREQUENCY
* 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'. // 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
* If you face issues with this assumption, please double-check with the values #undef CYCLES_PER_MICROSECOND
* printed by 'MarlinHAL::HAL_clock_frequencies_dump'. #define CYCLES_PER_MICROSECOND (HAL_TIMER_RATE / 1000000UL)
*
* 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 // Temperature timer
#define TEMP_TIMER_NUM (&temp_timer) #define TEMP_TIMER_NUM (&temp_timer)
#define TEMP_TIMER_PRIORITY DDL_IRQ_PRIORITY_02 #define TEMP_TIMER_PRIORITY DDL_IRQ_PRIORITY_02
#define TEMP_TIMER_PRESCALE 16UL // 12.5MHz #define TEMP_TIMER_PRESCALE 16ul
#define TEMP_TIMER_RATE 1000 // 1kHz #define TEMP_TIMER_RATE 1000 // 1kHz
#define TEMP_TIMER_FREQUENCY TEMP_TIMER_RATE // 1kHz also #define TEMP_TIMER_FREQUENCY TEMP_TIMER_RATE // Alias for Marlin
// Stepper timer // Stepper timer
#define STEP_TIMER_NUM (&step_timer) #define STEP_TIMER_NUM (&step_timer)
#define STEP_TIMER_PRIORITY DDL_IRQ_PRIORITY_00 // Top priority, nothing else uses it #define STEP_TIMER_PRIORITY DDL_IRQ_PRIORITY_01
#define STEPPER_TIMER_PRESCALE 16UL // 12.5MHz #define STEPPER_TIMER_PRESCALE 16ul
#define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // 50MHz / 16 = 3.125MHz // TODO: STEPPER_TIMER_RATE seems to work fine like this, but requires further testing...
#define STEPPER_TIMER_TICKS_PER_US (STEPPER_TIMER_RATE / 1000000UL) // Integer 3 #define STEPPER_TIMER_RATE (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE) // 50MHz / 16 = 3.125MHz
#define STEPPER_TIMER_TICKS_PER_US (STEPPER_TIMER_RATE / 1000000)
// Pulse timer (== stepper timer) // Pulse timer (== stepper timer)
#define PULSE_TIMER_NUM STEP_TIMER_NUM #define PULSE_TIMER_NUM STEP_TIMER_NUM
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE #define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
#define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US #define PULSE_TIMER_TICKS_PER_US STEPPER_TIMER_TICKS_PER_US
// //
// Channel aliases // Channel aliases
// //
#define MF_TIMER_TEMP TEMP_TIMER_NUM #define MF_TIMER_TEMP TEMP_TIMER_NUM
#define MF_TIMER_STEP STEP_TIMER_NUM #define MF_TIMER_STEP STEP_TIMER_NUM
#define MF_TIMER_PULSE PULSE_TIMER_NUM #define MF_TIMER_PULSE PULSE_TIMER_NUM
// //
// HAL functions // HAL functions
+1 -4
View File
@@ -37,10 +37,7 @@ Timer::Timer() {
} }
Timer::~Timer() { Timer::~Timer() {
if (timerid != 0) { timer_delete(timerid);
timer_delete(timerid);
timerid = 0;
}
} }
void Timer::init(uint32_t sig_id, uint32_t sim_freq, callback_fn* fn) { void Timer::init(uint32_t sig_id, uint32_t sim_freq, callback_fn* fn) {
-2
View File
@@ -21,7 +21,6 @@
*/ */
#ifdef __PLAT_LINUX__ #ifdef __PLAT_LINUX__
#ifndef UNIT_TEST
//#define GPIO_LOGGING // Full GPIO and Positional Logging //#define GPIO_LOGGING // Full GPIO and Positional Logging
@@ -136,5 +135,4 @@ int main() {
read_serial.join(); read_serial.join();
} }
#endif // UNIT_TEST
#endif // __PLAT_LINUX__ #endif // __PLAT_LINUX__
+1 -1
View File
@@ -100,7 +100,7 @@ extern DefaultSerial1 USBSerial;
#else #else
#error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB." #error "LCD_SERIAL_PORT must be from 0 to 3. You can also use -1 if the board supports Native USB."
#endif #endif
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI) #if HAS_DGUS_LCD
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.available() #define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.available()
#endif #endif
#endif #endif
+1 -1
View File
@@ -112,7 +112,7 @@
#else #else
#error "LCD_SERIAL_PORT must be from 1 to 9, or -1 for Native USB." #error "LCD_SERIAL_PORT must be from 1 to 9, or -1 for Native USB."
#endif #endif
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI) #if HAS_DGUS_LCD
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite() #define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
#endif #endif
#endif #endif
-1
View File
@@ -53,7 +53,6 @@
inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); } inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); }
void _rx_complete_irq(serial_t *obj); 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: protected:
usart_rx_callback_t _rx_callback; usart_rx_callback_t _rx_callback;
+1 -1
View File
@@ -138,7 +138,7 @@
#define LCD_SERIAL MSERIAL(1) // dummy port #define LCD_SERIAL MSERIAL(1) // dummy port
static_assert(false, "LCD_SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ". You can also use -1 if the board supports Native USB.") static_assert(false, "LCD_SERIAL_PORT must be from 1 to " STRINGIFY(NUM_UARTS) ". You can also use -1 if the board supports Native USB.")
#endif #endif
#if ANY(HAS_DGUS_LCD, EXTENSIBLE_UI) #if HAS_DGUS_LCD
#define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite() #define LCD_SERIAL_TX_BUFFER_FREE() LCD_SERIAL.availableForWrite()
#endif #endif
#endif #endif
+4 -9
View File
@@ -266,7 +266,7 @@ PGMSTR(M112_KILL_STR, "M112 Shutdown");
MarlinState marlin_state = MF_INITIALIZING; MarlinState marlin_state = MF_INITIALIZING;
// For M109 and M190, this flag may be cleared (by M108) to exit the wait loop // For M109 and M190, this flag may be cleared (by M108) to exit the wait loop
bool wait_for_heatup = false; bool wait_for_heatup = true;
// For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop // For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop
#if HAS_RESUME_CONTINUE #if HAS_RESUME_CONTINUE
@@ -474,16 +474,11 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
#if HAS_KILL #if HAS_KILL
// Check if the kill button was pressed and wait to ensure the signal is not noise // Check if the kill button was pressed and wait just in case it was an accidental
// typically caused by poor insulation and grounding on LCD cables. // key kill key press
// 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 static int killCount = 0; // make the inactivity button a bit less responsive
const int KILL_DELAY = 750;
if (kill_state()) if (kill_state())
killCount++; killCount++;
else if (killCount > 0) else if (killCount > 0)
+3 -9
View File
@@ -131,7 +131,6 @@
#define BOARD_PXMALION_CORE_I3 1164 // Pxmalion Core I3 #define BOARD_PXMALION_CORE_I3 1164 // Pxmalion Core I3
#define BOARD_PANOWIN_CUTLASS 1165 // Panowin Cutlass (as found in the Panowin F1) #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_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 // RAMBo and derivatives
@@ -383,9 +382,9 @@
#define BOARD_CREALITY_V452 5050 // Creality v4.5.2 (STM32F103RC / STM32F103RE) #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_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_V521 5052 // Creality v5.2.1 (STM32F103VE) as found in the SV04
#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 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) CR-FDM-v24S1_301 as found in the Ender-3 S1 #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) CR-FDM-v2.5.S1_100 as found in the CR-10 Smart Pro #define BOARD_CREALITY_V25S1 5055 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro
#define BOARD_TRIGORILLA_PRO 5056 // Trigorilla Pro (STM32F103ZE) #define BOARD_TRIGORILLA_PRO 5056 // Trigorilla Pro (STM32F103ZE)
#define BOARD_FLY_MINI 5057 // FLYmaker FLY MINI (STM32F103RC) #define BOARD_FLY_MINI 5057 // FLYmaker FLY MINI (STM32F103RC)
#define BOARD_FLSUN_HISPEED 5058 // FLSUN HiSpeedV1 (STM32F103VE) #define BOARD_FLSUN_HISPEED 5058 // FLSUN HiSpeedV1 (STM32F103VE)
@@ -468,11 +467,6 @@
#define BOARD_FYSETC_CHEETAH_V30 5250 // FYSETC Cheetah V3.0 (STM32F446RC) #define BOARD_FYSETC_CHEETAH_V30 5250 // FYSETC Cheetah V3.0 (STM32F446RC)
#define BOARD_BLACKBEEZMINI_V1 5251 // BlackBeezMini V1 (STM32F401CCU6) #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 // ARM Cortex-M7
// //
-1
View File
@@ -135,7 +135,6 @@
#define STR_BUSY_PAUSED_FOR_USER "busy: paused for user" #define STR_BUSY_PAUSED_FOR_USER "busy: paused for user"
#define STR_BUSY_PAUSED_FOR_INPUT "busy: paused for input" #define STR_BUSY_PAUSED_FOR_INPUT "busy: paused for input"
#define STR_Z_MOVE_COMP "Z_move_comp" #define STR_Z_MOVE_COMP "Z_move_comp"
#define STR_LINE_NO "Line: "
#define STR_RESEND "Resend: " #define STR_RESEND "Resend: "
#define STR_UNKNOWN_COMMAND "Unknown command: \"" #define STR_UNKNOWN_COMMAND "Unknown command: \""
#define STR_ACTIVE_EXTRUDER "Active Extruder: " #define STR_ACTIVE_EXTRUDER "Active Extruder: "
+4 -5
View File
@@ -89,8 +89,7 @@
#define HYPOT2(x,y) (sq(x)+sq(y)) #define HYPOT2(x,y) (sq(x)+sq(y))
#define NORMSQ(x,y,z) (sq(x)+sq(y)+sq(z)) #define NORMSQ(x,y,z) (sq(x)+sq(y)+sq(z))
#define FLOAT_SQ(I) sq(float(I)) #define CIRCLE_AREA(R) (float(M_PI) * sq(float(R)))
#define CIRCLE_AREA(R) (float(M_PI) * FLOAT_SQ(R))
#define CIRCLE_CIRC(R) (2 * float(M_PI) * float(R)) #define CIRCLE_CIRC(R) (2 * float(M_PI) * float(R))
#define SIGN(a) ({__typeof__(a) _a = (a); (_a>0)-(_a<0);}) #define SIGN(a) ({__typeof__(a) _a = (a); (_a>0)-(_a<0);})
@@ -197,8 +196,8 @@
#define ENABLED(V...) DO(ENA,&&,V) #define ENABLED(V...) DO(ENA,&&,V)
#define DISABLED(V...) DO(DIS,&&,V) #define DISABLED(V...) DO(DIS,&&,V)
#define ANY(V...) !DISABLED(V) #define ANY(V...) !DISABLED(V)
#define ALL(V...) ENABLED(V) #define ALL ENABLED
#define NONE(V...) DISABLED(V) #define NONE DISABLED
#define COUNT_ENABLED(V...) DO(ENA,+,V) #define COUNT_ENABLED(V...) DO(ENA,+,V)
#define MANY(V...) (COUNT_ENABLED(V) > 1) #define MANY(V...) (COUNT_ENABLED(V) > 1)
@@ -630,7 +629,7 @@
#define DEFER4(M) M EMPTY EMPTY EMPTY EMPTY()()()() #define DEFER4(M) M EMPTY EMPTY EMPTY EMPTY()()()()
// Force define expansion // Force define expansion
#define EVAL(V...) EVAL16(V) #define EVAL EVAL16
#define EVAL4096(V...) EVAL2048(EVAL2048(V)) #define EVAL4096(V...) EVAL2048(EVAL2048(V))
#define EVAL2048(V...) EVAL1024(EVAL1024(V)) #define EVAL2048(V...) EVAL1024(EVAL1024(V))
#define EVAL1024(V...) EVAL512(EVAL512(V)) #define EVAL1024(V...) EVAL512(EVAL512(V))
+5 -5
View File
@@ -143,13 +143,13 @@ public:
// Set with format string and arguments, like printf // Set with format string and arguments, like printf
template<typename... Args> template<typename... Args>
MString& setf_P(PGM_P const pfmt, Args... more) { SNPRINTF_P(str, SIZE, pfmt, more...); debug(F("setf_P")); return *this; } MString& setf_P(PGM_P const fmt, Args... more) { SNPRINTF_P(str, SIZE, fmt, more...); debug(F("setf_P")); return *this; }
template<typename... Args> template<typename... Args>
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<typename... Args> template<typename... Args>
MString& setf(FSTR_P const ffmt, Args... more) { return setf_P(FTOP(ffmt), more...); } MString& setf(FSTR_P const fmt, Args... more) { return setf_P(FTOP(fmt), more...); }
// Chainable String appenders // Chainable String appenders
MString& append() { debug(F("nil")); return *this; } // for macros that might emit no output 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)); } MString& append(const spaces_t &s) { return append(repchr_t(' ', s.count)); }
template<typename... Args> template<typename... Args>
MString& appendf_P(PGM_P const pfmt, Args... more) { MString& appendf_P(PGM_P const fmt, Args... more) {
int sz = length(); int sz = length();
if (sz < SIZE) SNPRINTF_P(str + sz, SIZE - sz, pfmt, more...); if (sz < SIZE) SNPRINTF_P(str + sz, SIZE - sz, fmt, more...);
debug(F("appendf_P")); debug(F("appendf_P"));
return *this; return *this;
} }
+3 -3
View File
@@ -271,13 +271,13 @@ public:
SString& set() { super::set(); return *this; } SString& set() { super::set(); return *this; }
template<typename... Args> template<typename... Args>
SString& setf_P(PGM_P const pfmt, Args... more) { super::setf_P(pfmt, more...); return *this; } SString& setf_P(PGM_P const fmt, Args... more) { super::setf_P(fmt, more...); return *this; }
template<typename... Args> template<typename... Args>
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<typename... Args> template<typename... Args>
SString& setf(FSTR_P const ffmt, Args... more) { super::setf(ffmt, more...); return *this; } SString& setf(FSTR_P const fmt, Args... more) { super::setf(fmt, more...); return *this; }
template <typename T> template <typename T>
SString& set(const T &v) { super::set(v); return *this; } SString& set(const T &v) { super::set(v); return *this; }
+4 -12
View File
@@ -46,7 +46,6 @@ template <class L, class R> struct IF<true, L, R> { 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_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 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 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 STR_AXES_MAIN NUM_AXIS_GANG("X", "Y", "Z", STR_I, STR_J, STR_K, STR_U, STR_V, STR_W)
#define LOGICAL_AXIS_GANG(E,V...) NUM_AXIS_GANG(V) GANG_ITEM_E(E) #define LOGICAL_AXIS_GANG(E,V...) NUM_AXIS_GANG(V) GANG_ITEM_E(E)
@@ -59,21 +58,17 @@ template <class L, class R> struct IF<true, L, R> { 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_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_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 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(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) #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 #if NUM_AXES
#define NUM_AXES_SEP , #define NUM_AXES_SEP ,
#define MAIN_AXIS_MAP(F) MAP(F, MAIN_AXIS_NAMES) #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_NUM(T) , NUM_AXIS_ARGS(T)
#define OPTARGS_LOGICAL(T) , LOGICAL_AXIS_ARGS(T) #define OPTARGS_LOGICAL(T) , LOGICAL_AXIS_ARGS(T)
#else #else
#define NUM_AXES_SEP #define NUM_AXES_SEP
#define MAIN_AXIS_MAP(F) #define MAIN_AXIS_MAP(F)
#define MAIN_AXIS_MAP_LC(F)
#define OPTARGS_NUM(T) #define OPTARGS_NUM(T)
#define OPTARGS_LOGICAL(T) #define OPTARGS_LOGICAL(T)
#endif #endif
@@ -84,7 +79,6 @@ template <class L, class R> struct IF<true, L, R> { typedef L type; };
#define NUM_AXIS_ARGS_(T) NUM_AXIS_ARGS(T) NUM_AXES_SEP #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 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_ MAIN_AXIS_NAMES NUM_AXES_SEP
#define MAIN_AXIS_NAMES_LC_ MAIN_AXIS_NAMES_LC NUM_AXES_SEP
#if LOGICAL_AXES #if LOGICAL_AXES
#define LOGICAL_AXES_SEP , #define LOGICAL_AXES_SEP ,
@@ -98,7 +92,6 @@ template <class L, class R> struct IF<true, L, R> { typedef L type; };
#define LOGICAL_AXIS_ARGS_(T) LOGICAL_AXIS_ARGS(T) LOGICAL_AXES_SEP #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_ELEM_(T) LOGICAL_AXIS_ELEM(T) LOGICAL_AXES_SEP
#define LOGICAL_AXIS_NAMES_ LOGICAL_AXIS_NAMES 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_GANG(V...) GANG_N(SECONDARY_AXES, V)
#define SECONDARY_AXIS_CODE(V...) CODE_N(SECONDARY_AXES, V) #define SECONDARY_AXIS_CODE(V...) CODE_N(SECONDARY_AXES, V)
@@ -166,7 +159,7 @@ template <class L, class R> struct IF<true, L, R> { typedef L type; };
// General Flags for some number of states // General Flags for some number of states
template<size_t N> template<size_t N>
struct Flags { struct Flags {
typedef bits_t(N) flagbits_t; typedef uvalue_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; } 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; } 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, 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,
@@ -226,7 +219,7 @@ typedef struct {
// //
// - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space // - 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 // - 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 axes on Core kinematics // - X_HEAD, Y_HEAD, and Z_HEAD should be used for Steppers on Core kinematics
// //
enum AxisEnum : uint8_t { enum AxisEnum : uint8_t {
@@ -610,9 +603,9 @@ struct XYZval {
// If any element is true then it's true // 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); } FI constexpr operator bool() const { return 0 NUM_AXIS_GANG(|| x, || y, || z, || i, || j, || k, || u, || v, || w); }
// Smallest element // Smallest element
FI constexpr T small() const { return TERN0(HAS_X_AXIS, _MIN(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w))); } FI constexpr T small() const { return TERN(HAS_X_AXIS, _MIN(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)), 0); }
// Largest element // Largest element
FI constexpr T large() const { return TERN0(HAS_X_AXIS, _MAX(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w))); } FI constexpr T large() const { return TERN(HAS_X_AXIS, _MAX(NUM_AXIS_LIST(x, y, z, i, j, k, u, v, w)), 0); }
// Explicit copy and copies with conversion // Explicit copy and copies with conversion
FI constexpr XYZval<T> copy() const { XYZval<T> o = *this; return o; } FI constexpr XYZval<T> copy() const { XYZval<T> o = *this; return o; }
@@ -1091,7 +1084,6 @@ public:
FI bool toggle(const AxisEnum n) { TBI(bits, n); return TEST(bits, n); } FI bool toggle(const AxisEnum n) { TBI(bits, n); return TEST(bits, n); }
FI void bset(const AxisEnum n) { SBI(bits, n); } FI void bset(const AxisEnum n) { SBI(bits, n); }
FI void bclr(const AxisEnum n) { CBI(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] // Accessor via an AxisEnum (or any integer) [index]
FI bool operator[](const int n) const { return TEST(bits, n); } FI bool operator[](const int n) const { return TEST(bits, n); }
+4 -10
View File
@@ -46,16 +46,10 @@ BDS_Leveling bdl;
#define DEBUG_OUT ENABLED(DEBUG_OUT_BD) #define DEBUG_OUT ENABLED(DEBUG_OUT_BD)
#include "../../../core/debug_out.h" #include "../../../core/debug_out.h"
/** // M102 S-5 Read raw Calibrate data
* M102 S<#> : Set adjustable Z height in 0.1mm units (10ths of a mm) // M102 S-6 Start Calibrate
* (e.g., 'M102 S4' enables adjusting for Z <= 0.4mm) // 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 S0 : Disable adjustable Z height // M102 S-1 Read sensor information
*
* 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 MAX_BD_HEIGHT 4.0f
#define CMD_READ_VERSION 1016 #define CMD_READ_VERSION 1016
+3 -3
View File
@@ -765,7 +765,7 @@ void unified_bed_leveling::shift_mesh_height() {
const grid_count_t point_num = (GRID_MAX_POINTS - count) + 1; const grid_count_t point_num = (GRID_MAX_POINTS - count) + 1;
SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, "."); 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_F(MSG_PROBING_POINT), point_num, int(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_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout()); TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout());
#if HAS_MARLINUI_MENU #if HAS_MARLINUI_MENU
@@ -1494,7 +1494,7 @@ void unified_bed_leveling::smart_fill_mesh() {
for (uint8_t i = 0; i < 3; ++i) { for (uint8_t i = 0; i < 3; ++i) {
SERIAL_ECHOLNPGM("Tilting mesh (", i + 1, "/3)"); SERIAL_ECHOLNPGM("Tilting mesh (", i + 1, "/3)");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT_F(MSG_LCD_TILTING_MESH), i + 1)); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT(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); 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; if ((abort_flag = isnan(measured_z))) break;
@@ -1550,7 +1550,7 @@ void unified_bed_leveling::smart_fill_mesh() {
#endif #endif
SERIAL_ECHOLNPGM("Tilting mesh point ", point_num, "/", total_points, "\n"); 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_F(MSG_LCD_TILTING_MESH), point_num, total_points)); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(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 measured_z = probe.probe_at_point(rpos, parser.seen_test('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling
+3 -2
View File
@@ -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 // Retract by moving from a faux E position back to the current E position
current_retract[active_extruder] = base_retract; current_retract[active_extruder] = base_retract;
prepare_internal_move_to_destination( // set current from destination prepare_internal_move_to_destination( // set current from destination
MUL_TERN(RETRACT_SYNC_MIXING, settings.retract_feedrate_mm_s, MIXING_STEPPERS) settings.retract_feedrate_mm_s * TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS))
); );
// Is a Z hop set, and has the hop not yet been done? // Is a Z hop set, and has the hop not yet been done?
@@ -165,7 +165,8 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/))
// Recover E, set_current_to_destination // Recover E, set_current_to_destination
prepare_internal_move_to_destination( prepare_internal_move_to_destination(
MUL_TERN(RETRACT_SYNC_MIXING, swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s, MIXING_STEPPERS) (swapping ? settings.swap_retract_recover_feedrate_mm_s : settings.retract_recover_feedrate_mm_s)
* TERN1(RETRACT_SYNC_MIXING, (MIXING_STEPPERS))
); );
} }
+1 -1
View File
@@ -130,7 +130,7 @@ public:
} }
// Accessors // Accessors
static uint16_t pixels() { return MUL_TERN(NEOPIXEL2_INSERIES, adaneo1.numPixels(), 2); } static uint16_t pixels() { return adaneo1.numPixels() * TERN1(NEOPIXEL2_INSERIES, 2); }
static uint32_t pixel_color(const uint16_t n) { static uint32_t pixel_color(const uint16_t n) {
#if ENABLED(NEOPIXEL2_INSERIES) #if ENABLED(NEOPIXEL2_INSERIES)
+5 -3
View File
@@ -57,7 +57,9 @@ enum PauseMessage : char {
}; };
#if M600_PURGE_MORE_RESUMABLE #if M600_PURGE_MORE_RESUMABLE
// Input methods can Purge More, Resume, or request input /**
* Input methods can Purge More, Resume, or request input
*/
enum PauseMenuResponse : char { enum PauseMenuResponse : char {
PAUSE_RESPONSE_WAIT_FOR, PAUSE_RESPONSE_WAIT_FOR,
PAUSE_RESPONSE_EXTRUDE_MORE, PAUSE_RESPONSE_EXTRUDE_MORE,
@@ -107,7 +109,7 @@ void wait_for_confirmation(
void resume_print( void resume_print(
const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move 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 fast_load_length=0, // (mm) Fast Load Length for initial move
const_float_t purge_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length const_float_t extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length
const int8_t max_beep_count=0, // Beep alert for attention const int8_t max_beep_count=0, // Beep alert for attention
const celsius_t targetTemp=0 // (°C) A target temperature for the hotend const celsius_t targetTemp=0 // (°C) A target temperature for the hotend
DXC_PARAMS // Dual-X-Carriage extruder index DXC_PARAMS // Dual-X-Carriage extruder index
@@ -116,7 +118,7 @@ void resume_print(
bool load_filament( bool load_filament(
const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move 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 fast_load_length=0, // (mm) Fast Load Length for initial move
const_float_t purge_length=0, // (mm) Purge length const_float_t extrude_length=0, // (mm) Purge length
const int8_t max_beep_count=0, // Beep alert for attention const int8_t max_beep_count=0, // Beep alert for attention
const bool show_lcd=false, // Set LCD status messages? const bool show_lcd=false, // Set LCD status messages?
const bool pause_for_user=false, // Pause for user before returning? const bool pause_for_user=false, // Pause for user before returning?
+1 -1
View File
@@ -31,7 +31,7 @@ static uint32_t axis_plug_backward = 0;
void stepper_driver_backward_error(FSTR_P const fstr) { void stepper_driver_backward_error(FSTR_P const fstr) {
SERIAL_ERROR_START(); SERIAL_ERROR_START();
SERIAL_ECHOLN(fstr, F(" driver is backward!")); SERIAL_ECHOLN(fstr, F(" driver is backward!"));
ui.status_printf(2, F(S_FMT S_FMT), FTOP(fstr), GET_TEXT_F(MSG_DRIVER_BACKWARD)); ui.status_printf(2, F(S_FMT S_FMT), FTOP(fstr), GET_TEXT(MSG_DRIVER_BACKWARD));
} }
void stepper_driver_backward_check() { void stepper_driver_backward_check() {
-6
View File
@@ -32,12 +32,6 @@
/** /**
* G42: Move X & Y axes to mesh coordinates (I & J) * G42: Move X & Y axes to mesh coordinates (I & J)
*
* Parameters:
* F<feedrate> : Feedrate in mm/min
* I<index> : X axis point index
* J<index> : Y axis point index
* P<bool> : Flag to put the prove at the given point
*/ */
void GcodeSuite::G42() { void GcodeSuite::G42() {
if (MOTION_CONDITIONS) { if (MOTION_CONDITIONS) {
+2 -2
View File
@@ -683,7 +683,7 @@ G29_TYPE GcodeSuite::G29() {
if (TERN0(IS_KINEMATIC, !probe.can_reach(abl.probePos))) continue; if (TERN0(IS_KINEMATIC, !probe.can_reach(abl.probePos))) continue;
if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing mesh point ", pt_index, "/", abl.abl_points, "."); 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_F(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(MSG_PROBING_POINT), int(pt_index), int(abl.abl_points)));
#if ENABLED(BD_SENSOR_PROBE_NO_STOP) #if ENABLED(BD_SENSOR_PROBE_NO_STOP)
if (PR_INNER_VAR == inStart) { if (PR_INNER_VAR == inStart) {
@@ -782,7 +782,7 @@ G29_TYPE GcodeSuite::G29() {
for (uint8_t i = 0; i < 3; ++i) { for (uint8_t i = 0; i < 3; ++i) {
if (abl.verbose_level) SERIAL_ECHOLNPGM("Probing point ", i + 1, "/3."); 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_F(MSG_PROBING_POINT), int(i + 1))); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), GET_TEXT(MSG_PROBING_POINT), int(i + 1)));
// Retain the last probe position // Retain the last probe position
abl.probePos = xy_pos_t(points[i]); abl.probePos = xy_pos_t(points[i]);
+1 -1
View File
@@ -253,7 +253,7 @@ void GcodeSuite::G29() {
if (state == MeshNext) { if (state == MeshNext) {
SERIAL_ECHOLNPGM("MBL G29 point ", _MIN(mbl_probe_index, GRID_MAX_POINTS), " of ", GRID_MAX_POINTS); 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_F(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(MSG_PROBING_POINT), _MIN(mbl_probe_index, GRID_MAX_POINTS), int(GRID_MAX_POINTS)));
} }
report_current_position(); report_current_position();
+1 -1
View File
@@ -149,7 +149,7 @@ void GcodeSuite::M48() {
for (uint8_t n = 0; n < n_samples; ++n) { for (uint8_t n = 0; n < n_samples; ++n) {
#if HAS_STATUS_MESSAGE #if HAS_STATUS_MESSAGE
// Display M48 progress in the status bar // Display M48 progress in the status bar
ui.status_printf(0, F(S_FMT ": %d/%d"), GET_TEXT_F(MSG_M48_POINT), int(n + 1), int(n_samples)); ui.status_printf(0, F(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples));
#endif #endif
// When there are "legs" of movement move around the point before probing // When there are "legs" of movement move around the point before probing
@@ -20,11 +20,6 @@
* *
*/ */
/**
* gcode/control/M10_M11.cpp
* Air Evacuation
*/
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(AIR_EVACUATION) #if ENABLED(AIR_EVACUATION)
@@ -68,7 +68,7 @@ void GcodeSuite::M907() {
#define HAS_X_Y_XY_I_J_K_U_V_W 1 #define HAS_X_Y_XY_I_J_K_U_V_W 1
#endif #endif
#if HAS_X_Y_XY_I_J_K_U_V_W || HAS_MOTOR_CURRENT_PWM_E || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) #if HAS_X_Y_XY_I_J_K_U_V_W || ANY_PIN(MOTOR_CURRENT_PWM_E, MOTOR_CURRENT_PWM_Z)
if (!parser.seen("S" if (!parser.seen("S"
#if HAS_X_Y_XY_I_J_K_U_V_W #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) #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
"Z" "Z"
#endif #endif
#if HAS_MOTOR_CURRENT_PWM_E #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
"E" "E"
#endif #endif
)) return M907_report(); )) return M907_report();
@@ -94,7 +94,7 @@ void GcodeSuite::M907() {
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
if (parser.seenval('Z')) stepper.set_digipot_current(1, parser.value_int()); if (parser.seenval('Z')) stepper.set_digipot_current(1, parser.value_int());
#endif #endif
#if HAS_MOTOR_CURRENT_PWM_E #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
if (parser.seenval('E')) stepper.set_digipot_current(2, parser.value_int()); if (parser.seenval('E')) stepper.set_digipot_current(2, parser.value_int());
#endif #endif
@@ -133,7 +133,7 @@ void GcodeSuite::M907() {
SERIAL_ECHOLNPGM_P( // PWM-based has 3 values: SERIAL_ECHOLNPGM_P( // PWM-based has 3 values:
PSTR(" M907 X"), stepper.motor_current_setting[0] // X, Y, (I, J, K, U, V, W) 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_Z_STR, stepper.motor_current_setting[1] // Z
#if HAS_MOTOR_CURRENT_PWM_E #if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
, SP_E_STR, stepper.motor_current_setting[2] // E , SP_E_STR, stepper.motor_current_setting[2] // E
#endif #endif
); );
@@ -44,15 +44,6 @@ void GcodeSuite::M593_report(const bool forReplay/*=true*/) {
" D", stepper.get_shaping_damping_ratio(Y_AXIS) " D", stepper.get_shaping_damping_ratio(Y_AXIS)
); );
#endif #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
} }
/** /**
@@ -68,17 +59,14 @@ void GcodeSuite::M593() {
const bool seen_X = TERN0(INPUT_SHAPING_X, parser.seen_test('X')), const bool seen_X = TERN0(INPUT_SHAPING_X, parser.seen_test('X')),
seen_Y = TERN0(INPUT_SHAPING_Y, parser.seen_test('Y')), seen_Y = TERN0(INPUT_SHAPING_Y, parser.seen_test('Y')),
seen_Z = TERN0(INPUT_SHAPING_Z, parser.seen_test('Z')), for_X = seen_X || TERN0(INPUT_SHAPING_X, (!seen_X && !seen_Y)),
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));
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')) { if (parser.seen('D')) {
const float zeta = parser.value_float(); const float zeta = parser.value_float();
if (WITHIN(zeta, 0, 1)) { if (WITHIN(zeta, 0, 1)) {
if (for_X) stepper.set_shaping_damping_ratio(X_AXIS, zeta); if (for_X) stepper.set_shaping_damping_ratio(X_AXIS, zeta);
if (for_Y) stepper.set_shaping_damping_ratio(Y_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 else
SERIAL_ECHO_MSG("?Zeta (D) value out of range (0-1)"); SERIAL_ECHO_MSG("?Zeta (D) value out of range (0-1)");
@@ -90,7 +78,6 @@ void GcodeSuite::M593() {
if (freq == 0.0f || freq > min_freq) { if (freq == 0.0f || freq > min_freq) {
if (for_X) stepper.set_shaping_frequency(X_AXIS, freq); if (for_X) stepper.set_shaping_frequency(X_AXIS, freq);
if (for_Y) stepper.set_shaping_frequency(Y_AXIS, freq); if (for_Y) stepper.set_shaping_frequency(Y_AXIS, freq);
if (for_Z) stepper.set_shaping_frequency(Z_AXIS, freq);
} }
else else
SERIAL_ECHOLNPGM(GCODE_ERR_MSG("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"));
@@ -72,7 +72,6 @@ void GcodeSuite::M413_report(const bool forReplay/*=true*/) {
, " B", recovery.bed_temp_threshold , " B", recovery.bed_temp_threshold
#endif #endif
); );
SERIAL_ECHO(" ; ");
serialprintln_onoff(recovery.enabled); serialprintln_onoff(recovery.enabled);
} }
-4
View File
@@ -1105,10 +1105,6 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 1002: M1002(); break; // M1002: [INTERNAL] Tool-change and Relative E Move case 1002: M1002(); break; // M1002: [INTERNAL] Tool-change and Relative E Move
#endif #endif
#if ENABLED(ONE_CLICK_PRINT)
case 1003: M1003(); break; // M1003: [INTERNAL] Set the current dir to /
#endif
#if ENABLED(UBL_MESH_WIZARD) #if ENABLED(UBL_MESH_WIZARD)
case 1004: M1004(); break; // M1004: UBL Mesh Wizard case 1004: M1004(); break; // M1004: UBL Mesh Wizard
#endif #endif
+1 -5
View File
@@ -143,7 +143,7 @@
* R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. ** * R<temp> Wait for extruder current temp to reach target temp. ** Wait for heating or cooling. **
* If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F * If AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
* *
* M110 - Get or set the current line number. (Used by host printing) * M110 - Set the current line number. (Used by host printing)
* M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h. * M111 - Set debug flags: "M111 S<flagbits>". See flag bits defined in enum.h.
* M112 - Full Shutdown. * M112 - Full Shutdown.
* *
@@ -1276,10 +1276,6 @@ private:
static void M1002(); static void M1002();
#endif #endif
#if ENABLED(ONE_CLICK_PRINT)
static void M1003();
#endif
#if ENABLED(UBL_MESH_WIZARD) #if ENABLED(UBL_MESH_WIZARD)
static void M1004(); static void M1004();
#endif #endif
+2 -10
View File
@@ -24,19 +24,11 @@
#include "../queue.h" // for last_N #include "../queue.h" // for last_N
/** /**
* M110: Get or set Current Line Number * M110: Set Current Line Number
*
* Parameters:
* N<int> 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() { void GcodeSuite::M110() {
if (parser.seenval('N')) if (parser.seenval('N'))
queue.set_current_line_number(parser.value_long()); queue.set_current_line_number(parser.value_long());
else
SERIAL_ECHOLNPGM(STR_LINE_NO, queue.get_current_line_number());
} }
+1 -1
View File
@@ -34,7 +34,7 @@
#include "../../feature/probe_temp_comp.h" #include "../../feature/probe_temp_comp.h"
#endif #endif
#if ANY(DWIN_CREALITY_LCD_JYERSUI, EXTENSIBLE_UI) #if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
#define VERBOSE_SINGLE_PROBE #define VERBOSE_SINGLE_PROBE
#endif #endif
+1 -1
View File
@@ -55,7 +55,7 @@ inline bool G38_run_probe() {
} }
#endif #endif
planner.synchronize(); // Wait until the machine is idle planner.synchronize(); // wait until the machine is idle
// Move flag value // Move flag value
#if ENABLED(G38_PROBE_AWAY) #if ENABLED(G38_PROBE_AWAY)
-15
View File
@@ -54,21 +54,6 @@ void mpe_settings_init() {
mpe_settings_report(); mpe_settings_report();
} }
/**
* M951: Magnetic Parking Extruder
*
* Parameters:
* L<linear> : Set X[0] position
* R<linear> : Set X[1] position
* I<linear> : Set grab distance
* J<feedrate> : Set slow feedrate
* H<feedrate> : Set fast feedrate
* D<feedrate> : Set travel feedrate
* C<factor> : Set compensation factor
*
* With no parameters report the current settings.
*
*/
void GcodeSuite::M951() { void GcodeSuite::M951() {
if (parser.seenval('L')) mpe_settings.parking_xpos[0] = parser.value_linear_units(); if (parser.seenval('L')) mpe_settings.parking_xpos[0] = parser.value_linear_units();
if (parser.seenval('R')) mpe_settings.parking_xpos[1] = parser.value_linear_units(); if (parser.seenval('R')) mpe_settings.parking_xpos[1] = parser.value_linear_units();
-5
View File
@@ -212,11 +212,6 @@ public:
*/ */
static void set_current_line_number(long n) { serial_state[ring_buffer.command_port().index].last_N = n; } 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) #if ENABLED(BUFFER_MONITORING)
private: private:
-36
View File
@@ -1,36 +0,0 @@
/**
* 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 <https://www.gnu.org/licenses/>.
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(ONE_CLICK_PRINT)
#include "../gcode.h"
#include "../../sd/cardreader.h"
/**
* M1003: Set the current dir to /. Should come after 'M24'.
* Prevents the SD menu getting stuck in the newest file's workDir.
*/
void GcodeSuite::M1003() { card.cdroot(); }
#endif // ONE_CLICK_PRINT
+1 -1
View File
@@ -49,7 +49,7 @@
*/ */
void GcodeSuite::M306() { void GcodeSuite::M306() {
const uint8_t e = TERN0(HAS_MULTI_EXTRUDER, parser.intval('E', active_extruder)); const uint8_t e = TERN(HAS_MULTI_EXTRUDER, parser.intval('E', active_extruder), 0);
if (e >= (EXTRUDERS)) { if (e >= (EXTRUDERS)) {
SERIAL_ECHOLNPGM("?(E)xtruder index out of range (0-", (EXTRUDERS) - 1, ")."); SERIAL_ECHOLNPGM("?(E)xtruder index out of range (0-", (EXTRUDERS) - 1, ").");
return; return;
@@ -21,7 +21,7 @@
*/ */
/** /**
* gcode/temp/M86_M87.cpp * gcode/temp/M86-M87.cpp
* *
* Hotend Idle Timeout * Hotend Idle Timeout
*/ */
+12 -19
View File
@@ -893,11 +893,10 @@
#endif #endif
#endif #endif
// FSMC/SPI TFT Panels (LVGL) with encoder click wheel // FSMC/SPI TFT Panels (LVGL)
#if ENABLED(TFT_LVGL_UI) #if ENABLED(TFT_LVGL_UI)
#define HAS_TFT_LVGL_UI 1 #define HAS_TFT_LVGL_UI 1
#define SERIAL_RUNTIME_HOOK 1 #define SERIAL_RUNTIME_HOOK 1
#define STD_ENCODER_PULSES_PER_STEP 4
#endif #endif
// FSMC/SPI TFT Panels // FSMC/SPI TFT Panels
@@ -977,17 +976,6 @@
#define DETECT_I2C_LCD_DEVICE 1 #define DETECT_I2C_LCD_DEVICE 1
#endif #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 // Encoder behavior
#ifndef STD_ENCODER_PULSES_PER_STEP #ifndef STD_ENCODER_PULSES_PER_STEP
#if ENABLED(TOUCH_SCREEN) #if ENABLED(TOUCH_SCREEN)
@@ -1009,12 +997,10 @@
#define ENCODER_FEEDRATE_DEADZONE 6 #define ENCODER_FEEDRATE_DEADZONE 6
#endif #endif
/** // Shift register panels
* Shift register panels // ---------------------
* --------------------- // 2 wire Non-latching LCD SR from:
* 2 wire Non-latching LCD SR from: // https://github.com/fmalpartida/New-LiquidCrystal/wiki/schematics#user-content-ShiftRegister_connection
* https://github.com/fmalpartida/New-LiquidCrystal/wiki/schematics#user-content-ShiftRegister_connection
*/
#if ENABLED(FF_INTERFACEBOARD) #if ENABLED(FF_INTERFACEBOARD)
#define SR_LCD_3W_NL // Non latching 3 wire shift register #define SR_LCD_3W_NL // Non latching 3 wire shift register
#define IS_ULTIPANEL 1 #define IS_ULTIPANEL 1
@@ -1054,6 +1040,11 @@
#define EXTENSIBLE_UI #define EXTENSIBLE_UI
#endif #endif
// Aliases for LCD features
#if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
#define HAS_DWIN_E3V2 1
#endif
// E3V2 extras // E3V2 extras
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
#define SERIAL_CATCHALL 0 #define SERIAL_CATCHALL 0
@@ -1603,6 +1594,8 @@
#endif #endif
#if CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ #if CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ
#define IS_CORE 1 #define IS_CORE 1
#endif
#if IS_CORE
#if CORE_IS_XY #if CORE_IS_XY
#define CORE_AXIS_1 A_AXIS #define CORE_AXIS_1 A_AXIS
#define CORE_AXIS_2 B_AXIS #define CORE_AXIS_2 B_AXIS
+5 -15
View File
@@ -112,8 +112,8 @@
#undef DISABLE_IDLE_X #undef DISABLE_IDLE_X
#undef INPUT_SHAPING_X #undef INPUT_SHAPING_X
#undef SAFE_BED_LEVELING_START_X #undef SAFE_BED_LEVELING_START_X
#undef SHAPING_BUFFER_X
#undef SHAPING_FREQ_X #undef SHAPING_FREQ_X
#undef SHAPING_ZETA_X
#undef STEALTHCHOP_X #undef STEALTHCHOP_X
#endif #endif
@@ -128,8 +128,8 @@
#undef INPUT_SHAPING_Y #undef INPUT_SHAPING_Y
#undef QUICK_HOME #undef QUICK_HOME
#undef SAFE_BED_LEVELING_START_Y #undef SAFE_BED_LEVELING_START_Y
#undef SHAPING_BUFFER_Y
#undef SHAPING_FREQ_Y #undef SHAPING_FREQ_Y
#undef SHAPING_ZETA_Y
#undef STEALTHCHOP_Y #undef STEALTHCHOP_Y
#undef STEP_STATE_Y #undef STEP_STATE_Y
#endif #endif
@@ -142,11 +142,8 @@
#undef ENABLE_LEVELING_FADE_HEIGHT #undef ENABLE_LEVELING_FADE_HEIGHT
#undef HOME_Z_FIRST #undef HOME_Z_FIRST
#undef HOMING_Z_WITH_PROBE #undef HOMING_Z_WITH_PROBE
#undef INPUT_SHAPING_Z
#undef NUM_Z_STEPPERS #undef NUM_Z_STEPPERS
#undef SAFE_BED_LEVELING_START_Z #undef SAFE_BED_LEVELING_START_Z
#undef SHAPING_FREQ_Z
#undef SHAPING_ZETA_Z
#undef STEALTHCHOP_Z #undef STEALTHCHOP_Z
#undef STEP_STATE_Z #undef STEP_STATE_Z
#undef Z_IDLE_HEIGHT #undef Z_IDLE_HEIGHT
@@ -957,12 +954,6 @@
#define HAS_MOTOR_CURRENT_I2C 1 #define HAS_MOTOR_CURRENT_I2C 1
#endif #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 // X2 but not IDEX => Dual Synchronized X Steppers
#if defined(X2_DRIVER_TYPE) && DISABLED(DUAL_X_CARRIAGE) #if defined(X2_DRIVER_TYPE) && DISABLED(DUAL_X_CARRIAGE)
#define HAS_SYNCED_X_STEPPERS 1 #define HAS_SYNCED_X_STEPPERS 1
@@ -1188,7 +1179,7 @@
#elif HAS_DRIVER(A4988) #elif HAS_DRIVER(A4988)
#define MINIMUM_STEPPER_POST_DIR_DELAY 200 #define MINIMUM_STEPPER_POST_DIR_DELAY 200
#elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE #elif HAS_TRINAMIC_CONFIG || HAS_TRINAMIC_STANDALONE
#define MINIMUM_STEPPER_POST_DIR_DELAY 100 #define MINIMUM_STEPPER_POST_DIR_DELAY 70
#else #else
#define MINIMUM_STEPPER_POST_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire #define MINIMUM_STEPPER_POST_DIR_DELAY 0 // Expect at least 10µS since one Stepper ISR must transpire
#endif #endif
@@ -1314,8 +1305,7 @@
* currently HAL.h must be included ahead of pins.h. * currently HAL.h must be included ahead of pins.h.
*/ */
#if LCD_IS_SERIAL_HOST && !defined(LCD_SERIAL_PORT) #if LCD_IS_SERIAL_HOST && !defined(LCD_SERIAL_PORT)
#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) #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, AQUILA_V101)
#define LCD_SERIAL_PORT 1 #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) #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 #define LCD_SERIAL_PORT 2
@@ -1341,7 +1331,7 @@
#endif #endif
// Input shaping // Input shaping
#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y, INPUT_SHAPING_Z) #if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#define HAS_ZV_SHAPING 1 #define HAS_ZV_SHAPING 1
#endif #endif
+1 -1
View File
@@ -2814,7 +2814,7 @@
#if PIN_EXISTS(DIGIPOTSS) #if PIN_EXISTS(DIGIPOTSS)
#define HAS_MOTOR_CURRENT_SPI 1 #define HAS_MOTOR_CURRENT_SPI 1
#endif #endif
#if ANY_PIN(MOTOR_CURRENT_PWM_E, MOTOR_CURRENT_PWM_E0, MOTOR_CURRENT_PWM_E1) #if HAS_EXTRUDERS && PIN_EXISTS(MOTOR_CURRENT_PWM_E)
#define HAS_MOTOR_CURRENT_PWM_E 1 #define HAS_MOTOR_CURRENT_PWM_E 1
#endif #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) #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)
+2 -5
View File
@@ -52,6 +52,8 @@
#include HAL_PATH(.., inc/Conditionals_type.h) #include HAL_PATH(.., inc/Conditionals_type.h)
#include "Changes.h" #include "Changes.h"
#include "SanityCheck.h"
#include HAL_PATH(.., inc/SanityCheck.h)
// Include all core headers // Include all core headers
#include "../core/language.h" #include "../core/language.h"
@@ -63,8 +65,3 @@
#endif #endif
#include "../core/multi_language.h" #include "../core/multi_language.h"
#ifndef __MARLIN_DEPS__
#include "SanityCheck.h"
#include HAL_PATH(.., inc/SanityCheck.h)
#endif
+7 -59
View File
@@ -235,11 +235,9 @@ 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." #error "SERIAL_XON_XOFF and SERIAL_STATS_* features not supported on USB-native AVR devices."
#endif #endif
// Serial DMA is only available for some STM32 MCUs and HC32 // Serial DMA is only available for some STM32 MCUs
#if ENABLED(SERIAL_DMA) #if ENABLED(SERIAL_DMA)
#if defined(ARDUINO_ARCH_HC32) #if !HAL_STM32 || NONE(STM32F0xx, STM32F1xx, STM32F2xx, STM32F4xx, STM32F7xx)
// 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." #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) #elif !defined(HAL_UART_MODULE_ENABLED) || defined(HAL_UART_MODULE_ONLY)
#error "SERIAL_DMA requires STM32 platform HAL UART (without HAL_UART_MODULE_ONLY)." #error "SERIAL_DMA requires STM32 platform HAL UART (without HAL_UART_MODULE_ONLY)."
@@ -388,8 +386,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
/** /**
* Custom Boot and Status screens * Custom Boot and Status screens
*/ */
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_HD44780, HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, IS_DWIN_MARLINUI) #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) && NONE(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE, IS_DWIN_MARLINUI)
#error "SHOW_CUSTOM_BOOTSCREEN requires Character LCD, Graphical LCD, or TOUCH_UI_FTDI_EVE." #error "SHOW_CUSTOM_BOOTSCREEN requires Graphical LCD or TOUCH_UI_FTDI_EVE."
#elif ENABLED(SHOW_CUSTOM_BOOTSCREEN) && DISABLED(SHOW_BOOTSCREEN) #elif ENABLED(SHOW_CUSTOM_BOOTSCREEN) && DISABLED(SHOW_BOOTSCREEN)
#error "SHOW_CUSTOM_BOOTSCREEN requires SHOW_BOOTSCREEN." #error "SHOW_CUSTOM_BOOTSCREEN requires SHOW_BOOTSCREEN."
#elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_MARLINUI_U8GLIB #elif ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) && !HAS_MARLINUI_U8GLIB
@@ -1545,9 +1543,6 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#error "BED_TRAMMING_USE_PROBE is incompatible with SENSORLESS_PROBING." #error "BED_TRAMMING_USE_PROBE is incompatible with SENSORLESS_PROBING."
#endif #endif
#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 #endif
/** /**
@@ -1842,8 +1837,6 @@ 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." #error "DUAL_X_CARRIAGE requires X2_HOME_POS, X2_MIN_POS, and X2_MAX_POS."
#elif X_HOME_TO_MAX #elif X_HOME_TO_MAX
#error "DUAL_X_CARRIAGE requires X_HOME_DIR -1." #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
#endif #endif
@@ -2703,28 +2696,6 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#undef IS_U8GLIB_SSD1306 #undef IS_U8GLIB_SSD1306
#undef IS_EXTUI #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, \ #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) 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) #if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
@@ -4208,12 +4179,7 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
*/ */
#if HAS_ZV_SHAPING #if HAS_ZV_SHAPING
#if ENABLED(DELTA) #if ENABLED(DELTA)
#if !ALL(INPUT_SHAPING_X, INPUT_SHAPING_Y, INPUT_SHAPING_Z) #error "Input Shaping is not compatible with DELTA kinematics."
#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) #elif ENABLED(SCARA)
#error "Input Shaping is not compatible with SCARA kinematics." #error "Input Shaping is not compatible with SCARA kinematics."
#elif ENABLED(TPARA) #elif ENABLED(TPARA)
@@ -4225,19 +4191,9 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
#elif ENABLED(DIRECT_STEPPING) #elif ENABLED(DIRECT_STEPPING)
#error "Input Shaping is not compatible with DIRECT_STEPPING." #error "Input Shaping is not compatible with DIRECT_STEPPING."
#elif ALL(INPUT_SHAPING_X, CORE_IS_XZ) #elif ALL(INPUT_SHAPING_X, CORE_IS_XZ)
#if !ALL(INPUT_SHAPING_X, INPUT_SHAPING_Z) #error "INPUT_SHAPING_X is not supported with COREXZ."
#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) #elif ALL(INPUT_SHAPING_Y, CORE_IS_YZ)
#if !ALL(INPUT_SHAPING_Y, INPUT_SHAPING_Z) #error "INPUT_SHAPING_Y is not supported with COREYZ."
#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) #elif ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#if !ALL(INPUT_SHAPING_X, INPUT_SHAPING_Y) #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_*." #error "INPUT_SHAPING_X and INPUT_SHAPING_Y must both be enabled for COREXY, COREYX, or MARKFORGED_*."
@@ -4252,7 +4208,6 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
#else #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_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_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 #endif
#ifdef __AVR__ #ifdef __AVR__
#if ENABLED(INPUT_SHAPING_X) #if ENABLED(INPUT_SHAPING_X)
@@ -4269,13 +4224,6 @@ 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."); 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
#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
#endif #endif
+1 -1
View File
@@ -42,7 +42,7 @@
* version was tagged. * version was tagged.
*/ */
#ifndef STRING_DISTRIBUTION_DATE #ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2024-05-29" #define STRING_DISTRIBUTION_DATE "2024-04-10"
#endif #endif
/** /**
+8 -24
View File
@@ -99,8 +99,8 @@
#warning "Warning! Don't use dummy thermistors (998/999) for final build!" #warning "Warning! Don't use dummy thermistors (998/999) for final build!"
#endif #endif
#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT, UNIT_TEST, NO_USER_FEEDBACK_WARNING) #if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT)
#warning "Your Configuration provides no method to acquire user feedback! (Define NO_USER_FEEDBACK_WARNING to suppress this warning.)" #warning "Your Configuration provides no method to acquire user feedback!"
#endif #endif
#if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_BOARD #if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && !TEMP_SENSOR_BOARD
@@ -690,12 +690,8 @@
#warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save." #warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save."
#endif #endif
#if HOMING_Z_WITH_PROBE && IS_CARTESIAN && NONE(Z_SAFE_HOMING, NO_Z_SAFE_HOMING_WARNING) #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 define NO_Z_SAFE_HOMING_WARNING to suppress this warning.)" #error "Z_SAFE_HOMING is recommended when homing with a probe. Enable Z_SAFE_HOMING or comment out this line to continue."
#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 #endif
// //
@@ -718,8 +714,8 @@
#warning "Disabled CONFIGURATION_EMBEDDING because the target usually has less flash storage. Define FORCE_CONFIG_EMBED to override." #warning "Disabled CONFIGURATION_EMBEDDING because the target usually has less flash storage. Define FORCE_CONFIG_EMBED to override."
#endif #endif
#if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX && DISABLED(NO_LCD_CONTRAST_WARNING) #if HAS_LCD_CONTRAST && LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX
#warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX. (Define NO_LCD_CONTRAST_WARNING to suppress this warning.)" #warning "Contrast cannot be changed when LCD_CONTRAST_MIN >= LCD_CONTRAST_MAX."
#endif #endif
#if PROGRESS_MSG_EXPIRE > 0 && HAS_STATUS_MESSAGE_TIMEOUT #if PROGRESS_MSG_EXPIRE > 0 && HAS_STATUS_MESSAGE_TIMEOUT
@@ -788,13 +784,8 @@
/** /**
* Input Shaping * Input Shaping
*/ */
#if HAS_ZV_SHAPING #if HAS_ZV_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) #warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental."
#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 #endif
/** /**
@@ -869,10 +860,3 @@
#if DISABLED(EDITABLE_STEPS_PER_UNIT) #if DISABLED(EDITABLE_STEPS_PER_UNIT)
#warning "EDITABLE_STEPS_PER_UNIT is required to enable G92 runtime configuration of steps-per-unit." #warning "EDITABLE_STEPS_PER_UNIT is required to enable G92 runtime configuration of steps-per-unit."
#endif #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
+14 -60
View File
@@ -331,24 +331,15 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS
#endif // HAS_MEDIA #endif // HAS_MEDIA
switch (screen_charset) { #if ENABLED(SHOW_BOOTSCREEN)
// Set boot screen corner characters
#if ENABLED(SHOW_BOOTSCREEN) if (screen_charset == CHARSET_BOOT) {
case CHARSET_BOOT: { for (uint8_t i = 4; i--;)
// Set boot screen corner characters createChar_P(i, corner[i]);
for (uint8_t i = 4; i--;) createChar_P(i, corner[i]); }
} break; else
#endif #endif
{ // Info Screen uses 5 special characters
#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_BEDTEMP[0], bedTemp);
createChar_P(LCD_STR_DEGREE[0], degree); createChar_P(LCD_STR_DEGREE[0], degree);
createChar_P(LCD_STR_THERMOMETER[0], thermometer); createChar_P(LCD_STR_THERMOMETER[0], thermometer);
@@ -370,9 +361,7 @@ void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARS
createChar_P(LCD_STR_FOLDER[0], folder); createChar_P(LCD_STR_FOLDER[0], folder);
#endif #endif
} }
} break; }
}
} }
@@ -411,42 +400,6 @@ bool MarlinUI::detected() {
return TERN1(DETECT_I2C_LCD_DEVICE, lcd.LcdDetected() == 1); 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 #if HAS_SLOW_BUTTONS
uint8_t MarlinUI::read_slow_buttons() { uint8_t MarlinUI::read_slow_buttons() {
#if ENABLED(LCD_I2C_TYPE_MCP23017) #if ENABLED(LCD_I2C_TYPE_MCP23017)
@@ -513,8 +466,6 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
} }
void MarlinUI::show_bootscreen() { void MarlinUI::show_bootscreen() {
TERN_(SHOW_CUSTOM_BOOTSCREEN, show_custom_bootscreen());
set_custom_characters(CHARSET_BOOT); set_custom_characters(CHARSET_BOOT);
lcd.clear(); lcd.clear();
@@ -709,6 +660,9 @@ FORCE_INLINE void _draw_bed_status(const bool blink) {
lcd_put_u8str(F("K")); lcd_put_u8str(F("K"));
#else #else
lcd_put_u8str(cutter_power2str(cutter.unitPower)); lcd_put_u8str(cutter_power2str(cutter.unitPower));
#if CUTTER_UNIT_IS(PERCENT)
lcd_put_u8str(F("%"));
#endif
#endif #endif
lcd_put_u8str(F(" ")); lcd_put_u8str(F(" "));
@@ -1215,7 +1169,7 @@ void MarlinUI::draw_status_screen() {
lcd_moveto(LCD_WIDTH - 9, 2); lcd_moveto(LCD_WIDTH - 9, 2);
lcd_put_lchar('S'); lcd_put_lchar('S');
#endif // LCD_INFO_SCREEN_STYLE #endif // LCD_INFO_SCREEN_STYLE
-14
View File
@@ -27,20 +27,6 @@
#include "../../inc/MarlinConfig.h" #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) #if ENABLED(LCD_I2C_TYPE_PCF8575)
// NOTE: These are register-mapped pins on the PCF8575 controller, not Arduino pins. // NOTE: These are register-mapped pins on the PCF8575 controller, not Arduino pins.
+2 -2
View File
@@ -24,9 +24,9 @@
#include "../inc/MarlinConfig.h" #include "../inc/MarlinConfig.h"
#if ((!HAS_ADC_BUTTONS && IS_NEWPANEL) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL #if ((!HAS_ADC_BUTTONS && IS_NEWPANEL) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL
#define HAS_MARLINUI_ENCODER 1 #define HAS_ENCODER_WHEEL 1
#endif #endif
#if (HAS_MARLINUI_ENCODER || ANY_BUTTON(ENC, BACK, UP, DOWN, LEFT, RIGHT)) && DISABLED(TOUCH_UI_FTDI_EVE) #if (HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DOWN, LEFT, RIGHT)) && DISABLED(TOUCH_UI_FTDI_EVE)
#define HAS_DIGITAL_BUTTONS 1 #define HAS_DIGITAL_BUTTONS 1
#endif #endif
#if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL)) #if !HAS_ADC_BUTTONS && (IS_RRW_KEYPAD || (HAS_WIRED_LCD && !IS_NEWPANEL))
+1 -7
View File
@@ -377,13 +377,7 @@ void MarlinUI::draw_kill_screen() {
void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
#if HAS_DISPLAY_SLEEP #if HAS_DISPLAY_SLEEP
void MarlinUI::sleep_display(const bool sleep/*=true*/) { void MarlinUI::sleep_display(const bool sleep/*=true*/) { sleep ? u8g.sleepOn() : u8g.sleepOff(); }
static bool asleep = false;
if (asleep != sleep){
sleep ? u8g.sleepOn() : u8g.sleepOff();
asleep = sleep;
}
}
#endif #endif
#if HAS_LCD_BRIGHTNESS #if HAS_LCD_BRIGHTNESS
+72 -24
View File
@@ -42,6 +42,10 @@
#include <stdlib.h> #include <stdlib.h>
#ifndef ENCODER_PULSES_PER_STEP
#define ENCODER_PULSES_PER_STEP 4
#endif
EncoderRate encoderRate; EncoderRate encoderRate;
// TODO: Replace with ui.quick_feedback // TODO: Replace with ui.quick_feedback
@@ -49,12 +53,32 @@ void Encoder_tick() {
TERN_(HAS_BEEPER, if (ui.sound_on) buzzer.click(10)); 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 // Analyze encoder value and return state
EncoderState encoderReceiveAnalyze() { EncoderState encoderReceiveAnalyze() {
const millis_t now = millis(); const millis_t now = millis();
static int8_t temp_diff = 0; // Cleared on each full step, as configured static uint8_t lastEncoderBits;
uint8_t newbutton = 0;
static signed char temp_diff = 0;
EncoderState temp_diffState = ENCODER_DIFF_NO; EncoderState temp_diffState = ENCODER_DIFF_NO;
if (BUTTON_PRESSED(EN1)) newbutton |= EN_A;
if (BUTTON_PRESSED(EN2)) newbutton |= EN_B;
if (BUTTON_PRESSED(ENC)) { if (BUTTON_PRESSED(ENC)) {
static millis_t next_click_update_ms; static millis_t next_click_update_ms;
if (ELAPSED(now, next_click_update_ms)) { if (ELAPSED(now, next_click_update_ms)) {
@@ -74,47 +98,71 @@ EncoderState encoderReceiveAnalyze() {
} }
else return ENCODER_DIFF_NO; 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;
}
temp_diff += ui.get_encoder_delta(); if (ABS(temp_diff) >= ENCODER_PULSES_PER_STEP) {
if (temp_diff > 0) temp_diffState = TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CCW, ENCODER_DIFF_CW);
const int8_t abs_diff = ABS(temp_diff); else temp_diffState = TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CW, ENCODER_DIFF_CCW);
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) #if ENABLED(ENCODER_RATE_MULTIPLIER)
const millis_t ms = millis(); millis_t ms = millis();
int32_t encoder_multiplier = 1;
// Encoder rate multiplier // if must encoder rati multiplier
if (encoderRate.enabled) { if (encoderRate.enabled) {
// Note that the rate is always calculated between two passes through the const float abs_diff = ABS(temp_diff),
// loop and that the abs of the temp_diff value is tracked. encoderMovementSteps = abs_diff / (ENCODER_PULSES_PER_STEP);
const float encoderStepRate = ((float(abs_diff) / float(ENCODER_PULSES_PER_STEP)) * 1000.0f) / float(ms - encoderRate.lastEncoderTime); 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 (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;
}
encoderRate.lastEncoderTime = ms; 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 encoder_multiplier = 1;
#endif #endif
encoderRate.encoderMoveValue = abs_diff * encoder_multiplier / (ENCODER_PULSES_PER_STEP); // encoderRate.encoderMoveValue += (temp_diff * encoder_multiplier) / (ENCODER_PULSES_PER_STEP);
encoderRate.encoderMoveValue = (temp_diff * encoder_multiplier) / (ENCODER_PULSES_PER_STEP);
if (encoderRate.encoderMoveValue < 0) encoderRate.encoderMoveValue = -encoderRate.encoderMoveValue;
temp_diff = 0; temp_diff = 0;
} }
if (temp_diffState != ENCODER_DIFF_NO) { if (temp_diffState != ENCODER_DIFF_NO) {
TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout()); TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout());
if (!ui.backlight) ui.refresh_brightness(); if (!ui.backlight) ui.refresh_brightness();
} }
return temp_diffState; return temp_diffState;
} }
+3
View File
@@ -47,6 +47,9 @@ typedef enum {
#define ENCODER_WAIT_MS TERN(DWIN_LCD_PROUI, 10, 20) #define ENCODER_WAIT_MS TERN(DWIN_LCD_PROUI, 10, 20)
// Encoder initialization
void encoderConfiguration();
// Analyze encoder value and return state // Analyze encoder value and return state
EncoderState encoderReceiveAnalyze(); EncoderState encoderReceiveAnalyze();
+1
View File
@@ -4078,6 +4078,7 @@ void hmiInit() {
} }
void dwinInitScreen() { void dwinInitScreen() {
encoderConfiguration();
hmiInit(); hmiInit();
hmiSetLanguageCache(); hmiSetLanguageCache();
hmiStartFrame(true); hmiStartFrame(true);
+1
View File
@@ -5143,6 +5143,7 @@ void MarlinUI::init_lcd() {
if (dwinHandshake()) SERIAL_ECHOLNPGM("ok."); else SERIAL_ECHOLNPGM("error."); if (dwinHandshake()) SERIAL_ECHOLNPGM("ok."); else SERIAL_ECHOLNPGM("error.");
dwinFrameSetDir(1); // Orientation 90° dwinFrameSetDir(1); // Orientation 90°
dwinUpdateLCD(); // Show bootscreen (first image) dwinUpdateLCD(); // Show bootscreen (first image)
encoderConfiguration();
for (uint16_t t = 0; t <= 100; t += 2) { for (uint16_t t = 0; t <= 100; t += 2) {
dwinIconShow(ICON, ICON_Bar, 15, 260); dwinIconShow(ICON, ICON_Bar, 15, 260);
dwinDrawRectangle(1, COLOR_BG_BLACK, 15 + t * 242 / 100, 260, 257, 280); dwinDrawRectangle(1, COLOR_BG_BLACK, 15 + t * 242 / 100, 260, 257, 280);
@@ -22,6 +22,9 @@
/** /**
* Bed Level Tools for Pro UI * 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 * Based on the original work of: Henri-J-Norden
* https://github.com/Jyers/Marlin/pull/126 * https://github.com/Jyers/Marlin/pull/126
@@ -22,6 +22,9 @@
/** /**
* Bed Level Tools for Pro UI * 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 * Based on the original work of: Henri-J-Norden
* https://github.com/Jyers/Marlin/pull/126 * https://github.com/Jyers/Marlin/pull/126
+11 -23
View File
@@ -22,8 +22,7 @@
/** /**
* DWIN Enhanced implementation for PRO UI * DWIN Enhanced implementation for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.25.3 * Version: 3.25.3
* Date: 2023/05/18 * Date: 2023/05/18
*/ */
@@ -38,7 +37,6 @@
#include "../../utf8.h" #include "../../utf8.h"
#include "../../marlinui.h" #include "../../marlinui.h"
#include "../../extui/ui_api.h"
#include "../../../MarlinCore.h" #include "../../../MarlinCore.h"
#include "../../../core/serial.h" #include "../../../core/serial.h"
#include "../../../core/macros.h" #include "../../../core/macros.h"
@@ -1313,7 +1311,7 @@ void eachMomentUpdate() {
TERN_(PIDTEMP, if (hmiValue.tempControl == PIDTEMP_START) { plot.update(thermalManager.wholeDegHotend(0)); }) TERN_(PIDTEMP, if (hmiValue.tempControl == PIDTEMP_START) { plot.update(thermalManager.wholeDegHotend(0)); })
TERN_(PIDTEMPBED, if (hmiValue.tempControl == PIDTEMPBED_START) { plot.update(thermalManager.wholeDegBed()); }) TERN_(PIDTEMPBED, if (hmiValue.tempControl == PIDTEMPBED_START) { plot.update(thermalManager.wholeDegBed()); })
TERN_(PIDTEMPCHAMBER, if (hmiValue.tempControl == PIDTEMPCHAMBER_START) { plot.update(thermalManager.wholeDegChamber()); }) TERN_(PIDTEMPCHAMBER, if (hmiValue.tempControl == PIDTEMPCHAMBER_START) { plot.update(thermalManager.wholeDegChamber()); })
TERN_(MPCTEMP, if (hmiValue.tempControl == MPC_STARTED) { plot.update(thermalManager.wholeDegHotend(0)); }) TERN_(MPCTEMP, if (hmiValue.tempControl == MPCTEMP_START) { plot.update(thermalManager.wholeDegHotend(0)); })
if (hmiFlag.abort_flag || hmiFlag.pause_flag || print_job_timer.isPaused()) { if (hmiFlag.abort_flag || hmiFlag.pause_flag || print_job_timer.isPaused()) {
hmiReturnScreen(); hmiReturnScreen();
} }
@@ -1568,7 +1566,7 @@ void dwinLevelingDone() {
switch (hmiValue.tempControl) { switch (hmiValue.tempControl) {
default: return; default: return;
#if ENABLED(MPC_AUTOTUNE) #if ENABLED(MPC_AUTOTUNE)
case MPC_STARTED: case MPCTEMP_START:
DWINUI::drawCenteredString(hmiData.colorPopupTxt, 70, GET_TEXT_F(MSG_MPC_AUTOTUNE)); 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::drawString(hmiData.colorPopupTxt, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("MPC target: Celsius"));
DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, GET_TEXT_F(MSG_PID_FOR_NOZZLE)); DWINUI::drawCenteredString(hmiData.colorPopupTxt, 92, GET_TEXT_F(MSG_PID_FOR_NOZZLE));
@@ -1621,7 +1619,7 @@ void dwinLevelingDone() {
switch (result) { switch (result) {
#if ENABLED(MPCTEMP) #if ENABLED(MPCTEMP)
case MPC_STARTED: case MPCTEMP_START:
#elif ENABLED(PIDTEMP) #elif ENABLED(PIDTEMP)
case PIDTEMP_START: case PIDTEMP_START:
#endif #endif
@@ -1657,7 +1655,7 @@ void dwinLevelingDone() {
void drawHPlot() { void drawHPlot() {
TERN_(PIDTEMP, dwinDrawPlot(PIDTEMP_START)); TERN_(PIDTEMP, dwinDrawPlot(PIDTEMP_START));
TERN_(MPCTEMP, dwinDrawPlot(MPC_STARTED)); TERN_(MPCTEMP, dwinDrawPlot(MPCTEMP_START));
} }
void drawBPlot() { void drawBPlot() {
TERN_(PIDTEMPBED, dwinDrawPlot(PIDTEMPBED_START)); TERN_(PIDTEMPBED, dwinDrawPlot(PIDTEMPBED_START));
@@ -1743,7 +1741,7 @@ void dwinLevelingDone() {
void dwinMPCTuning(tempcontrol_t result) { void dwinMPCTuning(tempcontrol_t result) {
hmiValue.tempControl = result; hmiValue.tempControl = result;
switch (result) { switch (result) {
case MPC_STARTED: case MPCTEMP_START:
hmiSaveProcessID(ID_MPCProcess); hmiSaveProcessID(ID_MPCProcess);
#if PROUI_TUNING_GRAPH #if PROUI_TUNING_GRAPH
dwinDrawPIDMPCPopup(); dwinDrawPIDMPCPopup();
@@ -1911,6 +1909,7 @@ void MarlinUI::init_lcd() {
const bool hs = dwinHandshake(); UNUSED(hs); const bool hs = dwinHandshake(); UNUSED(hs);
dwinFrameSetDir(1); dwinFrameSetDir(1);
dwinJPGCacheTo1(Language_English); dwinJPGCacheTo1(Language_English);
encoderConfiguration();
} }
void dwinInitScreen() { void dwinInitScreen() {
@@ -3146,7 +3145,7 @@ void drawControlMenu() {
enableLiveCaseLightBrightness = true; // Allow live update of brightness in control menu enableLiveCaseLightBrightness = true; // Allow live update of brightness in control menu
MENU_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawSubMenu, drawCaseLightMenu); MENU_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawSubMenu, drawCaseLightMenu);
#else #else
EDIT_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, setCaseLight, &caselight.on); MENU_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, setCaseLight, &caselight.on);
#endif #endif
#endif #endif
#if ENABLED(LED_CONTROL_MENU) #if ENABLED(LED_CONTROL_MENU)
@@ -3316,7 +3315,7 @@ void drawFilSetMenu() {
if (SET_MENU(filSetMenu, MSG_FILAMENT_SET, 9)) { if (SET_MENU(filSetMenu, MSG_FILAMENT_SET, 9)) {
BACK_ITEM(drawAdvancedSettingsMenu); BACK_ITEM(drawAdvancedSettingsMenu);
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
EDIT_ITEM(ICON_Runout, MSG_RUNOUT_SENSOR, onDrawChkbMenu, setRunoutEnable, &runout.enabled); EDIT_ITEM(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, setRunoutEnable, &runout.enabled);
#endif #endif
#if HAS_FILAMENT_RUNOUT_DISTANCE #if HAS_FILAMENT_RUNOUT_DISTANCE
EDIT_ITEM(ICON_Runout, MSG_RUNOUT_DISTANCE_MM, onDrawPFloatMenu, setRunoutDistance, &runout.runout_distance()); EDIT_ITEM(ICON_Runout, MSG_RUNOUT_DISTANCE_MM, onDrawPFloatMenu, setRunoutDistance, &runout.runout_distance());
@@ -3407,7 +3406,7 @@ void drawTuneMenu() {
MENU_ITEM(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, changeFilament); MENU_ITEM(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, changeFilament);
#endif #endif
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
EDIT_ITEM(ICON_Runout, MSG_RUNOUT_SENSOR, onDrawChkbMenu, setRunoutEnable, &runout.enabled); EDIT_ITEM(ICON_Runout, MSG_RUNOUT_ENABLE, onDrawChkbMenu, setRunoutEnable, &runout.enabled);
#endif #endif
#if ENABLED(PROUI_ITEM_PLR) #if ENABLED(PROUI_ITEM_PLR)
EDIT_ITEM(ICON_Pwrlossr, MSG_OUTAGE_RECOVERY, onDrawChkbMenu, setPwrLossr, &recovery.enabled); EDIT_ITEM(ICON_Pwrlossr, MSG_OUTAGE_RECOVERY, onDrawChkbMenu, setPwrLossr, &recovery.enabled);
@@ -3478,16 +3477,9 @@ void drawTuneMenu() {
void setShapingYZeta() { hmiValue.axis = Y_AXIS; setFloatOnClick(0, 1, 2, stepper.get_shaping_damping_ratio(Y_AXIS), applyShapingZeta); } void setShapingYZeta() { hmiValue.axis = Y_AXIS; setFloatOnClick(0, 1, 2, stepper.get_shaping_damping_ratio(Y_AXIS), applyShapingZeta); }
#endif #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() { void drawInputShaping_menu() {
checkkey = ID_Menu; checkkey = ID_Menu;
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))) { if (SET_MENU(inputShapingMenu, MSG_INPUT_SHAPING, 5)) {
BACK_ITEM(drawMotionMenu); BACK_ITEM(drawMotionMenu);
#if ENABLED(INPUT_SHAPING_X) #if ENABLED(INPUT_SHAPING_X)
MENU_ITEM(ICON_ShapingX, MSG_SHAPING_A_FREQ, onDrawShapingXFreq, setShapingXFreq); MENU_ITEM(ICON_ShapingX, MSG_SHAPING_A_FREQ, onDrawShapingXFreq, setShapingXFreq);
@@ -3497,10 +3489,6 @@ void drawTuneMenu() {
MENU_ITEM(ICON_ShapingY, MSG_SHAPING_B_FREQ, onDrawShapingYFreq, setShapingYFreq); MENU_ITEM(ICON_ShapingY, MSG_SHAPING_B_FREQ, onDrawShapingYFreq, setShapingYFreq);
MENU_ITEM(ICON_ShapingY, MSG_SHAPING_B_ZETA, onDrawShapingYZeta, setShapingYZeta); MENU_ITEM(ICON_ShapingY, MSG_SHAPING_B_ZETA, onDrawShapingYZeta, setShapingYZeta);
#endif #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); updateMenu(inputShapingMenu);
} }
+2 -3
View File
@@ -23,8 +23,7 @@
/** /**
* DWIN Enhanced implementation for PRO UI * DWIN Enhanced implementation for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.25.3 * Version: 3.25.3
* Date: 2023/05/18 * Date: 2023/05/18
*/ */
@@ -91,7 +90,7 @@ enum processID : uint8_t {
PID_TUNING_TIMEOUT, PID_TUNING_TIMEOUT,
#endif #endif
#if ENABLED(MPC_AUTOTUNE) #if ENABLED(MPC_AUTOTUNE)
MPC_STARTED, MPCTEMP_START,
MPC_TEMP_ERROR, MPC_TEMP_ERROR,
MPC_INTERRUPTED, MPC_INTERRUPTED,
#endif #endif
+1 -2
View File
@@ -23,8 +23,7 @@
/** /**
* DWIN general defines and data structs for PRO UI * DWIN general defines and data structs for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.12.2 * Version: 3.12.2
* Date: 2022/08/08 * Date: 2022/08/08
*/ */
+1 -2
View File
@@ -22,8 +22,7 @@
/** /**
* DWIN Enhanced implementation for PRO UI * DWIN Enhanced implementation for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.12.1 * Version: 3.12.1
* Date: 2023/01/22 * Date: 2023/01/22
*/ */
+1 -2
View File
@@ -23,8 +23,7 @@
/** /**
* DWIN Enhanced implementation for PRO UI * DWIN Enhanced implementation for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.12.1 * Version: 3.12.1
* Date: 2023/01/22 * Date: 2023/01/22
*/ */
+1 -2
View File
@@ -22,8 +22,7 @@
/** /**
* DWIN Enhanced implementation for PRO UI * DWIN Enhanced implementation for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.11.1 * Version: 3.11.1
* Date: 2022/02/28 * Date: 2022/02/28
*/ */
+1 -2
View File
@@ -23,8 +23,7 @@
/** /**
* DWIN Enhanced implementation for PRO UI * DWIN Enhanced implementation for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.11.1 * Version: 3.11.1
* Date: 2022/02/28 * Date: 2022/02/28
*/ */
+1 -2
View File
@@ -22,8 +22,7 @@
/** /**
* DWIN Enhanced implementation for PRO UI * DWIN Enhanced implementation for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.21.1 * Version: 3.21.1
* Date: 2023/03/21 * Date: 2023/03/21
*/ */
+1 -2
View File
@@ -23,8 +23,7 @@
/** /**
* DWIN Enhanced implementation for PRO UI * DWIN Enhanced implementation for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 3.21.1 * Version: 3.21.1
* Date: 2023/03/21 * Date: 2023/03/21
*/ */
+1 -2
View File
@@ -22,8 +22,7 @@
/** /**
* DWIN Endstops diagnostic page for PRO UI * DWIN Endstops diagnostic page for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 1.4.3 * Version: 1.4.3
* Date: 2023/05/10 * Date: 2023/05/10
*/ */
+1 -2
View File
@@ -23,8 +23,7 @@
/** /**
* DWIN End Stops diagnostic page for PRO UI * DWIN End Stops diagnostic page for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 1.4.3 * Version: 1.4.3
* Date: 2023/05/10 * Date: 2023/05/10
*/ */
+1 -2
View File
@@ -22,8 +22,7 @@
/** /**
* Lock screen implementation for PRO UI * Lock screen implementation for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 2.3.2 * Version: 2.3.2
* Date: 2022/11/20 * Date: 2022/11/20
*/ */
+1 -2
View File
@@ -23,8 +23,7 @@
/** /**
* Lock screen implementation for PRO UI * Lock screen implementation for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 2.3.2 * Version: 2.3.2
* Date: 2022/11/20 * Date: 2022/11/20
*/ */
+1 -2
View File
@@ -22,8 +22,7 @@
/** /**
* Mesh Viewer for PRO UI * Mesh Viewer for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* version: 4.2.1 * version: 4.2.1
* Date: 2023/05/05 * Date: 2023/05/05
*/ */
+1 -2
View File
@@ -23,8 +23,7 @@
/** /**
* Mesh Viewer for PRO UI * Mesh Viewer for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* version: 4.2.1 * version: 4.2.1
* Date: 2023/05/05 * Date: 2023/05/05
*/ */
+3 -4
View File
@@ -22,8 +22,7 @@
/** /**
* Print Stats page for PRO UI * Print Stats page for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 1.4.0 * Version: 1.4.0
* Date: 2022/12/03 * Date: 2022/12/03
*/ */
@@ -56,9 +55,9 @@ void PrintStats::draw() {
DWINUI::drawString(MRG, 80, TS(GET_TEXT_F(MSG_INFO_PRINT_COUNT), F(": "), ps.totalPrints)); 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)); 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); duration_t(print_job_timer.getStats().printTime).toDigital(str, true);
DWINUI::drawString(MRG, 120, TS(GET_TEXT_F(MSG_INFO_PRINT_TIME), F(": "), str)); DWINUI::drawString(MRG, 120, MString<50>(GET_TEXT_F(MSG_INFO_PRINT_TIME), F(": "), str));
duration_t(print_job_timer.getStats().longestPrint).toDigital(str, true); duration_t(print_job_timer.getStats().longestPrint).toDigital(str, true);
DWINUI::drawString(MRG, 140, TS(GET_TEXT_F(MSG_INFO_PRINT_LONGEST), F(": "), str)); DWINUI::drawString(MRG, 140, MString<50>(GET_TEXT(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"))); DWINUI::drawString(MRG, 160, TS(GET_TEXT_F(MSG_INFO_PRINT_FILAMENT), F(": "), p_float_t(ps.filamentUsed / 1000, 2), F(" m")));
} }
+1 -2
View File
@@ -23,8 +23,7 @@
/** /**
* Print Stats page for PRO UI * Print Stats page for PRO UI
* Based on the original work of: Miguel Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
* https://github.com/mriscoc/Ender3V2S1
* Version: 1.4.0 * Version: 1.4.0
* Date: 2022/12/03 * Date: 2022/12/03
*/ */
+3 -3
View File
@@ -65,8 +65,8 @@ namespace ExtUI {
void onIdle() {} void onIdle() {}
void onPrinterKilled(FSTR_P const error, FSTR_P const component) {} void onPrinterKilled(FSTR_P const error, FSTR_P const component) {}
void onMediaMounted() {} void onMediaInserted() {}
void onMediaError() {} void onMediaError() {}
void onMediaRemoved() {} void onMediaRemoved() {}
void onHeatingError(const heater_id_t heater_id) { void onHeatingError(const heater_id_t heater_id) {
@@ -222,7 +222,7 @@ namespace ExtUI {
void onMPCTuning(const mpcresult_t rst) { void onMPCTuning(const mpcresult_t rst) {
// Called for temperature MPC tuning result // Called for temperature MPC tuning result
switch (rst) { switch (rst) {
case MPC_STARTED: dwinMPCTuning(MPC_STARTED); break; case MPC_STARTED: dwinMPCTuning(MPCTEMP_START); break;
case MPC_TEMP_ERROR: dwinMPCTuning(MPC_TEMP_ERROR); break; case MPC_TEMP_ERROR: dwinMPCTuning(MPC_TEMP_ERROR); break;
case MPC_INTERRUPTED: dwinMPCTuning(MPC_INTERRUPTED); break; case MPC_INTERRUPTED: dwinMPCTuning(MPC_INTERRUPTED); break;
case MPC_DONE: dwinMPCTuning(AUTOTUNE_DONE); break; case MPC_DONE: dwinMPCTuning(AUTOTUNE_DONE); break;
@@ -45,9 +45,9 @@ namespace ExtUI {
chiron.printerKilled(error, component); chiron.printerKilled(error, component);
} }
void onMediaMounted() { chiron.mediaEvent(AC_media_inserted); } void onMediaInserted() { chiron.mediaEvent(AC_media_inserted); }
void onMediaError() { chiron.mediaEvent(AC_media_error); } void onMediaError() { chiron.mediaEvent(AC_media_error); }
void onMediaRemoved() { chiron.mediaEvent(AC_media_removed); } void onMediaRemoved() { chiron.mediaEvent(AC_media_removed); }
void onHeatingError(const heater_id_t header_id) {} void onHeatingError(const heater_id_t header_id) {}
void onMinTempError(const heater_id_t header_id) {} void onMinTempError(const heater_id_t header_id) {}
@@ -564,8 +564,8 @@ void ChironTFT::panelInfo(uint8_t req) {
} break; } break;
case 8: // A8 Get SD Card list A8 S0 case 8: // A8 Get SD Card list A8 S0
if (!isMediaMounted()) safe_delay(500); if (!isMediaInserted()) safe_delay(500);
if (!isMediaMounted()) // Make sure the card is removed if (!isMediaInserted()) // Make sure the card is removed
tftSendLn(AC_msg_no_sd_card); tftSendLn(AC_msg_no_sd_card);
else if (panel_command[3] == 'S') else if (panel_command[3] == 'S')
sendFileList( atoi( &panel_command[4] ) ); 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); DEBUG_ECHOLNPGM("Moving to mesh point at x: ", pos.x, " y: ", pos.y, " z: ", pos_z);
#endif #endif
// Go up before moving // Go up before moving
setAxisPosition_mm(3.0f, Z); setAxisPosition_mm(3.0,Z);
setAxisPosition_mm(17.0f + (93.0f * pos.x), X); setAxisPosition_mm(17 + (93 * pos.x), X);
setAxisPosition_mm(20.0f + (93.0f * pos.y), Y); setAxisPosition_mm(20 + (93 * pos.y), Y);
setAxisPosition_mm(0.0f, Z); setAxisPosition_mm(0.0, Z);
#if ACDEBUG(AC_INFO) #if ACDEBUG(AC_INFO)
DEBUG_ECHOLNPGM("Current Z: ", getAxisPosition_mm(Z)); DEBUG_ECHOLNPGM("Current Z: ", getAxisPosition_mm(Z));
#endif #endif
@@ -39,7 +39,7 @@ namespace ExtUI {
void onIdle() { anycubicTFT.onCommandScan(); } void onIdle() { anycubicTFT.onCommandScan(); }
void onPrinterKilled(FSTR_P const error, FSTR_P const component) { anycubicTFT.onKillTFT(); } void onPrinterKilled(FSTR_P const error, FSTR_P const component) { anycubicTFT.onKillTFT(); }
void onMediaMounted() { anycubicTFT.onSDCardStateChange(true); } void onMediaInserted() { anycubicTFT.onSDCardStateChange(true); }
void onMediaError() { anycubicTFT.onSDCardError(); } void onMediaError() { anycubicTFT.onSDCardError(); }
void onMediaRemoved() { anycubicTFT.onSDCardStateChange(false); } void onMediaRemoved() { anycubicTFT.onSDCardStateChange(false); }
@@ -138,8 +138,8 @@ void AnycubicTFT::onKillTFT() {
SENDLINE_DBG_PGM("J11", "TFT Serial Debug: Kill command... J11"); SENDLINE_DBG_PGM("J11", "TFT Serial Debug: Kill command... J11");
} }
void AnycubicTFT::onSDCardStateChange(bool isMounted) { void AnycubicTFT::onSDCardStateChange(bool isInserted) {
DEBUG_ECHOLNPGM("TFT Serial Debug: onSDCardStateChange event triggered...", isMounted); DEBUG_ECHOLNPGM("TFT Serial Debug: onSDCardStateChange event triggered...", isInserted);
doSDCardStateCheck(); doSDCardStateCheck();
} }
@@ -363,7 +363,7 @@ void AnycubicTFT::renderCurrentFileList() {
SENDLINE_PGM("FN "); // Filelist start SENDLINE_PGM("FN "); // Filelist start
if (!isMediaMounted() && !specialMenu) { if (!isMediaInserted() && !specialMenu) {
SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to render Current File List... J02"); SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to render Current File List... J02");
SENDLINE_PGM("<SPECI~1.GCO"); SENDLINE_PGM("<SPECI~1.GCO");
@@ -579,7 +579,7 @@ void AnycubicTFT::getCommandFromTFT() {
#if HAS_MEDIA #if HAS_MEDIA
if (isPrintingFromMedia()) { if (isPrintingFromMedia()) {
SEND_PGM("A6V "); SEND_PGM("A6V ");
if (isMediaMounted()) if (isMediaInserted())
SENDLINE(ui8tostr3rj(getProgress_percent())); SENDLINE(ui8tostr3rj(getProgress_percent()));
else else
SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to return printing status... J02"); SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to return printing status... J02");
@@ -632,7 +632,7 @@ void AnycubicTFT::getCommandFromTFT() {
case 13: // A13 SELECTION FILE case 13: // A13 SELECTION FILE
#if HAS_MEDIA #if HAS_MEDIA
if (isMediaMounted()) { if (isMediaInserted()) {
starpos = (strchr(tftStrchrPtr + 4, '*')); starpos = (strchr(tftStrchrPtr + 4, '*'));
if (tftStrchrPtr[4] == '/') { if (tftStrchrPtr[4] == '/') {
strcpy(selectedDirectory, tftStrchrPtr + 5); strcpy(selectedDirectory, tftStrchrPtr + 5);
@@ -831,7 +831,7 @@ void AnycubicTFT::getCommandFromTFT() {
case 26: // A26 refresh SD case 26: // A26 refresh SD
#if HAS_MEDIA #if HAS_MEDIA
if (isMediaMounted()) { if (isMediaInserted()) {
if (strlen(selectedDirectory) > 0) { if (strlen(selectedDirectory) > 0) {
FileList currentFileList; FileList currentFileList;
if ((selectedDirectory[0] == '.') && (selectedDirectory[1] == '.')) { if ((selectedDirectory[0] == '.') && (selectedDirectory[1] == '.')) {
@@ -883,12 +883,12 @@ void AnycubicTFT::getCommandFromTFT() {
} }
void AnycubicTFT::doSDCardStateCheck() { void AnycubicTFT::doSDCardStateCheck() {
#if HAS_MEDIA #if ALL(HAS_MEDIA, HAS_SD_DETECT)
const bool isMounted = isMediaMounted(); bool isInserted = isMediaInserted();
if (isMounted) if (isInserted)
SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isMounted"); SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted");
else else
SENDLINE_DBG_PGM("J01", "TFT Serial Debug: SD card state changed... !isMounted"); SENDLINE_DBG_PGM("J01", "TFT Serial Debug: SD card state changed... !isInserted");
#endif #endif
} }
@@ -1268,7 +1268,7 @@ namespace Anycubic {
break; break;
case 4: // page refresh case 4: // page refresh
if (!isMediaMounted()) safe_delay(500); if (!isMediaInserted()) safe_delay(500);
filenavigator.reset(); filenavigator.reset();
@@ -45,9 +45,9 @@ namespace ExtUI {
dgus.printerKilled(error, component); dgus.printerKilled(error, component);
} }
void onMediaMounted() { dgus.mediaEvent(AC_media_inserted); } void onMediaInserted() { dgus.mediaEvent(AC_media_inserted); }
void onMediaError() { dgus.mediaEvent(AC_media_error); } void onMediaError() { dgus.mediaEvent(AC_media_error); }
void onMediaRemoved() { dgus.mediaEvent(AC_media_removed); } void onMediaRemoved() { dgus.mediaEvent(AC_media_removed); }
void onHeatingError(const heater_id_t header_id) {} void onHeatingError(const heater_id_t header_id) {}
void onMinTempError(const heater_id_t header_id) {} void onMinTempError(const heater_id_t header_id) {}

Some files were not shown because too many files have changed in this diff Show More