mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2026-01-08 23:57:44 -07:00
Merge branch 'bugfix-2.1.x' into pr/25901
This commit is contained in:
commit
144f74c846
245 changed files with 2617 additions and 2001 deletions
|
|
@ -38,7 +38,7 @@
|
|||
"platformio.platformio-ide",
|
||||
"marlinfirmware.auto-build",
|
||||
"editorconfig.editorconfig"
|
||||
],
|
||||
]
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
|
|
|||
42
.github/workflows/ci-validate-boards.yml
vendored
42
.github/workflows/ci-validate-boards.yml
vendored
|
|
@ -9,14 +9,14 @@ name: CI - Validate boards.h
|
|||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
- bugfix-2.1.x
|
||||
paths:
|
||||
- 'Marlin/src/core/boards.h'
|
||||
- "Marlin/src/core/boards.h"
|
||||
push:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
- bugfix-2.1.x
|
||||
paths:
|
||||
- 'Marlin/src/core/boards.h'
|
||||
- "Marlin/src/core/boards.h"
|
||||
|
||||
jobs:
|
||||
validate_pins_files:
|
||||
|
|
@ -26,23 +26,23 @@ jobs:
|
|||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v4
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-boards-v1
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-boards-
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-validation-v1
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-validation-
|
||||
|
||||
- name: Select Python 3.9
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
architecture: 'x64'
|
||||
- name: Select Python 3.9
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.9"
|
||||
architecture: "x64"
|
||||
|
||||
- name: Validate core/boards.h
|
||||
run: |
|
||||
make validate-boards -j
|
||||
- name: Validate core/boards.h
|
||||
run: |
|
||||
make validate-boards -j
|
||||
|
|
|
|||
40
.github/workflows/ci-validate-lines.yml
vendored
Normal file
40
.github/workflows/ci-validate-lines.yml
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#
|
||||
# ci-validate-lines.yml
|
||||
# Validate that all text files are unchanged by linesformat.py
|
||||
#
|
||||
|
||||
name: CI - Validate Source Files
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
- 2.1.x
|
||||
push:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
- 2.1.x
|
||||
|
||||
jobs:
|
||||
validate_source_files:
|
||||
name: Validate Source Files
|
||||
if: github.repository == 'MarlinFirmware/Marlin'
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-npm-lines-v1
|
||||
restore-keys: |
|
||||
${{ runner.os }}-npm-lines-
|
||||
|
||||
- name: Validate text file formatting
|
||||
run: |
|
||||
npm install --save-dev prettier
|
||||
make validate-lines -j
|
||||
42
.github/workflows/ci-validate-pins.yml
vendored
42
.github/workflows/ci-validate-pins.yml
vendored
|
|
@ -8,18 +8,18 @@ name: CI - Validate Pins Files
|
|||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
- 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/*/**'
|
||||
- "Marlin/src/pins/*/**"
|
||||
push:
|
||||
branches:
|
||||
- bugfix-2.1.x
|
||||
- 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/*/**'
|
||||
- "Marlin/src/pins/*/**"
|
||||
|
||||
jobs:
|
||||
validate_pins_files:
|
||||
|
|
@ -29,23 +29,23 @@ jobs:
|
|||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v4
|
||||
- name: Check out the PR
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-pins-v1
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-pins-
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-validation-v1
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-validation-
|
||||
|
||||
- name: Select Python 3.9
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
architecture: 'x64'
|
||||
- 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
|
||||
- name: Validate all pins files
|
||||
run: |
|
||||
make validate-pins -j
|
||||
|
|
|
|||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -31,6 +31,11 @@ out-language/
|
|||
*.gen
|
||||
*.sublime-workspace
|
||||
|
||||
# npm
|
||||
node_modules/
|
||||
package.json
|
||||
package-lock.json
|
||||
|
||||
# OS
|
||||
applet/
|
||||
.DS_Store
|
||||
|
|
|
|||
10
.prettierignore
Normal file
10
.prettierignore
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Prettier Ignore file
|
||||
*.min.js
|
||||
web-ui/
|
||||
buildroot/share/PlatformIO/boards
|
||||
buildroot/share/PlatformIO/variants
|
||||
*.sublime-project
|
||||
*.sublime-syntax
|
||||
.github
|
||||
.vscode
|
||||
launch.json
|
||||
14
Makefile
14
Makefile
|
|
@ -8,6 +8,7 @@ help:
|
|||
@echo "Tasks for local development:"
|
||||
@echo "make marlin : Build Marlin for the configured board"
|
||||
@echo "make format-pins -j : Reformat all pins files (-j for parallel execution)"
|
||||
@echo "make validate-lines -j : Validate line endings, fails on trailing whitespace, etc."
|
||||
@echo "make validate-pins -j : Validate all pins files, fails if any require reformatting"
|
||||
@echo "make validate-boards -j : Validate boards.h and pins.h for standards compliance"
|
||||
@echo "make tests-single-ci : Run a single test from inside the CI"
|
||||
|
|
@ -95,7 +96,7 @@ PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')
|
|||
.PHONY: $(PINS) format-pins validate-pins
|
||||
|
||||
$(PINS): %:
|
||||
@echo "Formatting $@"
|
||||
@echo "Formatting pins $@"
|
||||
@python $(SCRIPTS_DIR)/pinsformat.py $< $@
|
||||
|
||||
format-pins: $(PINS)
|
||||
|
|
@ -104,6 +105,17 @@ 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)
|
||||
|
||||
.PHONY: format-lines validate-lines
|
||||
|
||||
format-lines:
|
||||
@echo "Formatting all sources"
|
||||
@python $(SCRIPTS_DIR)/linesformat.py buildroot
|
||||
@python $(SCRIPTS_DIR)/linesformat.py Marlin
|
||||
|
||||
validate-lines:
|
||||
@echo "Validating text formatting"
|
||||
@npx prettier --check . --editorconfig --object-wrap preserve
|
||||
|
||||
BOARDS_FILE := Marlin/src/core/boards.h
|
||||
|
||||
.PHONY: validate-boards
|
||||
|
|
|
|||
|
|
@ -3514,6 +3514,11 @@
|
|||
//#define DWIN_MARLINUI_PORTRAIT // MarlinUI (portrait orientation)
|
||||
//#define DWIN_MARLINUI_LANDSCAPE // MarlinUI (landscape orientation)
|
||||
|
||||
#if ENABLED(DWIN_CREALITY_LCD)
|
||||
//#define USE_STRING_HEADINGS // Use string headings for Creality UI instead of images
|
||||
//#define USE_STRING_TITLES // Use string titles for Creality UI instead of images
|
||||
#endif
|
||||
|
||||
//
|
||||
// Touch Screen Settings
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1150,16 +1150,18 @@
|
|||
#if ENABLED(FT_MOTION)
|
||||
//#define FTM_IS_DEFAULT_MOTION // Use FT Motion as the factory default?
|
||||
#define FTM_DEFAULT_DYNFREQ_MODE dynFreqMode_DISABLED // Default mode of dynamic frequency calculation. (DISABLED, Z_BASED, MASS_BASED)
|
||||
#define FTM_DEFAULT_SHAPER_X ftMotionShaper_NONE // Default shaper mode on X axis (NONE, ZV, ZVD, ZVDD, ZVDDD, EI, 2HEI, 3HEI, MZV)
|
||||
#define FTM_DEFAULT_SHAPER_Y ftMotionShaper_NONE // Default shaper mode on Y axis
|
||||
#define FTM_SHAPING_DEFAULT_FREQ_X 37.0f // (Hz) Default peak frequency used by input shapers
|
||||
#define FTM_SHAPING_DEFAULT_FREQ_Y 37.0f // (Hz) Default peak frequency used by input shapers
|
||||
|
||||
#define FTM_LINEAR_ADV_DEFAULT_ENA false // Default linear advance enable (true) or disable (false)
|
||||
#define FTM_LINEAR_ADV_DEFAULT_K 0.0f // Default linear advance gain. (Acceleration-based scaling factor.)
|
||||
#define FTM_SHAPING_ZETA_X 0.1f // Zeta used by input shapers for X axis
|
||||
#define FTM_SHAPING_ZETA_Y 0.1f // Zeta used by input shapers for Y axis
|
||||
|
||||
#define FTM_DEFAULT_SHAPER_X ftMotionShaper_NONE // Default shaper mode on X axis (NONE, ZV, ZVD, ZVDD, ZVDDD, EI, 2HEI, 3HEI, MZV)
|
||||
#define FTM_SHAPING_DEFAULT_FREQ_X 37.0f // (Hz) Default peak frequency used by input shapers
|
||||
#define FTM_SHAPING_ZETA_X 0.1f // Zeta used by input shapers for X axis
|
||||
#define FTM_SHAPING_V_TOL_X 0.05f // Vibration tolerance used by EI input shapers for X axis
|
||||
|
||||
#define FTM_DEFAULT_SHAPER_Y ftMotionShaper_NONE // Default shaper mode on Y axis
|
||||
#define FTM_SHAPING_DEFAULT_FREQ_Y 37.0f // (Hz) Default peak frequency used by input shapers
|
||||
#define FTM_SHAPING_ZETA_Y 0.1f // Zeta used by input shapers for Y axis
|
||||
#define FTM_SHAPING_V_TOL_Y 0.05f // Vibration tolerance used by EI input shapers for Y axis
|
||||
|
||||
//#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters
|
||||
|
|
@ -1192,7 +1194,6 @@
|
|||
#endif
|
||||
|
||||
#define FTM_STEPS_PER_UNIT_TIME (FTM_STEPPER_FS / FTM_FS) // Interpolated stepper commands per unit time
|
||||
#define FTM_CTS_COMPARE_VAL (FTM_STEPS_PER_UNIT_TIME / 2) // Comparison value used in interpolation algorithm
|
||||
#define FTM_MIN_TICKS ((STEPPER_TIMER_RATE) / (FTM_STEPPER_FS)) // Minimum stepper ticks between steps
|
||||
|
||||
#define FTM_MIN_SHAPE_FREQ 10 // Minimum shaping frequency
|
||||
|
|
@ -3517,6 +3518,7 @@
|
|||
//#define W_STALL_SENSITIVITY 8
|
||||
//#define SPI_ENDSTOPS // TMC2130, TMC2240, and TMC5160
|
||||
//#define IMPROVE_HOMING_RELIABILITY
|
||||
//#define SENSORLESS_STALLGUARD_DELAY 0 // (ms) Delay to allow drivers to settle
|
||||
#endif
|
||||
|
||||
// @section tmc/config
|
||||
|
|
@ -4004,7 +4006,7 @@
|
|||
#endif
|
||||
|
||||
/**
|
||||
* M115 - Report capabilites. Disable to save ~1150 bytes of flash.
|
||||
* M115 - Report capabilities. Disable to save ~1150 bytes of flash.
|
||||
* Some hosts (and serial TFT displays) rely on this feature.
|
||||
*/
|
||||
#define CAPABILITIES_REPORT
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
* here we define this default string as the date where the latest release
|
||||
* version was tagged.
|
||||
*/
|
||||
//#define STRING_DISTRIBUTION_DATE "2025-07-30"
|
||||
//#define STRING_DISTRIBUTION_DATE "2025-09-26"
|
||||
|
||||
/**
|
||||
* The protocol for communication to the host. Protocol indicates communication
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ uint8_t extDigitalRead(const int8_t pin) {
|
|||
*
|
||||
* DC values -1.0 to 1.0. Negative duty cycle inverts the pulse.
|
||||
*/
|
||||
uint16_t set_pwm_frequency_hz(const_float_t hz, const float dca, const float dcb, const float dcc) {
|
||||
uint16_t set_pwm_frequency_hz(const float hz, const float dca, const float dcb, const float dcc) {
|
||||
float count = 0;
|
||||
if (hz > 0 && (dca || dcb || dcc)) {
|
||||
count = float(F_CPU) / hz; // 1x prescaler, TOP for 16MHz base freq.
|
||||
|
|
|
|||
|
|
@ -523,7 +523,7 @@ static bool udd_ep_interrupt(void);
|
|||
* \internal
|
||||
* \brief Function called by UOTGHS interrupt to manage USB Device interrupts
|
||||
*
|
||||
* USB Device interrupt events are splited in three parts:
|
||||
* USB Device interrupt events are split in three parts:
|
||||
* - USB line events (SOF, reset, suspend, resume, wakeup)
|
||||
* - control endpoint events (setup reception, end of data transfer, underflow, overflow, stall)
|
||||
* - bulk/interrupt/isochronous endpoints events (end of data transfer)
|
||||
|
|
@ -1567,7 +1567,7 @@ static void udd_ctrl_out_received(void)
|
|||
udd_ctrl_payload_buf_cnt))) {
|
||||
// End of reception because it is a short packet
|
||||
// Before send ZLP, call intermediate callback
|
||||
// in case of data receiv generate a stall
|
||||
// in case of data receive generate a stall
|
||||
udd_g_ctrlreq.payload_size = udd_ctrl_payload_buf_cnt;
|
||||
if (NULL != udd_g_ctrlreq.over_under_run) {
|
||||
if (!udd_g_ctrlreq.over_under_run()) {
|
||||
|
|
@ -1808,7 +1808,7 @@ static void udd_ep_trans_done(udd_ep_id_t ep)
|
|||
}
|
||||
|
||||
if (ptr_job->buf_cnt != ptr_job->buf_size) {
|
||||
// Need to send or receiv other data
|
||||
// Need to send or receive other data
|
||||
next_trans = ptr_job->buf_size - ptr_job->buf_cnt;
|
||||
|
||||
if (UDD_ENDPOINT_MAX_TRANS < next_trans) {
|
||||
|
|
|
|||
|
|
@ -242,12 +242,13 @@ void MarlinHAL::adc_init() {
|
|||
TERN_(HAS_TEMP_ADC_5, adc1_set_attenuation(get_channel(TEMP_5_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_TEMP_ADC_6, adc2_set_attenuation(get_channel(TEMP_6_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_TEMP_ADC_7, adc3_set_attenuation(get_channel(TEMP_7_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_HEATED_BED, adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_TEMP_CHAMBER, adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_TEMP_PROBE, adc1_set_attenuation(get_channel(TEMP_PROBE_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_TEMP_COOLER, adc1_set_attenuation(get_channel(TEMP_COOLER_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_TEMP_BOARD, adc1_set_attenuation(get_channel(TEMP_BOARD_PIN), ADC_ATTEN_11db));
|
||||
TERN_(FILAMENT_WIDTH_SENSOR, adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_TEMP_ADC_BED, adc1_set_attenuation(get_channel(TEMP_BED_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_TEMP_ADC_CHAMBER, adc1_set_attenuation(get_channel(TEMP_CHAMBER_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_TEMP_ADC_PROBE, adc1_set_attenuation(get_channel(TEMP_PROBE_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_TEMP_ADC_COOLER, adc1_set_attenuation(get_channel(TEMP_COOLER_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_TEMP_ADC_BOARD, adc1_set_attenuation(get_channel(TEMP_BOARD_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_FILWIDTH_ADC, adc1_set_attenuation(get_channel(FILWIDTH_PIN), ADC_ATTEN_11db));
|
||||
TERN_(HAS_FILWIDTH2_ADC, adc1_set_attenuation(get_channel(FILWIDTH2_PIN), ADC_ATTEN_11db));
|
||||
|
||||
// Note that adc2 is shared with the WiFi module, which has higher priority, so the conversion may fail.
|
||||
// That's why we're not setting it up here.
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
This HAL is eventually intended to act as the generic HAL for all GD32 chips using the MFL library.
|
||||
|
||||
Currently it supports:
|
||||
* GD32F303RET6
|
||||
|
||||
- GD32F303RET6
|
||||
|
||||
Targeting the official [MFL Arduino Core](https://github.com/bnmguy/ArduinoCore_MFL).
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public:
|
|||
// Interrupt handler
|
||||
void handle_interrupts();
|
||||
|
||||
// Varaible stored parameters
|
||||
// Variable stored parameters
|
||||
auto get_scr(uint16_t rca, uint32_t* scr) -> SDIO_Error_Type;
|
||||
auto store_cid() -> SDIO_Error_Type;
|
||||
auto store_csd() -> SDIO_Error_Type;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ extern Timer0 step_timer;
|
|||
* See https://github.com/MarlinFirmware/Marlin/pull/27099 for more information.
|
||||
*
|
||||
* NOTE: If the 'constexpr' requirement is ever lifted, TIMER0_BASE_FREQUENCY could
|
||||
* be used instead. Tho this would probably not make any noticable difference.
|
||||
* be used instead. Tho this would probably not make any noticeable difference.
|
||||
*/
|
||||
#define HAL_TIMER_RATE F_PCLK1
|
||||
|
||||
|
|
|
|||
|
|
@ -71,13 +71,13 @@ static uint8_t SPI_speed = 0;
|
|||
|
||||
static uint8_t swSpiTransfer(uint8_t b, const uint8_t spi_speed, const pin_t sck_pin, const pin_t miso_pin, const pin_t mosi_pin) {
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
WRITE_PIN(mosi_pin, !!(b & 0x80));
|
||||
WRITE_PIN(sck_pin, TERN(U8G_SPI_USE_MODE_3, LOW, HIGH));
|
||||
DELAY_CYCLES(SPI_SPEED);
|
||||
WRITE_PIN(sck_pin, HIGH);
|
||||
WRITE_PIN(mosi_pin, !!(b & 0x80));
|
||||
DELAY_CYCLES(SPI_SPEED);
|
||||
b <<= 1;
|
||||
if (miso_pin >= 0 && READ_PIN(miso_pin)) b |= 1;
|
||||
WRITE_PIN(sck_pin, LOW);
|
||||
WRITE_PIN(sck_pin, TERN(U8G_SPI_USE_MODE_3, HIGH, LOW));
|
||||
DELAY_CYCLES(SPI_SPEED);
|
||||
}
|
||||
return b;
|
||||
|
|
@ -85,7 +85,7 @@ static uint8_t swSpiTransfer(uint8_t b, const uint8_t spi_speed, const pin_t sck
|
|||
|
||||
static uint8_t swSpiInit(const uint8_t spiRate, const pin_t sck_pin, const pin_t mosi_pin) {
|
||||
WRITE_PIN(mosi_pin, HIGH);
|
||||
WRITE_PIN(sck_pin, LOW);
|
||||
WRITE_PIN(sck_pin, TERN(U8G_SPI_USE_MODE_3, HIGH, LOW));
|
||||
return spiRate;
|
||||
}
|
||||
|
||||
|
|
@ -93,11 +93,11 @@ static void u8g_com_st7920_write_byte_sw_spi(uint8_t rs, uint8_t val) {
|
|||
static uint8_t rs_last_state = 255;
|
||||
if (rs != rs_last_state) {
|
||||
// Transfer Data (FA) or Command (F8)
|
||||
swSpiTransfer(rs ? 0x0FA : 0x0F8, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
swSpiTransfer(rs ? 0xFA : 0xF8, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
rs_last_state = rs;
|
||||
DELAY_US(40); // Give the controller time to process the data: 20 is bad, 30 is OK, 40 is safe
|
||||
}
|
||||
swSpiTransfer(val & 0x0F0, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
swSpiTransfer(val & 0xF0, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
swSpiTransfer(val << 4, SPI_speed, SCK_pin_ST7920_HAL, -1, MOSI_pin_ST7920_HAL_HAL);
|
||||
}
|
||||
|
||||
|
|
@ -169,5 +169,32 @@ uint8_t u8g_com_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
|
|||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(LIGHTWEIGHT_UI)
|
||||
|
||||
#define ST7920_CS() { WRITE(LCD_PINS_RS, HIGH); }
|
||||
#define ST7920_NCS() { WRITE(LCD_PINS_RS, LOW); }
|
||||
#define ST7920_SET_CMD() { ST7920_SWSPI_SND_8BIT(0xF8); }
|
||||
#define ST7920_SET_DAT() { ST7920_SWSPI_SND_8BIT(0xFA); }
|
||||
#define ST7920_WRITE_BYTE(a) { ST7920_SWSPI_SND_8BIT((uint8_t)((a)&0xF0u)); ST7920_SWSPI_SND_8BIT((uint8_t)((a)<<4U)); }
|
||||
|
||||
#define ST7920_DAT(V) !!((V) & 0x80)
|
||||
|
||||
#define ST7920_SND_BIT(...) do{ \
|
||||
WRITE(LCD_PINS_D4, LOW); \
|
||||
WRITE(LCD_PINS_EN, ST7920_DAT(val)); \
|
||||
WRITE(LCD_PINS_D4, HIGH); \
|
||||
val <<= 1; }while(0);
|
||||
|
||||
void ST7920_SWSPI_SND_8BIT(uint8_t val) {
|
||||
REPEAT(8, ST7920_SND_BIT);
|
||||
}
|
||||
|
||||
void ST7920_cs() { ST7920_CS(); }
|
||||
void ST7920_ncs() { ST7920_NCS(); }
|
||||
void ST7920_set_cmd() { ST7920_SET_CMD(); }
|
||||
void ST7920_set_dat() { ST7920_SET_DAT(); }
|
||||
void ST7920_write_byte(const uint8_t val) { ST7920_WRITE_BYTE(val); }
|
||||
#endif // LIGHTWEIGHT_UI
|
||||
|
||||
#endif // IS_U8GLIB_ST7920
|
||||
#endif // __PLAT_NATIVE_SIM__
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ uint8_t swSpiTransfer_mode_3(uint8_t b, const uint8_t spi_speed, const pin_t sck
|
|||
static uint8_t SPI_speed = 0;
|
||||
|
||||
static uint8_t swSpiInit(const uint8_t spi_speed, const uint8_t clk_pin, const uint8_t mosi_pin) {
|
||||
return spi_speed;
|
||||
return spi_speed;
|
||||
}
|
||||
|
||||
static void u8g_sw_spi_shift_out(uint8_t dataPin, uint8_t clockPin, uint8_t val) {
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ void MarlinHAL::reboot() { watchdog_reboot(0, 0, 1); }
|
|||
|
||||
void MarlinHAL::watchdog_init() {
|
||||
#if DISABLED(DISABLE_WATCHDOG_INIT)
|
||||
static_assert(WDT_TIMEOUT_US > 1000, "WDT Timout is too small, aborting");
|
||||
static_assert(WDT_TIMEOUT_US > 1000, "WDT Timeout is too small, aborting");
|
||||
watchdog_enable(WDT_TIMEOUT_US/1000, true);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
|
|||
tc->COUNT32.CTRLA.reg |= TC_CTRLA_WAVEGEN_MFRQ;
|
||||
//set prescaler
|
||||
//the clock normally counts at the GCLK_TC frequency, but we can set it to divide that frequency to slow it down
|
||||
//you can use different prescaler divisons here like TC_CTRLA_PRESCALER_DIV1 to get a different range
|
||||
//you can use different prescaler divisions here like TC_CTRLA_PRESCALER_DIV1 to get a different range
|
||||
tc->COUNT32.CTRLA.reg |= TC_CTRLA_PRESCALER_DIV1 | TC_CTRLA_ENABLE; //it will divide GCLK_TC frequency by 1024
|
||||
//set the compare-capture register.
|
||||
//The counter will count up to this value (it's a 16bit counter so we use uint16_t)
|
||||
|
|
|
|||
|
|
@ -61,7 +61,8 @@
|
|||
#define GET_COOLER_ADC() TERN(HAS_TEMP_ADC_COOLER, PIN_TO_ADC(TEMP_COOLER_PIN), -1)
|
||||
#define GET_BOARD_ADC() TERN(HAS_TEMP_ADC_BOARD, PIN_TO_ADC(TEMP_BOARD_PIN), -1)
|
||||
#define GET_SOC_ADC() TERN(HAS_TEMP_ADC_BOARD, PIN_TO_ADC(TEMP_BOARD_PIN), -1)
|
||||
#define GET_FILAMENT_WIDTH_ADC() TERN(FILAMENT_WIDTH_SENSOR, PIN_TO_ADC(FILWIDTH_PIN), -1)
|
||||
#define GET_FILAMENT_WIDTH_ADC() TERN(HAS_FILWIDTH_ADC, PIN_TO_ADC(FILWIDTH_PIN), -1)
|
||||
#define GET_FILAMENT2_WIDTH_ADC() TERN(HAS_FILWIDTH2_ADC, PIN_TO_ADC(FILWIDTH2_PIN), -1)
|
||||
#define GET_BUTTONS_ADC() TERN(HAS_ADC_BUTTONS, PIN_TO_ADC(ADC_KEYPAD_PIN), -1)
|
||||
#define GET_JOY_ADC_X() TERN(HAS_JOY_ADC_X, PIN_TO_ADC(JOY_X_PIN), -1)
|
||||
#define GET_JOY_ADC_Y() TERN(HAS_JOY_ADC_Y, PIN_TO_ADC(JOY_Y_PIN), -1)
|
||||
|
|
@ -77,7 +78,7 @@
|
|||
|| GET_PROBE_ADC() == n \
|
||||
|| GET_COOLER_ADC() == n \
|
||||
|| GET_BOARD_ADC() == n || GET_SOC_ADC() == n \
|
||||
|| GET_FILAMENT_WIDTH_ADC() == n \
|
||||
|| GET_FILAMENT_WIDTH_ADC() == n || GET_FILAMENT2_WIDTH_ADC() == n \
|
||||
|| GET_BUTTONS_ADC() == n \
|
||||
|| GET_JOY_ADC_X() == n || GET_JOY_ADC_Y() == n || GET_JOY_ADC_Z() == n \
|
||||
|| GET_POWERMON_ADC_CURRENT() == n || GET_POWERMON_ADC_VOLTS() == n \
|
||||
|
|
@ -146,6 +147,9 @@ enum ADCIndex {
|
|||
#if GET_FILAMENT_WIDTH_ADC() == 0
|
||||
FILWIDTH,
|
||||
#endif
|
||||
#if GET_FILAMENT2_WIDTH_ADC() == 0
|
||||
FILWIDTH2,
|
||||
#endif
|
||||
#if GET_BUTTONS_ADC() == 0
|
||||
ADC_KEY,
|
||||
#endif
|
||||
|
|
@ -212,6 +216,9 @@ enum ADCIndex {
|
|||
#if GET_FILAMENT_WIDTH_ADC() == 1
|
||||
FILWIDTH,
|
||||
#endif
|
||||
#if GET_FILAMENT2_WIDTH_ADC() == 1
|
||||
FILWIDTH2,
|
||||
#endif
|
||||
#if GET_BUTTONS_ADC() == 1
|
||||
ADC_KEY,
|
||||
#endif
|
||||
|
|
@ -334,6 +341,9 @@ enum ADCIndex {
|
|||
#if GET_FILAMENT_WIDTH_ADC() == 0
|
||||
FILWIDTH_PIN,
|
||||
#endif
|
||||
#if GET_FILAMENT2_WIDTH_ADC() == 0
|
||||
FILWIDTH2_PIN,
|
||||
#endif
|
||||
#if GET_BUTTONS_ADC() == 0
|
||||
ADC_KEYPAD_PIN,
|
||||
#endif
|
||||
|
|
@ -400,6 +410,9 @@ enum ADCIndex {
|
|||
#if GET_FILAMENT_WIDTH_ADC() == 1
|
||||
FILWIDTH_PIN,
|
||||
#endif
|
||||
#if GET_FILAMENT2_WIDTH_ADC() == 1
|
||||
FILWIDTH2_PIN,
|
||||
#endif
|
||||
#if GET_BUTTONS_ADC() == 1
|
||||
ADC_KEYPAD_PIN,
|
||||
#endif
|
||||
|
|
@ -471,6 +484,9 @@ enum ADCIndex {
|
|||
#if GET_FILAMENT_WIDTH_ADC() == 0
|
||||
{ PIN_TO_INPUTCTRL(FILWIDTH_PIN) },
|
||||
#endif
|
||||
#if GET_FILAMENT2_WIDTH_ADC() == 0
|
||||
{ PIN_TO_INPUTCTRL(FILWIDTH2_PIN) },
|
||||
#endif
|
||||
#if GET_BUTTONS_ADC() == 0
|
||||
{ PIN_TO_INPUTCTRL(ADC_KEYPAD_PIN) },
|
||||
#endif
|
||||
|
|
@ -543,6 +559,9 @@ enum ADCIndex {
|
|||
#if GET_FILAMENT_WIDTH_ADC() == 1
|
||||
{ PIN_TO_INPUTCTRL(FILWIDTH_PIN) },
|
||||
#endif
|
||||
#if GET_FILAMENT2_WIDTH_ADC() == 1
|
||||
{ PIN_TO_INPUTCTRL(FILWIDTH2_PIN) },
|
||||
#endif
|
||||
#if GET_BUTTONS_ADC() == 1
|
||||
{ PIN_TO_INPUTCTRL(ADC_KEYPAD_PIN) },
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ HAL_HardwareSerial::HAL_HardwareSerial(void *peripheral) {
|
|||
}
|
||||
#endif
|
||||
|
||||
else { // else get the pins of the first peripheral occurence in PinMap
|
||||
else { // else get the pins of the first peripheral occurrence in PinMap
|
||||
_serial.pin_rx = pinmap_pin(peripheral, PinMap_UART_RX);
|
||||
_serial.pin_tx = pinmap_pin(peripheral, PinMap_UART_TX);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,10 @@
|
|||
This HAL is intended to act as the generic STM32 HAL for all STM32 chips (The whole F, H and L family).
|
||||
|
||||
Currently it supports:
|
||||
* STM32F0xx
|
||||
* STM32F1xx
|
||||
* STM32F4xx
|
||||
* STM32F7xx
|
||||
|
||||
- STM32F0xx
|
||||
- STM32F1xx
|
||||
- STM32F4xx
|
||||
- STM32F7xx
|
||||
|
||||
Targeting the official [Arduino STM32 Core](https://github.com/stm32duino/Arduino_Core_STM32).
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ const XrefInfo pin_xref[] PROGMEM = {
|
|||
|
||||
#ifndef M43_NEVER_TOUCH
|
||||
#define _M43_NEVER_TOUCH(x) WITHIN(x, 9, 12) // SERIAL/USB pins: PA9(TX) PA10(RX) PA11(USB_DM) PA12(USB_DP)
|
||||
#ifdef KILL_PIN
|
||||
#if PIN_EXISTS(KILL)
|
||||
#define M43_NEVER_TOUCH(x) m43_never_touch(x)
|
||||
|
||||
bool m43_never_touch(const pin_t index) {
|
||||
|
|
|
|||
|
|
@ -131,30 +131,31 @@ uint16_t MarlinHAL::adc_result;
|
|||
|
||||
#include <STM32ADC.h>
|
||||
|
||||
// Init the AD in continuous capture mode
|
||||
// Init the ADC in continuous capture mode
|
||||
void MarlinHAL::adc_init() {
|
||||
static const uint8_t adc_pins[] = {
|
||||
OPTITEM(HAS_TEMP_ADC_0, TEMP_0_PIN)
|
||||
OPTITEM(HAS_TEMP_ADC_1, TEMP_1_PIN)
|
||||
OPTITEM(HAS_TEMP_ADC_2, TEMP_2_PIN)
|
||||
OPTITEM(HAS_TEMP_ADC_3, TEMP_3_PIN)
|
||||
OPTITEM(HAS_TEMP_ADC_4, TEMP_4_PIN)
|
||||
OPTITEM(HAS_TEMP_ADC_5, TEMP_5_PIN)
|
||||
OPTITEM(HAS_TEMP_ADC_6, TEMP_6_PIN)
|
||||
OPTITEM(HAS_TEMP_ADC_7, TEMP_7_PIN)
|
||||
OPTITEM(HAS_HEATED_BED, TEMP_BED_PIN)
|
||||
OPTITEM(HAS_TEMP_CHAMBER, TEMP_CHAMBER_PIN)
|
||||
OPTITEM(HAS_TEMP_ADC_PROBE, TEMP_PROBE_PIN)
|
||||
OPTITEM(HAS_TEMP_COOLER, TEMP_COOLER_PIN)
|
||||
OPTITEM(HAS_TEMP_BOARD, TEMP_BOARD_PIN)
|
||||
OPTITEM(HAS_TEMP_SOC, TEMP_SOC_PIN)
|
||||
OPTITEM(FILAMENT_WIDTH_SENSOR, FILWIDTH_PIN)
|
||||
OPTITEM(HAS_ADC_BUTTONS, ADC_KEYPAD_PIN)
|
||||
OPTITEM(HAS_JOY_ADC_X, JOY_X_PIN)
|
||||
OPTITEM(HAS_JOY_ADC_Y, JOY_Y_PIN)
|
||||
OPTITEM(HAS_JOY_ADC_Z, JOY_Z_PIN)
|
||||
OPTITEM(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN)
|
||||
OPTITEM(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN)
|
||||
OPTITEM(HAS_TEMP_ADC_0, TEMP_0_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_1, TEMP_1_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_2, TEMP_2_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_3, TEMP_3_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_4, TEMP_4_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_5, TEMP_5_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_6, TEMP_6_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_7, TEMP_7_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_BED, TEMP_BED_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_CHAMBER, TEMP_CHAMBER_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_PROBE, TEMP_PROBE_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_COOLER, TEMP_COOLER_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_BOARD, TEMP_BOARD_PIN )
|
||||
OPTITEM(HAS_TEMP_ADC_SOC, TEMP_SOC_PIN )
|
||||
OPTITEM(HAS_FILWIDTH_ADC, FILWIDTH_PIN )
|
||||
OPTITEM(HAS_FILWIDTH2_ADC, FILWIDTH2_PIN )
|
||||
OPTITEM(HAS_ADC_BUTTONS, ADC_KEYPAD_PIN )
|
||||
OPTITEM(HAS_JOY_ADC_X, JOY_X_PIN )
|
||||
OPTITEM(HAS_JOY_ADC_Y, JOY_Y_PIN )
|
||||
OPTITEM(HAS_JOY_ADC_Z, JOY_Z_PIN )
|
||||
OPTITEM(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN)
|
||||
OPTITEM(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN)
|
||||
};
|
||||
static STM32ADC adc(ADC1);
|
||||
// Configure the ADC
|
||||
|
|
@ -175,27 +176,28 @@ void MarlinHAL::adc_start(const pin_t pin) {
|
|||
ADCIndex pin_index;
|
||||
switch (pin) {
|
||||
default: return;
|
||||
_TCASE(HAS_TEMP_ADC_0, TEMP_0_PIN, TEMP_0)
|
||||
_TCASE(HAS_TEMP_ADC_1, TEMP_1_PIN, TEMP_1)
|
||||
_TCASE(HAS_TEMP_ADC_2, TEMP_2_PIN, TEMP_2)
|
||||
_TCASE(HAS_TEMP_ADC_3, TEMP_3_PIN, TEMP_3)
|
||||
_TCASE(HAS_TEMP_ADC_4, TEMP_4_PIN, TEMP_4)
|
||||
_TCASE(HAS_TEMP_ADC_5, TEMP_5_PIN, TEMP_5)
|
||||
_TCASE(HAS_TEMP_ADC_6, TEMP_6_PIN, TEMP_6)
|
||||
_TCASE(HAS_TEMP_ADC_7, TEMP_7_PIN, TEMP_7)
|
||||
_TCASE(HAS_HEATED_BED, TEMP_BED_PIN, TEMP_BED)
|
||||
_TCASE(HAS_TEMP_CHAMBER, TEMP_CHAMBER_PIN, TEMP_CHAMBER)
|
||||
_TCASE(HAS_TEMP_ADC_PROBE, TEMP_PROBE_PIN, TEMP_PROBE)
|
||||
_TCASE(HAS_TEMP_COOLER, TEMP_COOLER_PIN, TEMP_COOLER)
|
||||
_TCASE(HAS_TEMP_BOARD, TEMP_BOARD_PIN, TEMP_BOARD)
|
||||
_TCASE(HAS_TEMP_SOC, TEMP_SOC_PIN, TEMP_SOC)
|
||||
_TCASE(HAS_JOY_ADC_X, JOY_X_PIN, JOY_X)
|
||||
_TCASE(HAS_JOY_ADC_Y, JOY_Y_PIN, JOY_Y)
|
||||
_TCASE(HAS_JOY_ADC_Z, JOY_Z_PIN, JOY_Z)
|
||||
_TCASE(FILAMENT_WIDTH_SENSOR, FILWIDTH_PIN, FILWIDTH)
|
||||
_TCASE(HAS_ADC_BUTTONS, ADC_KEYPAD_PIN, ADC_KEY)
|
||||
_TCASE(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN, POWERMON_CURRENT)
|
||||
_TCASE(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN, POWERMON_VOLTAGE)
|
||||
_TCASE(HAS_TEMP_ADC_0, TEMP_0_PIN, TEMP_0 )
|
||||
_TCASE(HAS_TEMP_ADC_1, TEMP_1_PIN, TEMP_1 )
|
||||
_TCASE(HAS_TEMP_ADC_2, TEMP_2_PIN, TEMP_2 )
|
||||
_TCASE(HAS_TEMP_ADC_3, TEMP_3_PIN, TEMP_3 )
|
||||
_TCASE(HAS_TEMP_ADC_4, TEMP_4_PIN, TEMP_4 )
|
||||
_TCASE(HAS_TEMP_ADC_5, TEMP_5_PIN, TEMP_5 )
|
||||
_TCASE(HAS_TEMP_ADC_6, TEMP_6_PIN, TEMP_6 )
|
||||
_TCASE(HAS_TEMP_ADC_7, TEMP_7_PIN, TEMP_7 )
|
||||
_TCASE(HAS_TEMP_ADC_BED, TEMP_BED_PIN, TEMP_BED )
|
||||
_TCASE(HAS_TEMP_ADC_CHAMBER, TEMP_CHAMBER_PIN, TEMP_CHAMBER )
|
||||
_TCASE(HAS_TEMP_ADC_PROBE, TEMP_PROBE_PIN, TEMP_PROBE )
|
||||
_TCASE(HAS_TEMP_ADC_COOLER, TEMP_COOLER_PIN, TEMP_COOLER )
|
||||
_TCASE(HAS_TEMP_ADC_BOARD, TEMP_BOARD_PIN, TEMP_BOARD )
|
||||
_TCASE(HAS_TEMP_ADC_SOC, TEMP_SOC_PIN, TEMP_SOC )
|
||||
_TCASE(HAS_FILWIDTH_ADC, FILWIDTH_PIN, FILWIDTH )
|
||||
_TCASE(HAS_FILWIDTH2_ADC, FILWIDTH2_PIN, FILWIDTH2 )
|
||||
_TCASE(HAS_ADC_BUTTONS, ADC_KEYPAD_PIN, ADC_KEY )
|
||||
_TCASE(HAS_JOY_ADC_X, JOY_X_PIN, JOY_X )
|
||||
_TCASE(HAS_JOY_ADC_Y, JOY_Y_PIN, JOY_Y )
|
||||
_TCASE(HAS_JOY_ADC_Z, JOY_Z_PIN, JOY_Z )
|
||||
_TCASE(POWER_MONITOR_CURRENT, POWER_MONITOR_CURRENT_PIN, POWERMON_CURRENT)
|
||||
_TCASE(POWER_MONITOR_VOLTAGE, POWER_MONITOR_VOLTAGE_PIN, POWERMON_VOLTAGE)
|
||||
}
|
||||
adc_result = (adc_results[(int)pin_index] & 0xFFF) >> (12 - HAL_ADC_RESOLUTION); // shift out unused bits
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ This HAL is for STM32F103 boards used with [Arduino STM32](https://github.com/ro
|
|||
Currently has been tested in Malyan M200 (103CBT6), SKRmini (103RCT6), Chitu 3d (103ZET6), and various 103VET6 boards.
|
||||
|
||||
### Main developers:
|
||||
|
||||
- Victorpv
|
||||
- xC000005
|
||||
- thisiskeithb
|
||||
|
|
|
|||
|
|
@ -33,12 +33,14 @@
|
|||
#include <stdint.h>
|
||||
#include <wirish.h>
|
||||
|
||||
#include "../../core/macros.h" // for PIN_EXISTS
|
||||
|
||||
// Number of SPI ports
|
||||
#ifdef BOARD_SPI3_SCK_PIN
|
||||
#if PIN_EXISTS(BOARD_SPI3_SCK)
|
||||
#define BOARD_NR_SPI 3
|
||||
#elif defined(BOARD_SPI2_SCK_PIN)
|
||||
#elif PIN_EXISTS(BOARD_SPI2_SCK)
|
||||
#define BOARD_NR_SPI 2
|
||||
#elif defined(BOARD_SPI1_SCK_PIN)
|
||||
#elif PIN_EXISTS(BOARD_SPI1_SCK)
|
||||
#define BOARD_NR_SPI 1
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ enum ADCIndex : uint8_t {
|
|||
OPTITEM(HAS_TEMP_ADC_COOLER, TEMP_COOLER )
|
||||
OPTITEM(HAS_TEMP_ADC_BOARD, TEMP_BOARD )
|
||||
OPTITEM(HAS_TEMP_ADC_SOC, TEMP_SOC )
|
||||
OPTITEM(FILAMENT_WIDTH_SENSOR, FILWIDTH )
|
||||
OPTITEM(HAS_FILWIDTH_ADC, FILWIDTH )
|
||||
OPTITEM(HAS_FILWIDTH2_ADC, FILWIDTH2 )
|
||||
OPTITEM(HAS_ADC_BUTTONS, ADC_KEY )
|
||||
OPTITEM(HAS_JOY_ADC_X, JOY_X )
|
||||
OPTITEM(HAS_JOY_ADC_Y, JOY_Y )
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "unwinder.h"
|
||||
|
||||
/** The maximum number of instructions to interpet in a function.
|
||||
/** The maximum number of instructions to interpret in a function.
|
||||
* Unwinding will be unconditionally stopped and UNWIND_EXHAUSTED returned
|
||||
* if more than this number of instructions are interpreted in a single
|
||||
* function without unwinding a stack frame. This prevents infinite loops
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
|
|||
// Check if the kill button was pressed and wait to ensure the signal is not noise
|
||||
// typically caused by poor insulation and grounding on LCD cables.
|
||||
// Lower numbers here will increase response time and therefore safety rating.
|
||||
// It is recommended to set this as low as possibe without false triggers.
|
||||
// It is recommended to set this as low as possible without false triggers.
|
||||
// -------------------------------------------------------------------------------
|
||||
#ifndef KILL_DELAY
|
||||
#define KILL_DELAY 250
|
||||
|
|
|
|||
|
|
@ -105,33 +105,34 @@
|
|||
#define BOARD_TRIGORILLA_14_11 1138 // ... Rev 1.1 (new servo pin order)
|
||||
#define BOARD_RAMPS_ENDER_4 1139 // Creality: Ender-4, CR-8
|
||||
#define BOARD_RAMPS_CREALITY 1140 // Creality: CR10S, CR20, CR-X
|
||||
#define BOARD_DAGOMA_F5 1141 // Dagoma F5
|
||||
#define BOARD_DAGOMA_D6 1142 // Dagoma D6 (as found in the Dagoma DiscoUltimate V2 TMC)
|
||||
#define BOARD_FYSETC_F6_13 1143 // FYSETC F6 1.3
|
||||
#define BOARD_FYSETC_F6_14 1144 // FYSETC F6 1.4
|
||||
#define BOARD_DUPLICATOR_I3_PLUS 1145 // Wanhao Duplicator i3 Plus
|
||||
#define BOARD_VORON 1146 // VORON Design
|
||||
#define BOARD_TRONXY_V3_1_0 1147 // Tronxy TRONXY-V3-1.0
|
||||
#define BOARD_Z_BOLT_X_SERIES 1148 // Z-Bolt X Series
|
||||
#define BOARD_TT_OSCAR 1149 // TT OSCAR
|
||||
#define BOARD_TANGO 1150 // BIQU Tango V1
|
||||
#define BOARD_MKS_GEN_L_V2 1151 // MKS GEN L V2
|
||||
#define BOARD_MKS_GEN_L_V21 1152 // MKS GEN L V2.1
|
||||
#define BOARD_COPYMASTER_3D 1153 // Copymaster 3D
|
||||
#define BOARD_ORTUR_4 1154 // Ortur 4
|
||||
#define BOARD_TENLOG_D3_HERO 1155 // Tenlog D3 Hero IDEX printer
|
||||
#define BOARD_TENLOG_MB1_V23 1156 // Tenlog D3, D5, D6 IDEX Printer
|
||||
#define BOARD_RAMPS_S_12_EEFB 1157 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
#define BOARD_RAMPS_S_12_EEEB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
|
||||
#define BOARD_RAMPS_S_12_EFFB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
|
||||
#define BOARD_LONGER3D_LK1_PRO 1160 // Longer LK1 PRO / Alfawise U20 Pro (PRO version)
|
||||
#define BOARD_LONGER3D_LKx_PRO 1161 // Longer LKx PRO / Alfawise Uxx Pro (PRO version)
|
||||
#define BOARD_PXMALION_CORE_I3 1162 // Pxmalion Core I3
|
||||
#define BOARD_PANOWIN_CUTLASS 1163 // Panowin Cutlass (as found in the Panowin F1)
|
||||
#define BOARD_KODAMA_BARDO 1164 // Kodama Bardo V1.x (as found in the Kodama Trinus)
|
||||
#define BOARD_XTLW_MFF_V1 1165 // XTLW MFF V1.0
|
||||
#define BOARD_XTLW_MFF_V2 1166 // XTLW MFF V2.0
|
||||
#define BOARD_RUMBA_E3D 1167 // E3D Rumba BigBox
|
||||
#define BOARD_CREALITY_V252 1141 // Creality CR-10 V2, CR-10 V3
|
||||
#define BOARD_DAGOMA_F5 1142 // Dagoma F5
|
||||
#define BOARD_DAGOMA_D6 1143 // Dagoma D6 (as found in the Dagoma DiscoUltimate V2 TMC)
|
||||
#define BOARD_FYSETC_F6_13 1144 // FYSETC F6 1.3
|
||||
#define BOARD_FYSETC_F6_14 1145 // FYSETC F6 1.4
|
||||
#define BOARD_DUPLICATOR_I3_PLUS 1146 // Wanhao Duplicator i3 Plus
|
||||
#define BOARD_VORON 1147 // VORON Design
|
||||
#define BOARD_TRONXY_V3_1_0 1148 // Tronxy TRONXY-V3-1.0
|
||||
#define BOARD_Z_BOLT_X_SERIES 1149 // Z-Bolt X Series
|
||||
#define BOARD_TT_OSCAR 1150 // TT OSCAR
|
||||
#define BOARD_TANGO 1151 // BIQU Tango V1
|
||||
#define BOARD_MKS_GEN_L_V2 1152 // MKS GEN L V2
|
||||
#define BOARD_MKS_GEN_L_V21 1153 // MKS GEN L V2.1
|
||||
#define BOARD_COPYMASTER_3D 1154 // Copymaster 3D
|
||||
#define BOARD_ORTUR_4 1155 // Ortur 4
|
||||
#define BOARD_TENLOG_D3_HERO 1156 // Tenlog D3 Hero IDEX printer
|
||||
#define BOARD_TENLOG_MB1_V23 1157 // Tenlog D3, D5, D6 IDEX Printer
|
||||
#define BOARD_RAMPS_S_12_EEFB 1158 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
|
||||
#define BOARD_RAMPS_S_12_EEEB 1159 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
|
||||
#define BOARD_RAMPS_S_12_EFFB 1160 // Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
|
||||
#define BOARD_LONGER3D_LK1_PRO 1161 // Longer LK1 PRO / Alfawise U20 Pro (PRO version)
|
||||
#define BOARD_LONGER3D_LKx_PRO 1162 // Longer LKx PRO / Alfawise Uxx Pro (PRO version)
|
||||
#define BOARD_PXMALION_CORE_I3 1163 // Pxmalion Core I3
|
||||
#define BOARD_PANOWIN_CUTLASS 1164 // Panowin Cutlass (as found in the Panowin F1)
|
||||
#define BOARD_KODAMA_BARDO 1165 // Kodama Bardo V1.x (as found in the Kodama Trinus)
|
||||
#define BOARD_XTLW_MFF_V1 1166 // XTLW MFF V1.0
|
||||
#define BOARD_XTLW_MFF_V2 1167 // XTLW MFF V2.0
|
||||
#define BOARD_RUMBA_E3D 1168 // E3D Rumba BigBox
|
||||
|
||||
//
|
||||
// RAMBo and derivatives
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ void SERIAL_WARN_START() { SERIAL_ECHO(F("Warning:")); }
|
|||
|
||||
void SERIAL_ECHO_SP(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); }
|
||||
|
||||
void serial_offset(const_float_t v, const uint8_t sp/*=0*/) {
|
||||
void serial_offset(const float v, const uint8_t sp/*=0*/) {
|
||||
if (v == 0 && sp == 1)
|
||||
SERIAL_CHAR(' ');
|
||||
else if (v > 0 || (v == 0 && sp == 2))
|
||||
|
|
@ -121,21 +121,23 @@ void print_bin(uint16_t val) {
|
|||
}
|
||||
}
|
||||
|
||||
void _print_xyz(NUM_AXIS_ARGS_(const_float_t) FSTR_P const prefix) {
|
||||
void _print_xyz(NUM_AXIS_ARGS_(const float) FSTR_P const prefix) {
|
||||
if (prefix) SERIAL_ECHO(prefix);
|
||||
#if NUM_AXES
|
||||
SERIAL_ECHOPGM_P(
|
||||
LIST_N(DOUBLE(NUM_AXES), SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z, SP_I_STR, i, SP_J_STR, j, SP_K_STR, k, SP_U_STR, u, SP_V_STR, v, SP_W_STR, w)
|
||||
);
|
||||
SERIAL_ECHOPGM_P(NUM_AXIS_PAIRED_LIST(
|
||||
SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z,
|
||||
SP_I_STR, i, SP_J_STR, j, SP_K_STR, k,
|
||||
SP_U_STR, u, SP_V_STR, v, SP_W_STR, w
|
||||
));
|
||||
#endif
|
||||
}
|
||||
|
||||
void print_xyz(NUM_AXIS_ARGS_(const_float_t) FSTR_P const prefix/*=nullptr*/, FSTR_P const suffix/*=nullptr*/) {
|
||||
void print_xyz(NUM_AXIS_ARGS_(const float) FSTR_P const prefix/*=nullptr*/, FSTR_P const suffix/*=nullptr*/) {
|
||||
_print_xyz(NUM_AXIS_LIST_(x, y, z, i, j, k, u, v, w) prefix);
|
||||
if (suffix) SERIAL_ECHO(suffix); else SERIAL_EOL();
|
||||
}
|
||||
|
||||
void print_xyze(LOGICAL_AXIS_ARGS_(const_float_t) FSTR_P const prefix/*=nullptr*/, FSTR_P const suffix/*=nullptr*/) {
|
||||
void print_xyze(LOGICAL_AXIS_ARGS_(const float) FSTR_P const prefix/*=nullptr*/, FSTR_P const suffix/*=nullptr*/) {
|
||||
_print_xyz(NUM_AXIS_LIST_(x, y, z, i, j, k, u, v, w) prefix);
|
||||
#if HAS_EXTRUDERS
|
||||
SERIAL_ECHOPGM_P(SP_E_STR, e);
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ void SERIAL_ECHOLN(T arg1, Args ... args) { SERIAL_ECHO(arg1); SERIAL_ECHO(args
|
|||
// all the odd loose string elements as PROGMEM strings.
|
||||
//
|
||||
|
||||
// Print up to 20 pairs of values. Odd elements must be literal strings.
|
||||
// Print pairs of values. Odd elements must be literal strings.
|
||||
#define __SEP_N(N,V...) _SEP_##N(V)
|
||||
#define _SEP_N(N,V...) __SEP_N(N,V)
|
||||
#define _SEP_N_REF() _SEP_N
|
||||
|
|
@ -194,7 +194,7 @@ void SERIAL_ECHOLN(T arg1, Args ... args) { SERIAL_ECHO(arg1); SERIAL_ECHO(args
|
|||
#define _SEP_3(s,v,V...) _SEP_2(s,v); DEFER2(_SEP_N_REF)()(TWO_ARGS(V),V);
|
||||
#define SERIAL_ECHOPGM(V...) do{ EVAL(_SEP_N(TWO_ARGS(V),V)); }while(0)
|
||||
|
||||
// Print up to 20 pairs of values followed by newline. Odd elements must be literal strings.
|
||||
// Print pairs of values followed by newline. Odd elements must be literal strings.
|
||||
#define __SELP_N(N,V...) _SELP_##N(V)
|
||||
#define _SELP_N(N,V...) __SELP_N(N,V)
|
||||
#define _SELP_N_REF() _SELP_N
|
||||
|
|
@ -203,7 +203,7 @@ void SERIAL_ECHOLN(T arg1, Args ... args) { SERIAL_ECHO(arg1); SERIAL_ECHO(args
|
|||
#define _SELP_3(s,v,V...) _SEP_2(s,v); DEFER2(_SELP_N_REF)()(TWO_ARGS(V),V);
|
||||
#define SERIAL_ECHOLNPGM(V...) do{ EVAL(_SELP_N(TWO_ARGS(V),V)); }while(0)
|
||||
|
||||
// Print up to 20 pairs of values. Odd elements must be PSTR pointers.
|
||||
// Print pairs of values. Odd elements must be PSTR pointers.
|
||||
#define __SEP_N_P(N,V...) _SEP_##N##_P(V)
|
||||
#define _SEP_N_P(N,V...) __SEP_N_P(N,V)
|
||||
#define _SEP_N_P_REF() _SEP_N_P
|
||||
|
|
@ -212,7 +212,7 @@ void SERIAL_ECHOLN(T arg1, Args ... args) { SERIAL_ECHO(arg1); SERIAL_ECHO(args
|
|||
#define _SEP_3_P(p,v,V...) _SEP_2_P(p,v); DEFER2(_SEP_N_P_REF)()(TWO_ARGS(V),V);
|
||||
#define SERIAL_ECHOPGM_P(V...) do{ EVAL(_SEP_N_P(TWO_ARGS(V),V)); }while(0)
|
||||
|
||||
// Print up to 20 pairs of values followed by newline. Odd elements must be PSTR pointers.
|
||||
// Print pairs of values followed by newline. Odd elements must be PSTR pointers.
|
||||
#define __SELP_N_P(N,V...) _SELP_##N##_P(V)
|
||||
#define _SELP_N_P(N,V...) __SELP_N_P(N,V)
|
||||
#define _SELP_N_P_REF() _SELP_N_P
|
||||
|
|
@ -236,16 +236,16 @@ void SERIAL_ECHO_SP(uint8_t count);
|
|||
inline FSTR_P const ON_OFF(const bool onoff) { return onoff ? F("ON") : F("OFF"); }
|
||||
inline FSTR_P const TRUE_FALSE(const bool tf) { return tf ? F("true") : F("false"); }
|
||||
|
||||
void serial_offset(const_float_t v, const uint8_t sp=0); // For v==0 draw space (sp==1) or plus (sp==2)
|
||||
void serial_offset(const float v, const uint8_t sp=0); // For v==0 draw space (sp==1) or plus (sp==2)
|
||||
|
||||
void print_bin(const uint16_t val);
|
||||
|
||||
void print_xyz(NUM_AXIS_ARGS_(const_float_t) FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr);
|
||||
void print_xyz(NUM_AXIS_ARGS_(const float) FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr);
|
||||
inline void print_xyz(const xyz_pos_t &xyz, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) {
|
||||
print_xyz(NUM_AXIS_ELEM_(xyz) prefix, suffix);
|
||||
}
|
||||
|
||||
void print_xyze(LOGICAL_AXIS_ARGS_(const_float_t) FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr);
|
||||
void print_xyze(LOGICAL_AXIS_ARGS_(const float) FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr);
|
||||
inline void print_xyze(const xyze_pos_t &xyze, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) {
|
||||
print_xyze(LOGICAL_AXIS_ELEM_LC_(xyze) prefix, suffix);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,9 @@ template <class L, class R> struct IF<true, L, R> { typedef L type; };
|
|||
#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 NUM_AXIS_PAIRED_LIST(V...) LIST_N(DOUBLE(NUM_AXES), V)
|
||||
#define LOGICAL_AXIS_PAIRED_LIST(EA,EB,V...) NUM_AXIS_PAIRED_LIST(V) LIST_ITEM_E(EA) LIST_ITEM_E(EB)
|
||||
|
||||
#if NUM_AXES
|
||||
#define NUM_AXES_SEP ,
|
||||
#define MAIN_AXIS_MAP(F) MAP(F, MAIN_AXIS_NAMES)
|
||||
|
|
@ -360,17 +363,6 @@ typedef uint16_t raw_adc_t;
|
|||
typedef int16_t celsius_t;
|
||||
typedef float celsius_float_t;
|
||||
|
||||
//
|
||||
// On AVR pointers are only 2 bytes so use 'const float &' for 'const float'
|
||||
//
|
||||
#ifdef __AVR__
|
||||
typedef const float & const_float_t;
|
||||
#else
|
||||
typedef const float const_float_t;
|
||||
#endif
|
||||
typedef const_float_t const_feedRate_t;
|
||||
typedef const_float_t const_celsius_float_t;
|
||||
|
||||
// Type large enough to count leveling grid points
|
||||
typedef IF<TERN0(ABL_USES_GRID, (GRID_MAX_POINTS > 255)), uint16_t, uint8_t>::type grid_count_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,12 +54,12 @@ void Babystep::step_axis(const AxisEnum axis) {
|
|||
}
|
||||
}
|
||||
|
||||
void Babystep::add_mm(const AxisEnum axis, const_float_t mm) {
|
||||
void Babystep::add_mm(const AxisEnum axis, const float mm) {
|
||||
add_steps(axis, mm * planner.settings.axis_steps_per_mm[axis]);
|
||||
}
|
||||
|
||||
#if ENABLED(BD_SENSOR)
|
||||
void Babystep::set_mm(const AxisEnum axis, const_float_t mm) {
|
||||
void Babystep::set_mm(const AxisEnum axis, const float mm) {
|
||||
//if (DISABLED(BABYSTEP_WITHOUT_HOMING) && axis_should_home(axis)) return;
|
||||
const int16_t distance = mm * planner.settings.axis_steps_per_mm[axis];
|
||||
accum = distance; // Count up babysteps for the UI
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public:
|
|||
|
||||
static bool can_babystep(const AxisEnum axis);
|
||||
static void add_steps(const AxisEnum axis, const int16_t distance);
|
||||
static void add_mm(const AxisEnum axis, const_float_t mm);
|
||||
static void add_mm(const AxisEnum axis, const float mm);
|
||||
|
||||
#if ENABLED(EP_BABYSTEPPING)
|
||||
// Step Z for M293 / M294
|
||||
|
|
@ -79,7 +79,7 @@ public:
|
|||
#endif // EP_BABYSTEPPING
|
||||
|
||||
#if ENABLED(BD_SENSOR)
|
||||
static void set_mm(const AxisEnum axis, const_float_t mm);
|
||||
static void set_mm(const AxisEnum axis, const float mm);
|
||||
#endif
|
||||
|
||||
static bool has_steps() {
|
||||
|
|
|
|||
|
|
@ -81,10 +81,10 @@ public:
|
|||
static void set_correction(const float v) { set_correction_uint8(_MAX(0, _MIN(1.0, v)) * all_on + 0.5f); }
|
||||
static float get_correction() { return float(get_correction_uint8()) / all_on; }
|
||||
static void set_distance_mm(const AxisEnum axis, const float v);
|
||||
static float get_distance_mm(const AxisEnum axis) {return distance_mm[axis];}
|
||||
static float get_distance_mm(const AxisEnum axis) { return distance_mm[axis]; }
|
||||
#ifdef BACKLASH_SMOOTHING_MM
|
||||
static void set_smoothing_mm(const float v);
|
||||
static float get_smoothing_mm() {return smoothing_mm;}
|
||||
static float get_smoothing_mm() { return smoothing_mm; }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values/*=nullptr
|
|||
) * 0.5f;
|
||||
}
|
||||
|
||||
float LevelingBilinear::virt_2cmr(const uint8_t x, const uint8_t y, const_float_t tx, const_float_t ty) {
|
||||
float LevelingBilinear::virt_2cmr(const uint8_t x, const uint8_t y, const float tx, const float ty) {
|
||||
float row[4], column[4];
|
||||
for (uint8_t i = 0; i < 4; ++i) {
|
||||
for (uint8_t j = 0; j < 4; ++j) {
|
||||
|
|
@ -369,7 +369,7 @@ float LevelingBilinear::get_z_correction(const xy_pos_t &raw) {
|
|||
* Prepare a bilinear-leveled linear move on Cartesian,
|
||||
* splitting the move where it crosses grid borders.
|
||||
*/
|
||||
void LevelingBilinear::line_to_destination(const_feedRate_t scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) {
|
||||
void LevelingBilinear::line_to_destination(const feedRate_t scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) {
|
||||
// Get current and destination cells for this line
|
||||
xy_int_t c1 { CELL_INDEX(x, current_position.x), CELL_INDEX(y, current_position.y) },
|
||||
c2 { CELL_INDEX(x, destination.x), CELL_INDEX(y, destination.y) };
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ private:
|
|||
|
||||
static float virt_coord(const uint8_t x, const uint8_t y);
|
||||
static float virt_cmr(const float p[4], const uint8_t i, const float t);
|
||||
static float virt_2cmr(const uint8_t x, const uint8_t y, const_float_t tx, const_float_t ty);
|
||||
static float virt_2cmr(const uint8_t x, const uint8_t y, const float tx, const float ty);
|
||||
static void subdivide_mesh();
|
||||
#endif
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ public:
|
|||
static constexpr float get_z_offset() { return 0.0f; }
|
||||
|
||||
#if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES)
|
||||
static void line_to_destination(const_feedRate_t scaled_fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF);
|
||||
static void line_to_destination(const feedRate_t scaled_fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ TemporaryBedLevelingState::TemporaryBedLevelingState(const bool enable) : saved(
|
|||
|
||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||
|
||||
void set_z_fade_height(const_float_t zfh, const bool do_report/*=true*/) {
|
||||
void set_z_fade_height(const float zfh, const bool do_report/*=true*/) {
|
||||
|
||||
if (planner.z_fade_height == zfh) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ void set_bed_leveling_enabled(const bool enable=true);
|
|||
void reset_bed_level();
|
||||
|
||||
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
||||
void set_z_fade_height(const_float_t zfh, const bool do_report=true);
|
||||
void set_z_fade_height(const float zfh, const bool do_report=true);
|
||||
#endif
|
||||
|
||||
#if ANY(MESH_BED_LEVELING, PROBE_MANUALLY)
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
* Prepare a mesh-leveled linear move in a Cartesian setup,
|
||||
* splitting the move where it crosses mesh borders.
|
||||
*/
|
||||
void mesh_bed_leveling::line_to_destination(const_feedRate_t scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) {
|
||||
void mesh_bed_leveling::line_to_destination(const feedRate_t scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) {
|
||||
// Get current and destination cells for this line
|
||||
xy_uint8_t scel = cell_indexes(current_position), ecel = cell_indexes(destination);
|
||||
NOMORE(scel.x, GRID_MAX_CELLS_X - 1);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public:
|
|||
|
||||
static bool mesh_is_valid() { return has_mesh(); }
|
||||
|
||||
static void set_z(const int8_t px, const int8_t py, const_float_t z) { z_values[px][py] = z; }
|
||||
static void set_z(const int8_t px, const int8_t py, const float z) { z_values[px][py] = z; }
|
||||
|
||||
static void zigzag(const int8_t index, int8_t &px, int8_t &py) {
|
||||
px = index % (GRID_MAX_POINTS_X);
|
||||
|
|
@ -63,7 +63,7 @@ public:
|
|||
if (py & 1) px = (GRID_MAX_POINTS_X) - 1 - px; // Zig zag
|
||||
}
|
||||
|
||||
static void set_zigzag_z(const int8_t index, const_float_t z) {
|
||||
static void set_zigzag_z(const int8_t index, const float z) {
|
||||
int8_t px, py;
|
||||
zigzag(index, px, py);
|
||||
set_z(px, py, z);
|
||||
|
|
@ -72,33 +72,33 @@ public:
|
|||
static float get_mesh_x(const uint8_t i) { return index_to_xpos[i]; }
|
||||
static float get_mesh_y(const uint8_t i) { return index_to_ypos[i]; }
|
||||
|
||||
static uint8_t cell_index_x(const_float_t x) {
|
||||
static uint8_t cell_index_x(const float x) {
|
||||
int8_t cx = (x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST);
|
||||
return constrain(cx, 0, GRID_MAX_CELLS_X - 1);
|
||||
}
|
||||
static uint8_t cell_index_y(const_float_t y) {
|
||||
static uint8_t cell_index_y(const float y) {
|
||||
int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST);
|
||||
return constrain(cy, 0, GRID_MAX_CELLS_Y - 1);
|
||||
}
|
||||
static xy_uint8_t cell_indexes(const_float_t x, const_float_t y) {
|
||||
static xy_uint8_t cell_indexes(const float x, const float y) {
|
||||
return { cell_index_x(x), cell_index_y(y) };
|
||||
}
|
||||
static xy_uint8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); }
|
||||
|
||||
static int8_t probe_index_x(const_float_t x) {
|
||||
static int8_t probe_index_x(const float x) {
|
||||
int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * RECIPROCAL(MESH_X_DIST);
|
||||
return WITHIN(px, 0, (GRID_MAX_POINTS_X) - 1) ? px : -1;
|
||||
}
|
||||
static int8_t probe_index_y(const_float_t y) {
|
||||
static int8_t probe_index_y(const float y) {
|
||||
int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * RECIPROCAL(MESH_Y_DIST);
|
||||
return WITHIN(py, 0, (GRID_MAX_POINTS_Y) - 1) ? py : -1;
|
||||
}
|
||||
static xy_int8_t probe_indexes(const_float_t x, const_float_t y) {
|
||||
static xy_int8_t probe_indexes(const float x, const float y) {
|
||||
return { probe_index_x(x), probe_index_y(y) };
|
||||
}
|
||||
static xy_int8_t probe_indexes(const xy_pos_t &xy) { return probe_indexes(xy.x, xy.y); }
|
||||
|
||||
static float calc_z0(const_float_t a0, const_float_t a1, const_float_t z1, const_float_t a2, const_float_t z2) {
|
||||
static float calc_z0(const float a0, const float a1, const float z1, const float a2, const float z2) {
|
||||
const float delta_z = (z2 - z1) / (a2 - a1),
|
||||
delta_a = a0 - a1;
|
||||
return z1 + delta_a * delta_z;
|
||||
|
|
@ -118,7 +118,7 @@ public:
|
|||
}
|
||||
|
||||
#if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES)
|
||||
static void line_to_destination(const_feedRate_t scaled_fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF);
|
||||
static void line_to_destination(const feedRate_t scaled_fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ void unified_bed_leveling::invalidate() {
|
|||
set_all_mesh_points_to_value(NAN);
|
||||
}
|
||||
|
||||
void unified_bed_leveling::set_all_mesh_points_to_value(const_float_t value) {
|
||||
void unified_bed_leveling::set_all_mesh_points_to_value(const float value) {
|
||||
GRID_LOOP(x, y) {
|
||||
z_values[x][y] = value;
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, value));
|
||||
|
|
@ -115,7 +115,7 @@ void unified_bed_leveling::set_all_mesh_points_to_value(const_float_t value) {
|
|||
constexpr int16_t Z_STEPS_NAN = INT16_MAX;
|
||||
|
||||
void unified_bed_leveling::set_store_from_mesh(const bed_mesh_t &in_values, mesh_store_t &stored_values) {
|
||||
auto z_to_store = [](const_float_t z) {
|
||||
auto z_to_store = [](const float z) {
|
||||
if (isnan(z)) return Z_STEPS_NAN;
|
||||
const int32_t z_scaled = TRUNC(z * mesh_store_scaling);
|
||||
if (z_scaled == Z_STEPS_NAN || !WITHIN(z_scaled, INT16_MIN, INT16_MAX))
|
||||
|
|
|
|||
|
|
@ -67,15 +67,15 @@ private:
|
|||
static G29_parameters_t param;
|
||||
|
||||
#if IS_NEWPANEL
|
||||
static void move_z_with_encoder(const_float_t multiplier);
|
||||
static void move_z_with_encoder(const float multiplier);
|
||||
static float measure_point_with_encoder();
|
||||
static float measure_business_card_thickness();
|
||||
static void manually_probe_remaining_mesh(const xy_pos_t&, const_float_t, const_float_t, const bool) __O0;
|
||||
static void manually_probe_remaining_mesh(const xy_pos_t&, const float, const float, const bool) __O0;
|
||||
static void fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) __O0;
|
||||
#endif
|
||||
|
||||
static bool G29_parse_parameters() __O0;
|
||||
static void shift_mesh_height();
|
||||
static void shift_mesh_height(const float zoffs);
|
||||
static void probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) __O0;
|
||||
static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map);
|
||||
static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir);
|
||||
|
|
@ -101,13 +101,13 @@ public:
|
|||
static mesh_index_pair find_furthest_invalid_mesh_point() __O0;
|
||||
static void reset();
|
||||
static void invalidate();
|
||||
static void set_all_mesh_points_to_value(const_float_t value);
|
||||
static void adjust_mesh_to_mean(const bool cflag, const_float_t value);
|
||||
static void set_all_mesh_points_to_value(const float value);
|
||||
static void adjust_mesh_to_mean(const bool cflag, const float value);
|
||||
static bool sanity_check();
|
||||
static void smart_fill_mesh();
|
||||
|
||||
static void G29() __O0; // O0 for no optimization
|
||||
static void smart_fill_wlsf(const_float_t ) __O2; // O2 gives smaller code than Os on A2560
|
||||
static void smart_fill_wlsf(const float ) __O2; // O2 gives smaller code than Os on A2560
|
||||
|
||||
static int8_t storage_slot;
|
||||
|
||||
|
|
@ -130,42 +130,42 @@ public:
|
|||
|
||||
unified_bed_leveling();
|
||||
|
||||
FORCE_INLINE static void set_z(const int8_t px, const int8_t py, const_float_t z) { z_values[px][py] = z; }
|
||||
FORCE_INLINE static void set_z(const int8_t px, const int8_t py, const float z) { z_values[px][py] = z; }
|
||||
|
||||
static int8_t cell_index_x_raw(const_float_t x) {
|
||||
static int8_t cell_index_x_raw(const float x) {
|
||||
return FLOOR((x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST));
|
||||
}
|
||||
|
||||
static int8_t cell_index_y_raw(const_float_t y) {
|
||||
static int8_t cell_index_y_raw(const float y) {
|
||||
return FLOOR((y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST));
|
||||
}
|
||||
|
||||
static bool cell_index_x_valid(const_float_t x) {
|
||||
static bool cell_index_x_valid(const float x) {
|
||||
return WITHIN(cell_index_x_raw(x), 0, GRID_MAX_CELLS_X - 1);
|
||||
}
|
||||
|
||||
static bool cell_index_y_valid(const_float_t y) {
|
||||
static bool cell_index_y_valid(const float y) {
|
||||
return WITHIN(cell_index_y_raw(y), 0, GRID_MAX_CELLS_Y - 1);
|
||||
}
|
||||
|
||||
static uint8_t cell_index_x(const_float_t x) {
|
||||
static uint8_t cell_index_x(const float x) {
|
||||
return constrain(cell_index_x_raw(x), 0, GRID_MAX_CELLS_X - 1);
|
||||
}
|
||||
|
||||
static uint8_t cell_index_y(const_float_t y) {
|
||||
static uint8_t cell_index_y(const float y) {
|
||||
return constrain(cell_index_y_raw(y), 0, GRID_MAX_CELLS_Y - 1);
|
||||
}
|
||||
|
||||
static xy_uint8_t cell_indexes(const_float_t x, const_float_t y) {
|
||||
static xy_uint8_t cell_indexes(const float x, const float y) {
|
||||
return { cell_index_x(x), cell_index_y(y) };
|
||||
}
|
||||
static xy_uint8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); }
|
||||
|
||||
static int8_t closest_x_index(const_float_t x) {
|
||||
static int8_t closest_x_index(const float x) {
|
||||
const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * RECIPROCAL(MESH_X_DIST);
|
||||
return WITHIN(px, 0, (GRID_MAX_POINTS_X) - 1) ? px : -1;
|
||||
}
|
||||
static int8_t closest_y_index(const_float_t y) {
|
||||
static int8_t closest_y_index(const float y) {
|
||||
const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * RECIPROCAL(MESH_Y_DIST);
|
||||
return WITHIN(py, 0, (GRID_MAX_POINTS_Y) - 1) ? py : -1;
|
||||
}
|
||||
|
|
@ -188,7 +188,7 @@ public:
|
|||
* It is fairly expensive with its 4 floating point additions and 2 floating point
|
||||
* multiplications.
|
||||
*/
|
||||
FORCE_INLINE static float calc_z0(const_float_t a0, const_float_t a1, const_float_t z1, const_float_t a2, const_float_t z2) {
|
||||
FORCE_INLINE static float calc_z0(const float a0, const float a1, const float z1, const float a2, const float z2) {
|
||||
return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1);
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ public:
|
|||
* z_correction_for_x_on_horizontal_mesh_line is an optimization for
|
||||
* the case where the printer is making a vertical line that only crosses horizontal mesh lines.
|
||||
*/
|
||||
static float z_correction_for_x_on_horizontal_mesh_line(const_float_t rx0, const int x1_i, const int yi) {
|
||||
static float z_correction_for_x_on_horizontal_mesh_line(const float rx0, const int x1_i, const int yi) {
|
||||
if (!WITHIN(x1_i, 0, (GRID_MAX_POINTS_X) - 1) || !WITHIN(yi, 0, (GRID_MAX_POINTS_Y) - 1)) {
|
||||
|
||||
if (DEBUGGING(LEVELING)) {
|
||||
|
|
@ -225,7 +225,7 @@ public:
|
|||
//
|
||||
// See comments above for z_correction_for_x_on_horizontal_mesh_line
|
||||
//
|
||||
static float z_correction_for_y_on_vertical_mesh_line(const_float_t ry0, const int xi, const int y1_i) {
|
||||
static float z_correction_for_y_on_vertical_mesh_line(const float ry0, const int xi, const int y1_i) {
|
||||
if (!WITHIN(xi, 0, (GRID_MAX_POINTS_X) - 1) || !WITHIN(y1_i, 0, (GRID_MAX_POINTS_Y) - 1)) {
|
||||
|
||||
if (DEBUGGING(LEVELING)) {
|
||||
|
|
@ -251,7 +251,7 @@ public:
|
|||
* Z-Height at both ends. Then it does a linear interpolation of these heights based
|
||||
* on the Y position within the cell.
|
||||
*/
|
||||
static float get_z_correction(const_float_t rx0, const_float_t ry0) {
|
||||
static float get_z_correction(const float rx0, const float ry0) {
|
||||
const int8_t cx = cell_index_x(rx0), cy = cell_index_y(ry0); // return values are clamped
|
||||
|
||||
/**
|
||||
|
|
@ -295,9 +295,9 @@ public:
|
|||
}
|
||||
|
||||
#if UBL_SEGMENTED
|
||||
static bool line_to_destination_segmented(const_feedRate_t scaled_fr_mm_s);
|
||||
static bool line_to_destination_segmented(const feedRate_t scaled_fr_mm_s);
|
||||
#else
|
||||
static void line_to_destination_cartesian(const_feedRate_t scaled_fr_mm_s, const uint8_t e);
|
||||
static void line_to_destination_cartesian(const feedRate_t scaled_fr_mm_s, const uint8_t e);
|
||||
#endif
|
||||
|
||||
static bool mesh_is_valid() {
|
||||
|
|
|
|||
|
|
@ -612,7 +612,7 @@ void unified_bed_leveling::G29() {
|
|||
|
||||
case 5: adjust_mesh_to_mean(param.C_seen, param.C_constant); break;
|
||||
|
||||
case 6: shift_mesh_height(); break;
|
||||
case 6: shift_mesh_height(param.C_constant); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -716,7 +716,7 @@ void unified_bed_leveling::G29() {
|
|||
* G29 P5 C<value> : Adjust Mesh To Mean (and subtract the given offset).
|
||||
* Find the mean average and shift the mesh to center on that value.
|
||||
*/
|
||||
void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const_float_t offset) {
|
||||
void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const float offset) {
|
||||
float sum = 0;
|
||||
uint8_t n = 0;
|
||||
GRID_LOOP(x, y)
|
||||
|
|
@ -752,10 +752,10 @@ void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const_float_t o
|
|||
/**
|
||||
* G29 P6 C<offset> : Shift Mesh Height by a uniform constant.
|
||||
*/
|
||||
void unified_bed_leveling::shift_mesh_height() {
|
||||
void unified_bed_leveling::shift_mesh_height(const float zoffs) {
|
||||
GRID_LOOP(x, y)
|
||||
if (!isnan(z_values[x][y])) {
|
||||
z_values[x][y] += param.C_constant;
|
||||
z_values[x][y] += zoffs;
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y]));
|
||||
}
|
||||
}
|
||||
|
|
@ -870,7 +870,7 @@ void set_message_with_feedback(FSTR_P const fstr) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void unified_bed_leveling::move_z_with_encoder(const_float_t multiplier) {
|
||||
void unified_bed_leveling::move_z_with_encoder(const float multiplier) {
|
||||
ui.wait_for_release();
|
||||
while (!ui.button_pressed()) {
|
||||
idle();
|
||||
|
|
@ -953,7 +953,7 @@ void set_message_with_feedback(FSTR_P const fstr) {
|
|||
* Move to INVALID points and
|
||||
* NOTE: Blocks the G-code queue and captures Marlin UI during use.
|
||||
*/
|
||||
void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const_float_t z_clearance, const_float_t thick, const bool do_ubl_mesh_map) {
|
||||
void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const float z_clearance, const float thick, const bool do_ubl_mesh_map) {
|
||||
ui.capture();
|
||||
TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
|
||||
|
||||
|
|
@ -1661,10 +1661,10 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||
*/
|
||||
#if ENABLED(VALIDATE_MESH_TILT)
|
||||
auto d_from = []{ DEBUG_ECHOPGM("D from "); };
|
||||
auto normed = [&](const xy_pos_t &pos, const_float_t zadd) {
|
||||
auto normed = [&](const xy_pos_t &pos, const float zadd) {
|
||||
return normal.x * pos.x + normal.y * pos.y + zadd;
|
||||
};
|
||||
auto debug_pt = [](const int num, const xy_pos_t &pos, const_float_t zadd) {
|
||||
auto debug_pt = [](const int num, const xy_pos_t &pos, const float zadd) {
|
||||
d_from();
|
||||
DEBUG_ECHOLN(F("Point "), num, C(':'), p_float_t(normed(pos, zadd), 6), F(" Z error = "), p_float_t(zadd - get_z_correction(pos), 6));
|
||||
};
|
||||
|
|
@ -1685,7 +1685,7 @@ void unified_bed_leveling::smart_fill_mesh() {
|
|||
#endif // HAS_BED_PROBE
|
||||
|
||||
#if ENABLED(UBL_G29_P31)
|
||||
void unified_bed_leveling::smart_fill_wlsf(const_float_t weight_factor) {
|
||||
void unified_bed_leveling::smart_fill_wlsf(const float weight_factor) {
|
||||
|
||||
// For each undefined mesh point, compute a distance-weighted least squares fit
|
||||
// from all the originally populated mesh points, weighted toward the point
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
// corners of cells. To fix the issue, simply check if the start/end of the line
|
||||
// is very close to a cell boundary in advance and don't split the line there.
|
||||
|
||||
void unified_bed_leveling::line_to_destination_cartesian(const_feedRate_t scaled_fr_mm_s, const uint8_t extruder) {
|
||||
void unified_bed_leveling::line_to_destination_cartesian(const feedRate_t scaled_fr_mm_s, const uint8_t extruder) {
|
||||
/**
|
||||
* Much of the nozzle movement will be within the same cell. So we will do as little computation
|
||||
* as possible to determine if this is the case. If this move is within the same cell, we will
|
||||
|
|
@ -351,7 +351,7 @@
|
|||
* Returns true if did NOT move, false if moved (requires current_position update).
|
||||
*/
|
||||
|
||||
bool __O2 unified_bed_leveling::line_to_destination_segmented(const_feedRate_t scaled_fr_mm_s) {
|
||||
bool __O2 unified_bed_leveling::line_to_destination_segmented(const feedRate_t scaled_fr_mm_s) {
|
||||
|
||||
if (!position_is_reachable(destination)) // fail if moving outside reachable boundary
|
||||
return true; // did not move, so current_position still accurate
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ bool CaseLight::on = CASE_LIGHT_DEFAULT_ON;
|
|||
|
||||
#if CASE_LIGHT_IS_COLOR_LED
|
||||
constexpr uint8_t init_case_light[] = CASE_LIGHT_DEFAULT_COLOR;
|
||||
LEDColor CaseLight::color = { init_case_light[0], init_case_light[1], init_case_light[2] OPTARG(HAS_WHITE_LED, init_case_light[3]) };
|
||||
LED1Color_t CaseLight::color = { init_case_light[0], init_case_light[1], init_case_light[2] OPTARG(HAS_WHITE_LED, init_case_light[3]) };
|
||||
#endif
|
||||
|
||||
void CaseLight::update(const bool sflag) {
|
||||
|
|
@ -67,13 +67,13 @@ void CaseLight::update(const bool sflag) {
|
|||
#if ENABLED(CASE_LIGHT_USE_NEOPIXEL)
|
||||
if (on)
|
||||
// Use current color of (NeoPixel) leds and new brightness level
|
||||
leds.set_color(LEDColor(leds.color.r, leds.color.g, leds.color.b OPTARG(HAS_WHITE_LED, leds.color.w) OPTARG(NEOPIXEL_LED, n10ct)));
|
||||
leds.set_color(LED1Color_t(leds.color.r, leds.color.g, leds.color.b OPTARG(HAS_WHITE_LED, leds.color.w) OPTARG(NEOPIXEL_LED, n10ct)));
|
||||
else
|
||||
// Switch off leds
|
||||
leds.set_off();
|
||||
#else
|
||||
// Use CaseLight color (CASE_LIGHT_DEFAULT_COLOR) and new brightness level
|
||||
leds.set_color(LEDColor(color.r, color.g, color.b OPTARG(HAS_WHITE_LED, color.w) OPTARG(NEOPIXEL_LED, n10ct)));
|
||||
leds.set_color(LED1Color_t(color.r, color.g, color.b OPTARG(HAS_WHITE_LED, color.w) OPTARG(NEOPIXEL_LED, n10ct)));
|
||||
#endif
|
||||
#else // !CASE_LIGHT_IS_COLOR_LED
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include "../inc/MarlinConfig.h"
|
||||
|
||||
#if CASE_LIGHT_IS_COLOR_LED
|
||||
#include "leds/leds.h" // for LEDColor
|
||||
#include "leds/leds.h" // for LED1Color_t
|
||||
#endif
|
||||
|
||||
class CaseLight {
|
||||
|
|
@ -50,7 +50,7 @@ public:
|
|||
|
||||
#if ENABLED(CASE_LIGHT_IS_COLOR_LED)
|
||||
private:
|
||||
static LEDColor color;
|
||||
static LED1Color_t color;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -44,9 +44,30 @@ uint8_t ControllerFan::speed;
|
|||
|
||||
void ControllerFan::setup() {
|
||||
SET_OUTPUT(CONTROLLER_FAN_PIN);
|
||||
#ifdef CONTROLLER_FAN2_PIN
|
||||
#if PIN_EXISTS(CONTROLLER_FAN2)
|
||||
SET_OUTPUT(CONTROLLER_FAN2_PIN);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN3)
|
||||
SET_OUTPUT(CONTROLLER_FAN3_PIN);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN4)
|
||||
SET_OUTPUT(CONTROLLER_FAN4_PIN);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN5)
|
||||
SET_OUTPUT(CONTROLLER_FAN5_PIN);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN6)
|
||||
SET_OUTPUT(CONTROLLER_FAN6_PIN);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN7)
|
||||
SET_OUTPUT(CONTROLLER_FAN7_PIN);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN8)
|
||||
SET_OUTPUT(CONTROLLER_FAN8_PIN);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN9)
|
||||
SET_OUTPUT(CONTROLLER_FAN9_PIN);
|
||||
#endif
|
||||
init();
|
||||
}
|
||||
|
||||
|
|
@ -107,19 +128,38 @@ void ControllerFan::update() {
|
|||
fan_kick_end = 0;
|
||||
#endif
|
||||
|
||||
#define SET_CONTROLLER_FAN(N) do { \
|
||||
if (PWM_PIN(CONTROLLER_FAN##N##_PIN)) hal.set_pwm_duty(pin_t(CONTROLLER_FAN##N##_PIN), speed); \
|
||||
else WRITE(CONTROLLER_FAN##N##_PIN, speed > 0);\
|
||||
} while (0)
|
||||
|
||||
#if ENABLED(FAN_SOFT_PWM)
|
||||
soft_pwm_speed = speed;
|
||||
#else
|
||||
if (PWM_PIN(CONTROLLER_FAN_PIN))
|
||||
hal.set_pwm_duty(pin_t(CONTROLLER_FAN_PIN), speed);
|
||||
else
|
||||
WRITE(CONTROLLER_FAN_PIN, speed > 0);
|
||||
|
||||
#ifdef CONTROLLER_FAN2_PIN
|
||||
if (PWM_PIN(CONTROLLER_FAN2_PIN))
|
||||
hal.set_pwm_duty(pin_t(CONTROLLER_FAN2_PIN), speed);
|
||||
else
|
||||
WRITE(CONTROLLER_FAN2_PIN, speed > 0);
|
||||
SET_CONTROLLER_FAN();
|
||||
#if PIN_EXISTS(CONTROLLER_FAN2)
|
||||
SET_CONTROLLER_FAN(2);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN3)
|
||||
SET_CONTROLLER_FAN(3);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN4)
|
||||
SET_CONTROLLER_FAN(4);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN5)
|
||||
SET_CONTROLLER_FAN(5);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN6)
|
||||
SET_CONTROLLER_FAN(6);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN7)
|
||||
SET_CONTROLLER_FAN(7);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN8)
|
||||
SET_CONTROLLER_FAN(8);
|
||||
#endif
|
||||
#if PIN_EXISTS(CONTROLLER_FAN9)
|
||||
SET_CONTROLLER_FAN(9);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ void EasythreedUI::loadButton() {
|
|||
break;
|
||||
|
||||
case FS_PROCEED: {
|
||||
// Feed or Retract just once. Hard abort all moves and return to idle on swicth release.
|
||||
// Feed or Retract just once. Hard abort all moves and return to idle on switch release.
|
||||
static bool flag = false;
|
||||
if (READ(BTN_RETRACT) && READ(BTN_FEED)) { // Switch in center position (stop)
|
||||
flag = false; // Restore flag to false
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ class I2CPositionEncoder {
|
|||
FORCE_INLINE void set_ec_method(const byte method) { ecMethod = method; }
|
||||
|
||||
FORCE_INLINE float get_ec_threshold() { return ecThreshold; }
|
||||
FORCE_INLINE void set_ec_threshold(const_float_t newThreshold) { ecThreshold = newThreshold; }
|
||||
FORCE_INLINE void set_ec_threshold(const float newThreshold) { ecThreshold = newThreshold; }
|
||||
|
||||
FORCE_INLINE int get_encoder_ticks_mm() {
|
||||
switch (type) {
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public:
|
|||
static void update_measured_mm() { measured_mm = raw_to_mm(); }
|
||||
|
||||
// Update ring buffer used to delay filament measurements
|
||||
static void advance_e(const_float_t e_move) {
|
||||
static void advance_e(const float e_move) {
|
||||
|
||||
// Increment counters with the E distance
|
||||
e_count += e_move;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#include "leds.h"
|
||||
#include <Wire.h>
|
||||
|
||||
void blinkm_set_led_color(const LEDColor &color) {
|
||||
void blinkm_set_led_color(const LED1Color_t &color) {
|
||||
Wire.begin();
|
||||
Wire.beginTransmission(I2C_ADDRESS(0x09));
|
||||
Wire.write('o'); //to disable ongoing script, only needs to be used once
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
* blinkm.h - Control a BlinkM over i2c
|
||||
*/
|
||||
|
||||
struct LEDColor;
|
||||
typedef LEDColor LEDColor;
|
||||
struct LED1Color_t;
|
||||
|
||||
void blinkm_set_led_color(const LEDColor &color);
|
||||
void blinkm_set_led_color(const LED1Color_t &color);
|
||||
|
|
|
|||
|
|
@ -35,15 +35,15 @@
|
|||
#endif
|
||||
|
||||
#if ENABLED(LED_COLOR_PRESETS)
|
||||
const LEDColor LEDLights::defaultLEDColor = LEDColor(
|
||||
const LED1Color_t LEDLights::defaultLEDColor {
|
||||
LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE
|
||||
OPTARG(HAS_WHITE_LED, LED_USER_PRESET_WHITE)
|
||||
OPTARG(NEOPIXEL_LED, LED_USER_PRESET_BRIGHTNESS)
|
||||
);
|
||||
};
|
||||
#endif
|
||||
|
||||
#if ANY(LED_CONTROL_MENU, PRINTER_EVENT_LEDS, CASE_LIGHT_IS_COLOR_LED)
|
||||
LEDColor LEDLights::color;
|
||||
LED1Color_t LEDLights::color;
|
||||
bool LEDLights::lights_on;
|
||||
#endif
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ void LEDLights::setup() {
|
|||
constexpr int8_t led_pin_count = TERN(HAS_WHITE_LED, 4, 3);
|
||||
|
||||
// Startup animation
|
||||
LEDColor curColor = LEDColorOff();
|
||||
LED1Color_t curColor = LEDColorOff();
|
||||
PCA9632_set_led_color(curColor); // blackout
|
||||
delay(200);
|
||||
|
||||
|
|
@ -156,15 +156,15 @@ void LEDLights::setup() {
|
|||
TERN_(LED_USER_PRESET_STARTUP, set_default());
|
||||
}
|
||||
|
||||
void LEDLights::set_color(const LEDColor &incol
|
||||
void LEDLights::set_color(const LED1Color_t &incol
|
||||
OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence/*=false*/)
|
||||
) {
|
||||
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
|
||||
const uint32_t neocolor = LEDColorWhite() == incol
|
||||
? neo.Color(NEO_WHITE)
|
||||
: neo.Color(incol.r, incol.g, incol.b OPTARG(HAS_WHITE_LED, incol.w));
|
||||
? neo.White()
|
||||
: neo.Color(incol.r, incol.g, incol.b OPTARG(HAS_WHITE_NEOPIXEL_1, incol.w));
|
||||
|
||||
#if ENABLED(NEOPIXEL_IS_SEQUENTIAL)
|
||||
static uint16_t nextLed = 0;
|
||||
|
|
@ -258,7 +258,7 @@ void LEDLights::set_color(const LEDColor &incol
|
|||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
|
||||
#if ENABLED(NEO2_COLOR_PRESETS)
|
||||
const LEDColor LEDLights2::defaultLEDColor = LEDColor(
|
||||
const LED2Color_t LEDLights2::defaultLEDColor2 = LED2Color_t(
|
||||
NEO2_USER_PRESET_RED, NEO2_USER_PRESET_GREEN, NEO2_USER_PRESET_BLUE
|
||||
OPTARG(HAS_WHITE_LED2, NEO2_USER_PRESET_WHITE)
|
||||
OPTARG(NEOPIXEL_LED, NEO2_USER_PRESET_BRIGHTNESS)
|
||||
|
|
@ -266,7 +266,7 @@ void LEDLights::set_color(const LEDColor &incol
|
|||
#endif
|
||||
|
||||
#if ENABLED(LED_CONTROL_MENU)
|
||||
LEDColor LEDLights2::color;
|
||||
LED2Color_t LEDLights2::color;
|
||||
bool LEDLights2::lights_on;
|
||||
#endif
|
||||
|
||||
|
|
@ -277,10 +277,10 @@ void LEDLights::set_color(const LEDColor &incol
|
|||
TERN_(NEO2_USER_PRESET_STARTUP, set_default());
|
||||
}
|
||||
|
||||
void LEDLights2::set_color(const LEDColor &incol) {
|
||||
const uint32_t neocolor = LEDColorWhite() == incol
|
||||
? neo2.Color(NEO2_WHITE)
|
||||
: neo2.Color(incol.r, incol.g, incol.b OPTARG(HAS_WHITE_LED2, incol.w));
|
||||
void LEDLights2::set_color(const LED2Color_t &incol) {
|
||||
const uint32_t neocolor = LEDColorWhite2() == incol
|
||||
? neo2.White()
|
||||
: neo2.Color(incol.r, incol.g, incol.b OPTARG(HAS_WHITE_NEOPIXEL_2, incol.w));
|
||||
neo2.set_brightness(incol.i);
|
||||
neo2.set_color(neocolor);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,6 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
// A white component can be passed
|
||||
#if ANY(RGBW_LED, PCA9632_RGBW)
|
||||
#define HAS_WHITE_LED 1
|
||||
#endif
|
||||
|
||||
#if ENABLED(NEOPIXEL_LED)
|
||||
#define _NEOPIXEL_INCLUDE_
|
||||
#include "neopixel.h"
|
||||
|
|
@ -52,75 +47,142 @@
|
|||
#include "pca9632.h"
|
||||
#endif
|
||||
|
||||
#if ANY(RGBW_LED, PCA9632_RGBW, HAS_WHITE_NEOPIXEL_1)
|
||||
#define HAS_WHITE_LED 1
|
||||
#endif
|
||||
#if HAS_WHITE_NEOPIXEL_2
|
||||
#define HAS_WHITE_LED2 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LEDcolor type for use with leds.set_color
|
||||
*/
|
||||
typedef struct LEDColor {
|
||||
uint8_t r, g, b
|
||||
OPTARG(HAS_WHITE_LED, w)
|
||||
OPTARG(NEOPIXEL_LED, i)
|
||||
;
|
||||
struct LED1Color_t {
|
||||
// Basic RGB color components
|
||||
uint8_t r, g, b OPTARG(HAS_WHITE_LED, w) OPTARG(NEOPIXEL_LED, i);
|
||||
// Default constructor - white color
|
||||
LED1Color_t() : r(255), g(255), b(255) OPTARG(HAS_WHITE_LED, w(255)) OPTARG(NEOPIXEL_LED, i(NEOPIXEL_BRIGHTNESS)){}
|
||||
|
||||
LEDColor() : r(255), g(255), b(255)
|
||||
OPTARG(HAS_WHITE_LED, w(255))
|
||||
OPTARG(NEOPIXEL_LED, i(NEOPIXEL_BRIGHTNESS))
|
||||
{}
|
||||
// Copy constructor
|
||||
LED1Color_t(const LED1Color_t&) = default;
|
||||
|
||||
LEDColor(const LEDColor&) = default;
|
||||
|
||||
LEDColor(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w=0) OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS))
|
||||
// Constructor with individual components
|
||||
LED1Color_t(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w=0) OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS))
|
||||
: r(r), g(g), b(b) OPTARG(HAS_WHITE_LED, w(w)) OPTARG(NEOPIXEL_LED, i(i)) {}
|
||||
|
||||
LEDColor(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2])
|
||||
OPTARG(HAS_WHITE_LED, w(rgbw[3]))
|
||||
OPTARG(NEOPIXEL_LED, i(NEOPIXEL_BRIGHTNESS))
|
||||
{}
|
||||
// Constructor from array
|
||||
LED1Color_t(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2])
|
||||
OPTARG(HAS_WHITE_LED, w(rgbw[3])) OPTARG(NEOPIXEL_LED, i(NEOPIXEL_BRIGHTNESS)){}
|
||||
|
||||
LEDColor& operator=(const uint8_t (&rgbw)[4]) {
|
||||
// Array assignment operator
|
||||
LED1Color_t& operator=(const uint8_t (&rgbw)[4]) {
|
||||
r = rgbw[0]; g = rgbw[1]; b = rgbw[2];
|
||||
TERN_(HAS_WHITE_LED, w = rgbw[3]);
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const LEDColor &right) {
|
||||
if (this == &right) return true;
|
||||
return 0 == memcmp(this, &right, sizeof(LEDColor));
|
||||
// Comparison operators
|
||||
bool operator==(const LED1Color_t &right) {
|
||||
return (this == &right) || (0 == memcmp(this, &right, sizeof(LED1Color_t)));
|
||||
}
|
||||
|
||||
bool operator!=(const LEDColor &right) { return !operator==(right); }
|
||||
bool operator!=(const LED1Color_t &right) {
|
||||
return !operator==(right);
|
||||
}
|
||||
|
||||
// Check if LED is effectively off
|
||||
bool is_off() const {
|
||||
return 3 > r + g + b + TERN0(HAS_WHITE_LED, w);
|
||||
}
|
||||
} LEDColor;
|
||||
};
|
||||
|
||||
|
||||
struct LED2Color_t {
|
||||
// Basic RGB color components
|
||||
uint8_t r, g, b OPTARG(HAS_WHITE_LED2, w) OPTARG(NEOPIXEL_LED, i);
|
||||
// Default constructor - white color
|
||||
LED2Color_t() : r(255), g(255), b(255) OPTARG(HAS_WHITE_LED2, w(255)) OPTARG(NEOPIXEL_LED, i(NEOPIXEL_BRIGHTNESS)){}
|
||||
|
||||
// Copy constructor
|
||||
LED2Color_t(const LED2Color_t&) = default;
|
||||
|
||||
// Constructor with individual components
|
||||
LED2Color_t(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED2, uint8_t w=0) OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS))
|
||||
: r(r), g(g), b(b) OPTARG(HAS_WHITE_LED2, w(w)) OPTARG(NEOPIXEL_LED, i(i)) {}
|
||||
|
||||
// Constructor from array
|
||||
LED2Color_t(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2])
|
||||
OPTARG(HAS_WHITE_LED2, w(rgbw[3])) OPTARG(NEOPIXEL_LED, i(NEOPIXEL_BRIGHTNESS)){}
|
||||
|
||||
// Array assignment operator
|
||||
LED2Color_t& operator=(const uint8_t (&rgbw)[4]) {
|
||||
r = rgbw[0]; g = rgbw[1]; b = rgbw[2];
|
||||
TERN_(HAS_WHITE_LED2, w = rgbw[3]);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Comparison operators
|
||||
bool operator==(const LED2Color_t &right) {
|
||||
return (this == &right) || (0 == memcmp(this, &right, sizeof(LED1Color_t)));
|
||||
}
|
||||
|
||||
bool operator!=(const LED2Color_t &right) {
|
||||
return !operator==(right);
|
||||
}
|
||||
|
||||
// Check if LED is effectively off
|
||||
bool is_off() const {
|
||||
return 3 > r + g + b + TERN0(HAS_WHITE_LED2, w);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Color presets
|
||||
*/
|
||||
|
||||
#define LEDColorOff() LEDColor( 0, 0, 0)
|
||||
#define LEDColorRed() LEDColor(255, 0, 0)
|
||||
#define LEDColorOff() LED1Color_t( 0, 0, 0)
|
||||
#define LEDColorRed() LED1Color_t(255, 0, 0)
|
||||
#if ENABLED(LED_COLORS_REDUCE_GREEN)
|
||||
#define LEDColorOrange() LEDColor(255, 25, 0)
|
||||
#define LEDColorYellow() LEDColor(255, 75, 0)
|
||||
#define LEDColorOrange() LED1Color_t(255, 25, 0)
|
||||
#define LEDColorYellow() LED1Color_t(255, 75, 0)
|
||||
#else
|
||||
#define LEDColorOrange() LEDColor(255, 80, 0)
|
||||
#define LEDColorYellow() LEDColor(255, 255, 0)
|
||||
#define LEDColorOrange() LED1Color_t(255, 80, 0)
|
||||
#define LEDColorYellow() LED1Color_t(255, 255, 0)
|
||||
#endif
|
||||
#define LEDColorGreen() LEDColor( 0, 255, 0)
|
||||
#define LEDColorBlue() LEDColor( 0, 0, 255)
|
||||
#define LEDColorIndigo() LEDColor( 0, 255, 255)
|
||||
#define LEDColorViolet() LEDColor(255, 0, 255)
|
||||
#define LEDColorGreen() LED1Color_t( 0, 255, 0)
|
||||
#define LEDColorBlue() LED1Color_t( 0, 0, 255)
|
||||
#define LEDColorIndigo() LED1Color_t( 0, 255, 255)
|
||||
#define LEDColorViolet() LED1Color_t(255, 0, 255)
|
||||
#if HAS_WHITE_LED && DISABLED(RGB_LED)
|
||||
#define LEDColorWhite() LEDColor( 0, 0, 0, 255)
|
||||
#define LEDColorWhite() LED1Color_t( 0, 0, 0, 255)
|
||||
#else
|
||||
#define LEDColorWhite() LEDColor(255, 255, 255)
|
||||
#define LEDColorWhite() LED1Color_t(255, 255, 255)
|
||||
#endif
|
||||
|
||||
#define LEDColorOff2() LED2Color_t( 0, 0, 0)
|
||||
#define LEDColorRed2() LED2Color_t(255, 0, 0)
|
||||
#if ENABLED(LED_COLORS_REDUCE_GREEN)
|
||||
#define LEDColorOrange2() LED2Color_t(255, 25, 0)
|
||||
#define LEDColorYellow2() LED2Color_t(255, 75, 0)
|
||||
#else
|
||||
#define LEDColorOrange2() LED2Color_t(255, 80, 0)
|
||||
#define LEDColorYellow2() LED2Color_t(255, 255, 0)
|
||||
#endif
|
||||
#define LEDColorGreen2() LED2Color_t( 0, 255, 0)
|
||||
#define LEDColorBlue2() LED2Color_t( 0, 0, 255)
|
||||
#define LEDColorIndigo2() LED2Color_t( 0, 255, 255)
|
||||
#define LEDColorViolet2() LED2Color_t(255, 0, 255)
|
||||
#if HAS_WHITE_LED2 && DISABLED(RGB_LED)
|
||||
#define LEDColorWhite2() LED2Color_t( 0, 0, 0, 255)
|
||||
#else
|
||||
#define LEDColorWhite2() LED2Color_t(255, 255, 255)
|
||||
#endif
|
||||
|
||||
|
||||
class LEDLights {
|
||||
public:
|
||||
#if ANY(LED_CONTROL_MENU, PRINTER_EVENT_LEDS, CASE_LIGHT_IS_COLOR_LED)
|
||||
static LEDColor color; // last non-off color
|
||||
static LED1Color_t color; // last non-off color
|
||||
static bool lights_on; // the last set color was "on"
|
||||
#else
|
||||
static constexpr bool lights_on = true;
|
||||
|
|
@ -130,7 +192,7 @@ public:
|
|||
|
||||
static void setup(); // init()
|
||||
|
||||
static void set_color(const LEDColor &color
|
||||
static void set_color(const LED1Color_t &color
|
||||
OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence=false)
|
||||
);
|
||||
|
||||
|
|
@ -139,7 +201,7 @@ public:
|
|||
OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS)
|
||||
OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence=false)
|
||||
) {
|
||||
set_color(LEDColor(r, g, b OPTARG(HAS_WHITE_LED, w) OPTARG(NEOPIXEL_LED, i)) OPTARG(NEOPIXEL_IS_SEQUENTIAL, isSequence));
|
||||
set_color(LED1Color_t(r, g, b OPTARG(HAS_WHITE_LED, w) OPTARG(NEOPIXEL_LED, i)) OPTARG(NEOPIXEL_IS_SEQUENTIAL, isSequence));
|
||||
}
|
||||
|
||||
static void set_off() { set_color(LEDColorOff()); }
|
||||
|
|
@ -147,7 +209,7 @@ public:
|
|||
static void set_white() { set_color(LEDColorWhite()); }
|
||||
|
||||
#if ENABLED(LED_COLOR_PRESETS)
|
||||
static const LEDColor defaultLEDColor;
|
||||
static const LED1Color_t defaultLEDColor;
|
||||
static void set_default() { set_color(defaultLEDColor); }
|
||||
static void set_red() { set_color(LEDColorRed()); }
|
||||
static void set_orange() { set_color(LEDColorOrange()); }
|
||||
|
|
@ -158,7 +220,7 @@ public:
|
|||
#endif
|
||||
|
||||
#if ENABLED(PRINTER_EVENT_LEDS)
|
||||
static LEDColor get_color() { return lights_on ? color : LEDColorOff(); }
|
||||
static LED1Color_t get_color() { return lights_on ? color : LEDColorOff(); }
|
||||
#endif
|
||||
|
||||
#if ENABLED(LED_CONTROL_MENU)
|
||||
|
|
@ -190,35 +252,35 @@ extern LEDLights leds;
|
|||
|
||||
static void setup(); // init()
|
||||
|
||||
static void set_color(const LEDColor &color);
|
||||
static void set_color(const LED2Color_t &color);
|
||||
|
||||
static void set_color(uint8_t r, uint8_t g, uint8_t b
|
||||
OPTARG(HAS_WHITE_LED, uint8_t w=0)
|
||||
OPTARG(HAS_WHITE_LED2, uint8_t w=0)
|
||||
OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS)
|
||||
) {
|
||||
set_color(LEDColor(r, g, b
|
||||
OPTARG(HAS_WHITE_LED, w)
|
||||
set_color(LED2Color_t(r, g, b
|
||||
OPTARG(HAS_WHITE_LED2, w)
|
||||
OPTARG(NEOPIXEL_LED, i)
|
||||
));
|
||||
}
|
||||
|
||||
static void set_off() { set_color(LEDColorOff()); }
|
||||
static void set_green() { set_color(LEDColorGreen()); }
|
||||
static void set_white() { set_color(LEDColorWhite()); }
|
||||
static void set_off() { set_color(LEDColorOff2()); }
|
||||
static void set_green() { set_color(LEDColorGreen2()); }
|
||||
static void set_white() { set_color(LEDColorWhite2()); }
|
||||
|
||||
#if ENABLED(NEO2_COLOR_PRESETS)
|
||||
static const LEDColor defaultLEDColor;
|
||||
static void set_default() { set_color(defaultLEDColor); }
|
||||
static void set_red() { set_color(LEDColorRed()); }
|
||||
static void set_orange() { set_color(LEDColorOrange()); }
|
||||
static void set_yellow() { set_color(LEDColorYellow()); }
|
||||
static void set_blue() { set_color(LEDColorBlue()); }
|
||||
static void set_indigo() { set_color(LEDColorIndigo()); }
|
||||
static void set_violet() { set_color(LEDColorViolet()); }
|
||||
static const LED2Color_t defaultLEDColor2;
|
||||
static void set_default() { set_color(defaultLEDColor2); }
|
||||
static void set_red() { set_color(LEDColorRed2()); }
|
||||
static void set_orange() { set_color(LEDColorOrange2()); }
|
||||
static void set_yellow() { set_color(LEDColorYellow2()); }
|
||||
static void set_blue() { set_color(LEDColorBlue2()); }
|
||||
static void set_indigo() { set_color(LEDColorIndigo2()); }
|
||||
static void set_violet() { set_color(LEDColorViolet2()); }
|
||||
#endif
|
||||
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
static LEDColor color; // last non-off color
|
||||
static LED2Color_t color; // last non-off color
|
||||
static bool lights_on; // the last set color was "on"
|
||||
static void toggle(); // swap "off" with color
|
||||
static void update() { set_color(color); }
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ void Marlin_NeoPixel::init() {
|
|||
safe_delay(500);
|
||||
set_color_startup(adaneo1.Color(0, 0, 255, 0)); // blue
|
||||
safe_delay(500);
|
||||
#if HAS_WHITE_LED
|
||||
#if HAS_WHITE_NEOPIXEL_1
|
||||
set_color_startup(adaneo1.Color(0, 0, 0, 255)); // white
|
||||
safe_delay(500);
|
||||
#endif
|
||||
|
|
@ -158,7 +158,7 @@ void Marlin_NeoPixel::init() {
|
|||
safe_delay(500);
|
||||
set_color_startup(adaneo.Color(0, 0, 255, 0)); // blue
|
||||
safe_delay(500);
|
||||
#if HAS_WHITE_LED2
|
||||
#if HAS_WHITE_NEOPIXEL_2
|
||||
set_color_startup(adaneo.Color(0, 0, 0, 255)); // white
|
||||
safe_delay(500);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -42,19 +42,17 @@
|
|||
// Defines
|
||||
// ------------------------
|
||||
|
||||
#define _NEO_IS_RGB(N) (N == NEO_RGB || N == NEO_RBG || N == NEO_GRB || N == NEO_GBR || N == NEO_BRG || N == NEO_BGR)
|
||||
#define _NEO_IS_RGBW(N) ((N) & 0x30) != (((N) >> 2) & 0x30)
|
||||
|
||||
#if !_NEO_IS_RGB(NEOPIXEL_TYPE)
|
||||
#define HAS_WHITE_LED 1
|
||||
#if _NEO_IS_RGBW(NEOPIXEL_TYPE)
|
||||
#define HAS_WHITE_NEOPIXEL_1 1
|
||||
#endif
|
||||
|
||||
#if HAS_WHITE_LED
|
||||
#define NEO_WHITE 0, 0, 0, 255
|
||||
#else
|
||||
#define NEO_WHITE 255, 255, 255
|
||||
#endif
|
||||
|
||||
#if defined(NEOPIXEL2_TYPE) && NEOPIXEL2_TYPE != NEOPIXEL_TYPE && DISABLED(NEOPIXEL2_SEPARATE)
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
#if _NEO_IS_RGBW(NEOPIXEL2_TYPE)
|
||||
#define HAS_WHITE_NEOPIXEL_2 1
|
||||
#endif
|
||||
#elif defined(NEOPIXEL2_TYPE) && NEOPIXEL2_TYPE != NEOPIXEL_TYPE
|
||||
#define MULTIPLE_NEOPIXEL_TYPES 1
|
||||
#endif
|
||||
|
||||
|
|
@ -62,6 +60,8 @@
|
|||
#define CONJOINED_NEOPIXEL 1
|
||||
#endif
|
||||
|
||||
#undef _NEO_IS_RGBW
|
||||
|
||||
// ------------------------
|
||||
// Types
|
||||
// ------------------------
|
||||
|
|
@ -141,8 +141,17 @@ public:
|
|||
|
||||
static uint8_t brightness() { return adaneo1.getBrightness(); }
|
||||
|
||||
static uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w)) {
|
||||
return adaneo1.Color(r, g, b OPTARG(HAS_WHITE_LED, w));
|
||||
static uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_NEOPIXEL_1, uint8_t w=0)) {
|
||||
return adaneo1.Color(r, g, b OPTARG(HAS_WHITE_NEOPIXEL_1, w));
|
||||
}
|
||||
static uint32_t White() {
|
||||
return Color(
|
||||
#if HAS_WHITE_NEOPIXEL_1
|
||||
0, 0, 0, 255
|
||||
#else
|
||||
255, 255, 255
|
||||
#endif
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -151,15 +160,6 @@ extern Marlin_NeoPixel neo;
|
|||
// Neo pixel channel 2
|
||||
#if ENABLED(NEOPIXEL2_SEPARATE)
|
||||
|
||||
#if _NEO_IS_RGB(NEOPIXEL2_TYPE)
|
||||
#define NEOPIXEL2_IS_RGB 1
|
||||
#define NEO2_WHITE 255, 255, 255
|
||||
#else
|
||||
#define NEOPIXEL2_IS_RGBW 1
|
||||
#define HAS_WHITE_LED2 1 // A white component can be passed for NEOPIXEL2
|
||||
#define NEO2_WHITE 0, 0, 0, 255
|
||||
#endif
|
||||
|
||||
class Marlin_NeoPixel2 {
|
||||
private:
|
||||
static Adafruit_NeoPixel adaneo;
|
||||
|
|
@ -184,13 +184,20 @@ extern Marlin_NeoPixel neo;
|
|||
static uint16_t pixels() { return adaneo.numPixels();}
|
||||
static uint32_t pixel_color(const uint16_t n) { return adaneo.getPixelColor(n); }
|
||||
static uint8_t brightness() { return adaneo.getBrightness(); }
|
||||
static uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED2, uint8_t w)) {
|
||||
return adaneo.Color(r, g, b OPTARG(HAS_WHITE_LED2, w));
|
||||
static uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_NEOPIXEL_2, uint8_t w=0)) {
|
||||
return adaneo.Color(r, g, b OPTARG(HAS_WHITE_NEOPIXEL_2, w));
|
||||
}
|
||||
static uint32_t White() {
|
||||
return Color(
|
||||
#if HAS_WHITE_NEOPIXEL_2
|
||||
0, 0, 0, 255
|
||||
#else
|
||||
255, 255, 255
|
||||
#endif
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
extern Marlin_NeoPixel2 neo2;
|
||||
|
||||
#endif // NEOPIXEL2_SEPARATE
|
||||
|
||||
#undef _NEO_IS_RGB
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
#ifndef PCA9632_BLU
|
||||
#define PCA9632_BLU 0x04
|
||||
#endif
|
||||
#if HAS_WHITE_LED && !defined(PCA9632_WHT)
|
||||
#if ENABLED(PCA9632_RGBW) && !defined(PCA9632_WHT)
|
||||
#define PCA9632_WHT 0x06
|
||||
#endif
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ static void PCA9632_WriteAllRegisters(const byte addr, const byte regadd, const
|
|||
}
|
||||
#endif
|
||||
|
||||
void PCA9632_set_led_color(const LEDColor &color) {
|
||||
void PCA9632_set_led_color(const LED1Color_t &color) {
|
||||
Wire.begin();
|
||||
if (!PCA_init) {
|
||||
PCA_init = 1;
|
||||
|
|
@ -135,10 +135,7 @@ void PCA9632_set_led_color(const LEDColor &color) {
|
|||
const byte LEDOUT = (color.r ? LED_PWM << PCA9632_RED : 0)
|
||||
| (color.g ? LED_PWM << PCA9632_GRN : 0)
|
||||
| (color.b ? LED_PWM << PCA9632_BLU : 0)
|
||||
#if ENABLED(PCA9632_RGBW)
|
||||
| (color.w ? LED_PWM << PCA9632_WHT : 0)
|
||||
#endif
|
||||
;
|
||||
| (TERN0(PCA9632_RGBW, color.w ? LED_PWM << PCA9632_WHT : 0));
|
||||
|
||||
PCA9632_WriteAllRegisters(PCA9632_ADDRESS,PCA9632_PWM0, color.r, color.g, color.b
|
||||
OPTARG(PCA9632_RGBW, color.w)
|
||||
|
|
|
|||
|
|
@ -26,10 +26,9 @@
|
|||
* Written by Robert Mendon Feb 2017.
|
||||
*/
|
||||
|
||||
struct LEDColor;
|
||||
typedef LEDColor LEDColor;
|
||||
struct LED1Color_t;
|
||||
|
||||
void PCA9632_set_led_color(const LEDColor &color);
|
||||
void PCA9632_set_led_color(const LED1Color_t &color);
|
||||
|
||||
#if ENABLED(PCA9632_BUZZER)
|
||||
#include <stdint.h>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ PrinterEventLEDs printerEventLEDs;
|
|||
|
||||
inline void pel_set_rgb(const uint8_t r, const uint8_t g, const uint8_t b OPTARG(HAS_WHITE_LED, const uint8_t w=0)) {
|
||||
leds.set_color(
|
||||
LEDColor(r, g, b OPTARG(HAS_WHITE_LED, w) OPTARG(NEOPIXEL_LED, neo.brightness()))
|
||||
LED1Color_t(r, g, b OPTARG(HAS_WHITE_LED, w) OPTARG(NEOPIXEL_LED, neo.brightness()))
|
||||
OPTARG(NEOPIXEL_IS_SEQUENTIAL, true)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,23 +40,23 @@ private:
|
|||
|
||||
public:
|
||||
#if HAS_TEMP_HOTEND
|
||||
static LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); }
|
||||
static LED1Color_t onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); }
|
||||
static void onHotendHeating(const celsius_t start, const celsius_t current, const celsius_t target);
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_BED
|
||||
static LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); }
|
||||
static LED1Color_t onBedHeatingStart() { old_intensity = 127; return leds.get_color(); }
|
||||
static void onBedHeating(const celsius_t start, const celsius_t current, const celsius_t target);
|
||||
#endif
|
||||
|
||||
#if HAS_HEATED_CHAMBER
|
||||
static LEDColor onChamberHeatingStart() { old_intensity = 127; return leds.get_color(); }
|
||||
static LED1Color_t onChamberHeatingStart() { old_intensity = 127; return leds.get_color(); }
|
||||
static void onChamberHeating(const celsius_t start, const celsius_t current, const celsius_t target);
|
||||
#endif
|
||||
|
||||
#if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER
|
||||
static void onHeatingDone() { leds.set_white(); }
|
||||
static void onPIDTuningDone(LEDColor c) { leds.set_color(c); }
|
||||
static void onPIDTuningDone(LED1Color_t c) { leds.set_color(c); }
|
||||
#endif
|
||||
|
||||
#if HAS_MEDIA
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ void Max7219::set(const uint8_t line, const uint8_t bits) {
|
|||
}
|
||||
|
||||
// Draw a float with a decimal point and optional digits
|
||||
void Max7219::print(const uint8_t start, const_float_t value, const uint8_t pre_size, const uint8_t post_size, const bool leadzero=false) {
|
||||
void Max7219::print(const uint8_t start, const float value, const uint8_t pre_size, const uint8_t post_size, const bool leadzero=false) {
|
||||
if (pre_size) print(start, value, pre_size, leadzero, !!post_size);
|
||||
if (post_size) {
|
||||
const int16_t after = ABS(value) * (10 ^ post_size);
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ public:
|
|||
// Draw an integer with optional leading zeros and optional decimal point
|
||||
void print(const uint8_t start, int16_t value, uint8_t size, const bool leadzero=false, bool dec=false);
|
||||
// Draw a float with a decimal point and optional digits
|
||||
void print(const uint8_t start, const_float_t value, const uint8_t pre_size, const uint8_t post_size, const bool leadzero=false);
|
||||
void print(const uint8_t start, const float value, const uint8_t pre_size, const uint8_t post_size, const bool leadzero=false);
|
||||
#endif
|
||||
|
||||
// Set a single LED by XY coordinate
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ void Mixer::refresh_collector(const float proportion/*=1.0*/, const uint8_t t/*=
|
|||
|
||||
float Mixer::prev_z; // = 0
|
||||
|
||||
void Mixer::update_gradient_for_z(const_float_t z) {
|
||||
void Mixer::update_gradient_for_z(const float z) {
|
||||
if (z == prev_z) return;
|
||||
prev_z = z;
|
||||
|
||||
|
|
|
|||
|
|
@ -174,9 +174,9 @@ class Mixer {
|
|||
static float prev_z;
|
||||
|
||||
// Update the current mix from the gradient for a given Z
|
||||
static void update_gradient_for_z(const_float_t z);
|
||||
static void update_gradient_for_z(const float z);
|
||||
static void update_gradient_for_planner_z();
|
||||
static void gradient_control(const_float_t z) {
|
||||
static void gradient_control(const float z) {
|
||||
if (gradient.enabled) {
|
||||
if (z >= gradient.end_z)
|
||||
T(gradient.end_vtool);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
Startup sequence
|
||||
================
|
||||
# Startup sequence
|
||||
|
||||
When initialized, MMU sends
|
||||
|
||||
|
|
@ -20,18 +19,17 @@ We follow with
|
|||
#endif
|
||||
|
||||
- MMU <= 'P0\n'
|
||||
- MMU => '*FINDA status*\n'
|
||||
- MMU => '_FINDA status_\n'
|
||||
|
||||
Now we are sure MMU is available and ready. If there was a timeout or other communication problem somewhere, printer will be killed.
|
||||
|
||||
- *Firmware version* is an integer value, but we don't care about it
|
||||
- *Build number* is an integer value and has to be >=126, or =>132 if 12V mode is enabled
|
||||
- *FINDA status* is 1 if the filament is loaded to the extruder, 0 otherwise
|
||||
- _Firmware version_ is an integer value, but we don't care about it
|
||||
- _Build number_ is an integer value and has to be >=126, or =>132 if 12V mode is enabled
|
||||
- _FINDA status_ is 1 if the filament is loaded to the extruder, 0 otherwise
|
||||
|
||||
*Build number* is checked against the required value, if it does not match, printer is halted.
|
||||
_Build number_ is checked against the required value, if it does not match, printer is halted.
|
||||
|
||||
Toolchange
|
||||
==========
|
||||
# Toolchange
|
||||
|
||||
- MMU <= 'T*Filament index*\n'
|
||||
|
||||
|
|
@ -51,16 +49,14 @@ When done, the MMU sends
|
|||
We don't wait for a response here but immediately continue with the next G-code which should
|
||||
be one or more extruder moves to feed the filament into the hotend.
|
||||
|
||||
FINDA status
|
||||
============
|
||||
# FINDA status
|
||||
|
||||
- MMU <= 'P0\n'
|
||||
- MMU => '*FINDA status*\n'
|
||||
- MMU => '_FINDA status_\n'
|
||||
|
||||
*FINDA status* is 1 if the is filament loaded to the extruder, 0 otherwise. This could be used as filament runout sensor if probed regularly.
|
||||
_FINDA status_ is 1 if the is filament loaded to the extruder, 0 otherwise. This could be used as filament runout sensor if probed regularly.
|
||||
|
||||
Load filament
|
||||
=============
|
||||
# Load filament
|
||||
|
||||
- MMU <= 'L*Filament index*\n'
|
||||
|
||||
|
|
@ -68,8 +64,7 @@ MMU will feed filament down to the extruder, when done
|
|||
|
||||
- MMU => 'ok\n'
|
||||
|
||||
Unload filament
|
||||
=============
|
||||
# Unload filament
|
||||
|
||||
- MMU <= 'U0\n'
|
||||
|
||||
|
|
@ -77,8 +72,7 @@ MMU will retract current filament from the extruder, when done
|
|||
|
||||
- MMU => 'ok\n'
|
||||
|
||||
Eject filament
|
||||
==============
|
||||
# Eject filament
|
||||
|
||||
- MMU <= 'E*Filament index*\n'
|
||||
- MMU => 'ok\n'
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ struct E_Step {
|
|||
feedRate_t feedRate; //!< feed rate in mm/s
|
||||
};
|
||||
|
||||
inline void unscaled_mmu2_e_move(const float &dist, const feedRate_t fr_mm_s, const bool sync=true) {
|
||||
inline void unscaled_mmu2_e_move(const float dist, const feedRate_t fr_mm_s, const bool sync=true) {
|
||||
current_position.e += dist / planner.e_factor[active_extruder];
|
||||
line_to_current_position(fr_mm_s);
|
||||
if (sync) planner.synchronize();
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ This set of responses combines to indicate firmware version 3.0.2.
|
|||
## Startup sequence
|
||||
|
||||
When initialized the MMU waits for requests. Marlin repeatedly sends `S0` commands until it gets an answer:
|
||||
|
||||
```
|
||||
MMU3:>S0*c6\n
|
||||
MMU3:>S0*c6\n
|
||||
|
|
@ -36,11 +37,13 @@ MMU3:>S0*c6\n
|
|||
```
|
||||
|
||||
Once communication is established the MMU responds with:
|
||||
|
||||
```
|
||||
MMU3:<S0 A3*22\n
|
||||
```
|
||||
|
||||
Then Marlin continues to get the rest of the MMU firmware version.
|
||||
|
||||
```
|
||||
MMU3:>S1*ad\n
|
||||
MMU3:<S1 A0*34\n
|
||||
|
|
@ -49,6 +52,7 @@ MMU3:<S2 A2*65\n
|
|||
```
|
||||
|
||||
Setting the stepper mode to SpreadCycle (M0) or StealthChop (M1):
|
||||
|
||||
```
|
||||
MMU3:>M1*{CRC8};
|
||||
MMU3:<---nothing---
|
||||
|
|
@ -61,10 +65,10 @@ MMU3:<P0 A{FINDA status}*{CRC8}\n
|
|||
|
||||
At this point we can be sure the MMU is available and ready. If there was a timeout or other communication problem somewhere, the printer will not be killed, but for safety the MMU feature will be disabled.
|
||||
|
||||
- *Firmware version* is an integer value, and we care about it. As there is no other way of knowing which protocol to use.
|
||||
- *FINDA status* is 1 if the filament is loaded to the extruder, 0 otherwise.
|
||||
- _Firmware version_ is an integer value, and we care about it. As there is no other way of knowing which protocol to use.
|
||||
- _FINDA status_ is 1 if the filament is loaded to the extruder, 0 otherwise.
|
||||
|
||||
The *Firmware version* is checked against the required value. If it doesn't match the printer will not be halted, but for safety the MMU feature will be disabled.
|
||||
The _Firmware version_ is checked against the required value. If it doesn't match the printer will not be halted, but for safety the MMU feature will be disabled.
|
||||
|
||||
## Toolchange
|
||||
|
||||
|
|
@ -74,11 +78,13 @@ MMU3:<Q0*ea\n
|
|||
```
|
||||
|
||||
The MMU sends:
|
||||
|
||||
```
|
||||
MMU3:<T{filament index}*P{ProgressCode}{CRC8}\n
|
||||
```
|
||||
|
||||
Which in normal operation would be as follows, let's say that we requested MMU to load `T0``:
|
||||
|
||||
```
|
||||
MMU3:>T0*{CRC8}\n
|
||||
|
||||
|
|
@ -96,6 +102,7 @@ MMU3:>C0*{CRC8}\n
|
|||
```
|
||||
|
||||
The MMU will feed a few more millimeters of filament for the extruder gears to grab. When done, the MMU sends:
|
||||
|
||||
```
|
||||
MMU3:>Q0*{CRC8}\n
|
||||
MMU3:<T0*P9{CRC8}\n # P9 => FinishingMoves
|
||||
|
|
@ -103,18 +110,20 @@ MMU3:<T0*P9{CRC8}\n # P9 => FinishingMoves
|
|||
|
||||
After the `T0*P9` response we immediately continue with the next G-code which should be one or more extruder moves to feed the filament into the hotend.
|
||||
|
||||
|
||||
## FINDA status
|
||||
|
||||
```
|
||||
MMU3:>P0*{CRC8}\n
|
||||
```
|
||||
|
||||
If the filament is loaded to the extruder, FINDA status is 1 and the MMU responds with:
|
||||
|
||||
```
|
||||
MMU3:<P0 A1*{CRC8}\n
|
||||
```
|
||||
|
||||
…otherwise it replies:
|
||||
|
||||
```
|
||||
MMU3:<P0 A0*7b\n
|
||||
```
|
||||
|
|
@ -124,22 +133,26 @@ This could be used as a filament runout sensor if polled regularly.
|
|||
## Load filament
|
||||
|
||||
To load a filament to the MMU itself, we run:
|
||||
|
||||
```
|
||||
MMU3:>L{Filament index}*{CRC8}\n
|
||||
MMU3:<L{Filament index} A1*{CRC8}\n
|
||||
```
|
||||
|
||||
…and immediately after that we query the status:
|
||||
|
||||
```
|
||||
MMU3:>Q0*{CRC8}\n
|
||||
```
|
||||
|
||||
The MMU will respond with status messages:
|
||||
|
||||
```
|
||||
MMU3:<L0*P5{CRC8}\n
|
||||
```
|
||||
|
||||
The MMU will load the filament and when done:
|
||||
|
||||
```
|
||||
MMU3:>Q0*{CRC8}\n
|
||||
MMU3:<L0*P9{CRC8}\n
|
||||
|
|
|
|||
|
|
@ -1162,7 +1162,7 @@ namespace MMU3 {
|
|||
//
|
||||
// Instead of doing a very long extrude as in PrusaFirmware,
|
||||
// Marlin's own MMU2s code has a better approach to this by spinning
|
||||
// the extruder indefinitelly...
|
||||
// the extruder indefinitely...
|
||||
//
|
||||
// this ensures that while the MMU is pushing the filament,
|
||||
// the extruder will keep rotating, preventing the filament to hit
|
||||
|
|
|
|||
|
|
@ -115,12 +115,12 @@
|
|||
void powerOn();
|
||||
|
||||
// Read from a MMU register (See gcode M707)
|
||||
// @param address Address of register in hexidecimal
|
||||
// @param address Address of register in hexadecimal
|
||||
// @return true upon success
|
||||
bool readRegister(uint8_t address);
|
||||
|
||||
// Write from a MMU register (See gcode M708)
|
||||
// @param address Address of register in hexidecimal
|
||||
// @param address Address of register in hexadecimal
|
||||
// @param data Data to write to register
|
||||
// @return true upon success
|
||||
bool writeRegister(uint8_t address, uint16_t data);
|
||||
|
|
@ -204,7 +204,7 @@
|
|||
ErrorCode getLastErrorCode() const { return lastErrorCode; }
|
||||
|
||||
// @return the version of the connected MMU FW.
|
||||
// In the future we'll return the trully detected FW version
|
||||
// In the future we'll return the truly detected FW version
|
||||
Version getMMUFWVersion() const {
|
||||
if (state() == xState::Active) {
|
||||
return { logic.mmuFwVersionMajor(), logic.mmuFwVersionMinor(), logic.mmuFwVersionRevision() };
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ namespace MMU3 {
|
|||
return (i != errorCodesEnd) ? (i - errorCodes) : (errorCodesSize - 1);
|
||||
}
|
||||
|
||||
// check that the searching algoritm works
|
||||
// check that the searching algorithm works
|
||||
// static_assert( FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER) == 0);
|
||||
// static_assert( FindErrorIndex(ERR_MECHANICAL_FINDA_FILAMENT_STUCK) == 1);
|
||||
// static_assert( FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER) == 2);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
namespace MMU3 {
|
||||
|
||||
// Can be used to block printer's filament sensor handling - to avoid errorneous injecting of M600
|
||||
// Can be used to block printer's filament sensor handling - to avoid erroneous injecting of M600
|
||||
// while doing a toolchange with the MMU
|
||||
// In case of "no filament sensor" these methods default to an empty implementation
|
||||
class FSensorBlockRunout {
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ namespace MMU3 {
|
|||
// - Unify implementation among MK3 and Buddy FW
|
||||
// - Enable unit testing of MMU top layer
|
||||
|
||||
void extruder_move(const_float_t distance, const_float_t feedRate_mm_s, const bool sync=true);
|
||||
void extruder_schedule_turning(const_float_t feedRate_mm_s);
|
||||
void extruder_move(const float distance, const float feedRate_mm_s, const bool sync=true);
|
||||
void extruder_schedule_turning(const float feedRate_mm_s);
|
||||
|
||||
float move_raise_z(const_float_t delta);
|
||||
float move_raise_z(const float delta);
|
||||
|
||||
void planner_abort_queued_moves();
|
||||
void planner_synchronize();
|
||||
|
|
|
|||
|
|
@ -49,13 +49,13 @@ namespace MMU3 {
|
|||
planner_synchronize();
|
||||
}
|
||||
|
||||
void extruder_move(const_float_t delta, const_float_t feedRate_mm_s, const bool sync/*=true*/) {
|
||||
void extruder_move(const float delta, const float feedRate_mm_s, const bool sync/*=true*/) {
|
||||
current_position.e += delta / planner.e_factor[active_extruder];
|
||||
planner_line_to_current_position(feedRate_mm_s);
|
||||
if (sync) planner.synchronize();
|
||||
}
|
||||
|
||||
float move_raise_z(const_float_t delta) {
|
||||
float move_raise_z(const float delta) {
|
||||
//return raise_z(delta);
|
||||
xyze_pos_t current_position_before = current_position;
|
||||
do_z_clearance_by(delta);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ namespace protocol {
|
|||
|
||||
// A response message - responses are being sent from the MMU into the printer as a response to a request message.
|
||||
struct ResponseMsg {
|
||||
RequestMsg request; //!< response is always preceeded by the request message
|
||||
RequestMsg request; //!< response is always preceded by the request message
|
||||
ResponseMsgParamCodes paramCode; //!< code of the parameter
|
||||
uint16_t paramValue; //!< value of the parameter
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ namespace protocol {
|
|||
|
||||
// Protocol class is responsible for creating/decoding messages in Rx/Tx buffer
|
||||
//
|
||||
// Beware - in the decoding more, it is meant to be a statefull instance which works through public methods
|
||||
// Beware - in the decoding more, it is meant to be a stateful instance which works through public methods
|
||||
// processing one input byte per call.
|
||||
class Protocol {
|
||||
public:
|
||||
|
|
@ -186,11 +186,11 @@ namespace protocol {
|
|||
static uint8_t EncodeWriteRequest(uint8_t address, uint16_t value, uint8_t *txbuff);
|
||||
|
||||
// @return the maximum byte length necessary to encode a request message
|
||||
// Beneficial in case of pre-allocating a buffer for enconding a RequestMsg.
|
||||
// Beneficial in case of pre-allocating a buffer for encoding a RequestMsg.
|
||||
static constexpr uint8_t MaxRequestSize() { return 13; }
|
||||
|
||||
// @return the maximum byte length necessary to encode a response message
|
||||
// Beneficial in case of pre-allocating a buffer for enconding a ResponseMsg.
|
||||
// Beneficial in case of pre-allocating a buffer for encoding a ResponseMsg.
|
||||
static constexpr uint8_t MaxResponseSize() { return 14; }
|
||||
|
||||
// Encode generic response Command Accepted or Rejected
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ namespace MMU3 {
|
|||
|
||||
const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec);
|
||||
|
||||
// This should be the equivelent of the switch..case above...
|
||||
// This should be the equivalent of the switch..case above...
|
||||
if ((uint8_t)ReportErrorHookState == (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN) {
|
||||
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||
#if HAS_WIRED_LCD
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
* therefore the error codes have been extracted to one place.
|
||||
*
|
||||
* Please note the errors are intentionally coded as "negative" values (highest bit set),
|
||||
* becase they are a complement to reporting the state of the high-level state machines -
|
||||
* because they are a complement to reporting the state of the high-level state machines -
|
||||
* positive values are considered as normal progress, negative values are errors.
|
||||
*
|
||||
* Please note, that multiple TMC errors can occur at once, thus they are defined as a bitmask of the higher byte.
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ typedef enum : uint16_t {
|
|||
} err_num_t;
|
||||
|
||||
// Avr gcc has serious trouble understanding static data structures in PROGMEM
|
||||
// and inadvertedly falls back to copying the whole structure into RAM (which is obviously unwanted).
|
||||
// and inadvertently falls back to copying the whole structure into RAM (which is obviously unwanted).
|
||||
// But since this file ought to be generated in the future from yaml prescription,
|
||||
// it really makes no difference if there are "nice" data structures or plain arrays.
|
||||
static const constexpr err_num_t errorCodes[] PROGMEM = {
|
||||
|
|
|
|||
|
|
@ -188,10 +188,8 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P
|
|||
*
|
||||
* Returns 'true' if load was completed, 'false' for abort
|
||||
*/
|
||||
bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load_length/*=0*/, const_float_t purge_length/*=0*/, const int8_t max_beep_count/*=0*/,
|
||||
const bool show_lcd/*=false*/, const bool pause_for_user/*=false*/,
|
||||
const PauseMode mode/*=PAUSE_MODE_PAUSE_PRINT*/
|
||||
DXC_ARGS
|
||||
bool load_filament(const float slow_load_length/*=0*/, const float fast_load_length/*=0*/, const float purge_length/*=0*/, const int8_t max_beep_count/*=0*/,
|
||||
const bool show_lcd/*=false*/, const bool pause_for_user/*=false*/, const PauseMode mode/*=PAUSE_MODE_PAUSE_PRINT*/ DXC_ARGS
|
||||
) {
|
||||
DEBUG_SECTION(lf, "load_filament", true);
|
||||
DEBUG_ECHOLNPGM("... slowlen:", slow_load_length, " fastlen:", fast_load_length, " purgelen:", purge_length, " maxbeep:", max_beep_count, " showlcd:", show_lcd, " pauseforuser:", pause_for_user, " pausemode:", mode DXC_SAY);
|
||||
|
|
@ -344,10 +342,10 @@ inline void disable_active_extruder() {
|
|||
*
|
||||
* Returns 'true' if unload was completed, 'false' for abort
|
||||
*/
|
||||
bool unload_filament(const_float_t unload_length, const bool show_lcd/*=false*/,
|
||||
bool unload_filament(const float unload_length, const bool show_lcd/*=false*/,
|
||||
const PauseMode mode/*=PAUSE_MODE_PAUSE_PRINT*/
|
||||
#if ALL(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER)
|
||||
, const_float_t mix_multiplier/*=1.0*/
|
||||
, const float mix_multiplier/*=1.0*/
|
||||
#endif
|
||||
) {
|
||||
DEBUG_SECTION(uf, "unload_filament", true);
|
||||
|
|
@ -418,7 +416,7 @@ bool unload_filament(const_float_t unload_length, const bool show_lcd/*=false*/,
|
|||
*/
|
||||
uint8_t did_pause_print = 0;
|
||||
|
||||
bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool show_lcd/*=false*/, const_float_t unload_length/*=0*/ DXC_ARGS) {
|
||||
bool pause_print(const float retract, const xyz_pos_t &park_point, const bool show_lcd/*=false*/, const float unload_length/*=0*/ DXC_ARGS) {
|
||||
DEBUG_SECTION(pp, "pause_print", true);
|
||||
DEBUG_ECHOLNPGM("... park.x:", park_point.x, " y:", park_point.y, " z:", park_point.z, " unloadlen:", unload_length, " showlcd:", show_lcd DXC_SAY);
|
||||
|
||||
|
|
@ -639,9 +637,9 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
|
|||
* - Resume the current SD print job, if any
|
||||
*/
|
||||
void resume_print(
|
||||
const_float_t slow_load_length/*=0*/,
|
||||
const_float_t fast_load_length/*=0*/,
|
||||
const_float_t purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/,
|
||||
const float slow_load_length/*=0*/,
|
||||
const float fast_load_length/*=0*/,
|
||||
const float purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/,
|
||||
const int8_t max_beep_count/*=0*/,
|
||||
const celsius_t targetTemp/*=0*/,
|
||||
const bool show_lcd/*=true*/,
|
||||
|
|
|
|||
|
|
@ -91,10 +91,10 @@ extern uint8_t did_pause_print;
|
|||
|
||||
// Pause the print. If unload_length is set, do a Filament Unload
|
||||
bool pause_print(
|
||||
const_float_t retract, // (mm) Retraction length
|
||||
const float retract, // (mm) Retraction length
|
||||
const xyz_pos_t &park_point, // Parking XY Position and Z Raise
|
||||
const bool show_lcd=false, // Set LCD status messages?
|
||||
const_float_t unload_length=0 // (mm) Filament Change Unload Length - 0 to skip
|
||||
const float unload_length=0 // (mm) Filament Change Unload Length - 0 to skip
|
||||
DXC_PARAMS // Dual-X-Carriage extruder index
|
||||
);
|
||||
|
||||
|
|
@ -105,9 +105,9 @@ void wait_for_confirmation(
|
|||
);
|
||||
|
||||
void resume_print(
|
||||
const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move
|
||||
const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move
|
||||
const_float_t purge_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length
|
||||
const float slow_load_length=0, // (mm) Slow Load Length for finishing move
|
||||
const float fast_load_length=0, // (mm) Fast Load Length for initial move
|
||||
const float purge_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length
|
||||
const int8_t max_beep_count=0, // Beep alert for attention
|
||||
const celsius_t targetTemp=0, // (°C) A target temperature for the hotend
|
||||
const bool show_lcd=true, // Set LCD status messages?
|
||||
|
|
@ -116,9 +116,9 @@ void resume_print(
|
|||
);
|
||||
|
||||
bool load_filament(
|
||||
const_float_t slow_load_length=0, // (mm) Slow Load Length for finishing move
|
||||
const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move
|
||||
const_float_t purge_length=0, // (mm) Purge length
|
||||
const float slow_load_length=0, // (mm) Slow Load Length for finishing move
|
||||
const float fast_load_length=0, // (mm) Fast Load Length for initial move
|
||||
const float purge_length=0, // (mm) Purge length
|
||||
const int8_t max_beep_count=0, // Beep alert for attention
|
||||
const bool show_lcd=false, // Set LCD status messages?
|
||||
const bool pause_for_user=false, // Pause for user before returning?
|
||||
|
|
@ -127,11 +127,11 @@ bool load_filament(
|
|||
);
|
||||
|
||||
bool unload_filament(
|
||||
const_float_t unload_length, // (mm) Filament Unload Length - 0 to skip
|
||||
const float unload_length, // (mm) Filament Unload Length - 0 to skip
|
||||
const bool show_lcd=false, // Set LCD status messages?
|
||||
const PauseMode mode=PAUSE_MODE_PAUSE_PRINT // Pause Mode to apply
|
||||
#if ALL(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER)
|
||||
, const_float_t mix_multiplier=1.0f // Extrusion multiplier (for a Mixing Extruder)
|
||||
, const float mix_multiplier=1.0f // Extrusion multiplier (for a Mixing Extruder)
|
||||
#endif
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW
|
|||
|
||||
#if ENABLED(BACKUP_POWER_SUPPLY)
|
||||
|
||||
void PrintJobRecovery::retract_and_lift(const_float_t zraise) {
|
||||
void PrintJobRecovery::retract_and_lift(const float zraise) {
|
||||
#if POWER_LOSS_RETRACT_LEN || POWER_LOSS_ZRAISE
|
||||
|
||||
gcode.set_relative_mode(true); // Use relative coordinates
|
||||
|
|
@ -485,7 +485,7 @@ void PrintJobRecovery::resume() {
|
|||
|
||||
#if !HOMING_Z_DOWN
|
||||
// The physical Z was adjusted at power-off so undo the M420S1 correction to Z with G92.9.
|
||||
PROCESS_SUBCOMMANDS_NOW(TS(F("G92.9Z"), p_float_t(z_now, 1)));
|
||||
PROCESS_SUBCOMMANDS_NOW(TS(F("G92.9Z"), p_float_t(z_now, 3)));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ class PrintJobRecovery {
|
|||
static void write();
|
||||
|
||||
#if ENABLED(BACKUP_POWER_SUPPLY)
|
||||
static void retract_and_lift(const_float_t zraise);
|
||||
static void retract_and_lift(const float zraise);
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(POWER_LOSS) || ENABLED(DEBUG_POWER_LOSS_RECOVERY)
|
||||
|
|
|
|||
|
|
@ -104,12 +104,12 @@ void ProbeTempComp::print_offsets() {
|
|||
#endif
|
||||
}
|
||||
|
||||
void ProbeTempComp::prepare_new_calibration(const_float_t init_meas_z) {
|
||||
void ProbeTempComp::prepare_new_calibration(const float init_meas_z) {
|
||||
calib_idx = 0;
|
||||
init_measurement = init_meas_z;
|
||||
}
|
||||
|
||||
void ProbeTempComp::push_back_new_measurement(const TempSensorID tsi, const_float_t meas_z) {
|
||||
void ProbeTempComp::push_back_new_measurement(const TempSensorID tsi, const float meas_z) {
|
||||
if (calib_idx >= cali_info[tsi].measurements) return;
|
||||
sensor_z_offsets[tsi][calib_idx++] = static_cast<int16_t>((meas_z - init_measurement) * 1000.0f);
|
||||
}
|
||||
|
|
@ -186,7 +186,7 @@ void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const celsius
|
|||
};
|
||||
|
||||
// Interpolate Z based on a temperature being within a given range
|
||||
auto linear_interp = [](const_float_t x, xy_float_t p1, xy_float_t p2) {
|
||||
auto linear_interp = [](const float x, xy_float_t p1, xy_float_t p2) {
|
||||
// zoffs1 + zoffset_per_toffset * toffset
|
||||
return p1.y + (p2.y - p1.y) / (p2.x - p1.x) * (x - p1.x);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ class ProbeTempComp {
|
|||
}
|
||||
static bool set_offset(const TempSensorID tsi, const uint8_t idx, const int16_t offset);
|
||||
static void print_offsets();
|
||||
static void prepare_new_calibration(const_float_t init_meas_z);
|
||||
static void push_back_new_measurement(const TempSensorID tsi, const_float_t meas_z);
|
||||
static void prepare_new_calibration(const float init_meas_z);
|
||||
static void push_back_new_measurement(const TempSensorID tsi, const float meas_z);
|
||||
static bool finish_calibration(const TempSensorID tsi);
|
||||
static void set_enabled(const bool ena) { enabled = ena; }
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ bool FilamentMonitorBase::enabled = true,
|
|||
#if ENABLED(FILAMENT_MOTION_SENSOR)
|
||||
uint8_t FilamentSensorEncoder::motion_detected;
|
||||
#endif
|
||||
|
||||
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
|
||||
bool RunoutResponseDelayed::ignore_motion = false;
|
||||
float RunoutResponseDelayed::motion_distance_mm = FILAMENT_MOTION_DISTANCE_MM;
|
||||
|
|
|
|||
|
|
@ -123,12 +123,12 @@ class TFilamentMonitor : public FilamentMonitorBase {
|
|||
response.filament_motion_present(extruder);
|
||||
}
|
||||
static float& motion_distance() { return response.motion_distance_mm; }
|
||||
static void set_motion_distance(const_float_t mm) { response.motion_distance_mm = mm; }
|
||||
static void set_motion_distance(const float mm) { response.motion_distance_mm = mm; }
|
||||
#endif
|
||||
|
||||
#if HAS_FILAMENT_RUNOUT_DISTANCE
|
||||
static float& runout_distance() { return response.runout_distance_mm; }
|
||||
static void set_runout_distance(const_float_t mm) { response.runout_distance_mm = mm; }
|
||||
static void set_runout_distance(const float mm) { response.runout_distance_mm = mm; }
|
||||
#endif
|
||||
|
||||
// Handle a block completion. RunoutResponseDelayed uses this to
|
||||
|
|
@ -143,38 +143,37 @@ class TFilamentMonitor : public FilamentMonitorBase {
|
|||
|
||||
// Give the response a chance to update its counter.
|
||||
static void run() {
|
||||
if (enabled && !filament_ran_out && should_monitor_runout()) {
|
||||
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, cli()); // Prevent RunoutResponseDelayed::block_completed from accumulating here
|
||||
response.run();
|
||||
sensor.run();
|
||||
const runout_flags_t runout_flags = response.has_run_out();
|
||||
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, sei());
|
||||
#if MULTI_FILAMENT_SENSOR
|
||||
#if ENABLED(WATCH_ALL_RUNOUT_SENSORS)
|
||||
const bool ran_out = bool(runout_flags); // any sensor triggers
|
||||
uint8_t extruder = 0;
|
||||
if (ran_out) while (!runout_flags.test(extruder)) extruder++;
|
||||
#else
|
||||
const bool ran_out = runout_flags[active_extruder]; // suppress non active extruders
|
||||
uint8_t extruder = active_extruder;
|
||||
#endif
|
||||
if (!enabled || filament_ran_out || !should_monitor_runout()) return;
|
||||
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, cli()); // Prevent RunoutResponseDelayed::block_completed from accumulating here
|
||||
response.run();
|
||||
sensor.run();
|
||||
const runout_flags_t runout_flags = response.has_run_out();
|
||||
TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, sei());
|
||||
#if MULTI_FILAMENT_SENSOR
|
||||
#if ENABLED(WATCH_ALL_RUNOUT_SENSORS)
|
||||
const bool ran_out = bool(runout_flags); // any sensor triggers
|
||||
uint8_t extruder = 0;
|
||||
if (ran_out) while (!runout_flags.test(extruder)) extruder++;
|
||||
#else
|
||||
const bool ran_out = bool(runout_flags);
|
||||
const bool ran_out = runout_flags[active_extruder]; // suppress non active extruders
|
||||
uint8_t extruder = active_extruder;
|
||||
#endif
|
||||
#else
|
||||
const bool ran_out = bool(runout_flags);
|
||||
uint8_t extruder = active_extruder;
|
||||
#endif
|
||||
|
||||
if (ran_out) {
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
|
||||
SERIAL_ECHOPGM("Runout Sensors: ");
|
||||
for (uint8_t i = 0; i < 8; ++i) SERIAL_CHAR('0' + char(runout_flags[i]));
|
||||
SERIAL_ECHOLNPGM(" -> ", extruder, " RUN OUT");
|
||||
#endif
|
||||
if (!ran_out) return;
|
||||
|
||||
filament_ran_out = true;
|
||||
event_filament_runout(extruder);
|
||||
planner.synchronize();
|
||||
}
|
||||
}
|
||||
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
|
||||
SERIAL_ECHOPGM("Runout Sensors: ");
|
||||
for (uint8_t i = 0; i < 8; ++i) SERIAL_CHAR('0' + char(runout_flags[i]));
|
||||
SERIAL_ECHOLNPGM(" -> ", extruder, " RUN OUT");
|
||||
#endif
|
||||
|
||||
filament_ran_out = true;
|
||||
event_filament_runout(extruder);
|
||||
planner.synchronize();
|
||||
}
|
||||
|
||||
// Reset after a filament runout or upon resuming a job
|
||||
|
|
@ -376,7 +375,9 @@ class FilamentSensorBase {
|
|||
class RunoutResponseDelayed {
|
||||
private:
|
||||
static countdown_t mm_countdown;
|
||||
static bool ignore_motion; // Flag to ignore the encoder
|
||||
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
|
||||
static bool ignore_motion; // Flag to ignore the encoder
|
||||
#endif
|
||||
|
||||
public:
|
||||
static float runout_distance_mm;
|
||||
|
|
@ -385,13 +386,17 @@ class FilamentSensorBase {
|
|||
static float motion_distance_mm;
|
||||
#endif
|
||||
|
||||
static void set_ignore_motion(const bool ignore=true) { ignore_motion = ignore; }
|
||||
static void set_ignore_motion(const bool ignore=true) {
|
||||
UNUSED(ignore);
|
||||
TERN_(FILAMENT_SWITCH_AND_MOTION, ignore_motion = ignore);
|
||||
}
|
||||
|
||||
static void reset() {
|
||||
for (uint8_t i = 0; i < NUM_RUNOUT_SENSORS; ++i) filament_present(i);
|
||||
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
|
||||
for (uint8_t i = 0; i < NUM_MOTION_SENSORS; ++i) filament_motion_present(i);
|
||||
#endif
|
||||
set_ignore_motion(false);
|
||||
}
|
||||
|
||||
static void run() {
|
||||
|
|
@ -413,13 +418,24 @@ class FilamentSensorBase {
|
|||
// Get runout status for all presence sensors and motion sensors
|
||||
static runout_flags_t has_run_out() {
|
||||
runout_flags_t runout_flags{0};
|
||||
// Runout based on filament presence
|
||||
for (uint8_t i = 0; i < NUM_RUNOUT_SENSORS; ++i) if (mm_countdown.runout[i] < 0) runout_flags.set(i);
|
||||
// Runout based on filament motion
|
||||
|
||||
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
|
||||
if (!ignore_motion)
|
||||
for (uint8_t i = 0; i < NUM_MOTION_SENSORS; ++i) if (mm_countdown.motion[i] < 0) runout_flags.set(i);
|
||||
// Runout based on filament motion
|
||||
if (!ignore_motion) {
|
||||
for (uint8_t i = 0; i < NUM_MOTION_SENSORS; ++i) {
|
||||
if (mm_countdown.motion[i] < 0) {
|
||||
runout_flags.set(i);
|
||||
mm_countdown.runout[i] = -1; // For a filament jam don't wait for runout_distance_mm!
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Runout based on filament presence
|
||||
for (uint8_t i = 0; i < NUM_RUNOUT_SENSORS; ++i)
|
||||
if (mm_countdown.runout[i] < 0)
|
||||
runout_flags.set(i);
|
||||
|
||||
return runout_flags;
|
||||
}
|
||||
|
||||
|
|
@ -471,8 +487,8 @@ class FilamentSensorBase {
|
|||
if (mm_countdown.runout_reset[e]) filament_present(e); // Reset pending. Try to reset.
|
||||
}
|
||||
|
||||
// Apply E distance to motion countdown, reset if flagged
|
||||
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
|
||||
// Apply E distance to motion countdown, reset if flagged
|
||||
if (!ignore_motion && e < NUM_MOTION_SENSORS) {
|
||||
mm_countdown.motion[e] -= mm;
|
||||
if (mm_countdown.motion_reset[e]) filament_motion_present(e); // Reset pending. Try to reset.
|
||||
|
|
@ -484,7 +500,7 @@ class FilamentSensorBase {
|
|||
static void init_for_restart(const bool onoff=true) {
|
||||
UNUSED(onoff);
|
||||
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
|
||||
reset();
|
||||
reset(); // also calls set_ignore_motion(false)
|
||||
set_ignore_motion(!onoff);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class SpindleLaser {
|
|||
public:
|
||||
static CutterMode cutter_mode;
|
||||
|
||||
static constexpr uint8_t pct_to_ocr(const_float_t pct) { return uint8_t(PCT_TO_PWM(pct)); }
|
||||
static constexpr uint8_t pct_to_ocr(const float pct) { return uint8_t(PCT_TO_PWM(pct)); }
|
||||
|
||||
// cpower = configured values (e.g., SPEED_POWER_MAX)
|
||||
// Convert configured power range to a percentage
|
||||
|
|
|
|||
|
|
@ -89,7 +89,9 @@
|
|||
|
||||
#if HAS_TMCX1X0
|
||||
|
||||
static uint32_t get_pwm_scale(TMC2130Stepper &st) { return st.PWM_SCALE(); }
|
||||
#if ENABLED(TMC_DEBUG)
|
||||
static uint32_t get_pwm_scale(TMC2130Stepper &st) { return st.PWM_SCALE(); }
|
||||
#endif
|
||||
|
||||
static TMC_driver_data get_driver_data(TMC2130Stepper &st) {
|
||||
constexpr uint8_t OT_bp = 25, OTPW_bp = 26;
|
||||
|
|
@ -148,7 +150,9 @@
|
|||
|
||||
#if HAS_DRIVER(TMC2240)
|
||||
|
||||
static uint32_t get_pwm_scale(TMC2240Stepper &st) { return st.PWM_SCALE(); }
|
||||
#if ENABLED(TMC_DEBUG)
|
||||
static uint32_t get_pwm_scale(TMC2240Stepper &st) { return st.PWM_SCALE(); }
|
||||
#endif
|
||||
|
||||
static TMC_driver_data get_driver_data(TMC2240Stepper &st) {
|
||||
constexpr uint8_t OT_bp = 25, OTPW_bp = 26;
|
||||
|
|
@ -207,7 +211,9 @@
|
|||
|
||||
#if HAS_TMC220x
|
||||
|
||||
static uint32_t get_pwm_scale(TMC2208Stepper &st) { return st.pwm_scale_sum(); }
|
||||
#if ENABLED(TMC_DEBUG)
|
||||
static uint32_t get_pwm_scale(TMC2208Stepper &st) { return st.pwm_scale_sum(); }
|
||||
#endif
|
||||
|
||||
static TMC_driver_data get_driver_data(TMC2208Stepper &st) {
|
||||
constexpr uint8_t OTPW_bp = 0, OT_bp = 1;
|
||||
|
|
@ -242,7 +248,9 @@
|
|||
|
||||
#if HAS_DRIVER(TMC2660)
|
||||
|
||||
static uint32_t get_pwm_scale(TMC2660Stepper) { return 0; }
|
||||
#if ENABLED(TMC_DEBUG)
|
||||
static uint32_t get_pwm_scale(TMC2660Stepper) { return 0; }
|
||||
#endif
|
||||
|
||||
static TMC_driver_data get_driver_data(TMC2660Stepper &st) {
|
||||
constexpr uint8_t OT_bp = 1, OTPW_bp = 2;
|
||||
|
|
@ -1013,7 +1021,7 @@
|
|||
TMC_REPORT("Supply (v)", TMC_VSUPPLY);
|
||||
TMC_REPORT("Temp (°C)", TMC_TEMP);
|
||||
TMC_REPORT("OT pre warn (°C)", TMC_OVERTEMP);
|
||||
TMC_REPORT("OV theshold (v)", TMC_OVERVOLT_THD);
|
||||
TMC_REPORT("OV threshold (v)", TMC_OVERVOLT_THD);
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ void XATC::print_points() {
|
|||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
float lerp(const_float_t t, const_float_t a, const_float_t b) { return a + t * (b - a); }
|
||||
float lerp(const float t, const float a, const float b) { return a + t * (b - a); }
|
||||
|
||||
float XATC::compensation(const xy_pos_t &raw) {
|
||||
if (!enabled) return 0;
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ float g26_random_deviation = 0.0;
|
|||
|
||||
#endif
|
||||
|
||||
void move_to(const_float_t rx, const_float_t ry, const_float_t z, const_float_t e_delta) {
|
||||
void move_to(const float rx, const float ry, const float z, const float e_delta) {
|
||||
static float last_z = -999.99;
|
||||
|
||||
const xy_pos_t dest = { rx, ry };
|
||||
|
|
@ -196,7 +196,7 @@ void move_to(const_float_t rx, const_float_t ry, const_float_t z, const_float_t
|
|||
prepare_internal_move_to_destination(fr_mm_s);
|
||||
}
|
||||
|
||||
void move_to(const xyz_pos_t &where, const_float_t de) { move_to(where.x, where.y, where.z, de); }
|
||||
void move_to(const xyz_pos_t &where, const float de) { move_to(where.x, where.y, where.z, de); }
|
||||
|
||||
typedef struct {
|
||||
float extrusion_multiplier = EXTRUSION_MULTIPLIER,
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ void ac_cleanup() {
|
|||
TERN_(HAS_BED_PROBE, probe.use_probing_tool(false));
|
||||
}
|
||||
|
||||
void print_signed_float(FSTR_P const prefix, const_float_t f) {
|
||||
void print_signed_float(FSTR_P const prefix, const float f) {
|
||||
SERIAL_ECHO(F(" "), prefix, C(':'));
|
||||
serial_offset(f);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ void GcodeSuite::G34() {
|
|||
msg.echoln();
|
||||
ui.set_status(msg);
|
||||
|
||||
auto decreasing_accuracy = [](const_float_t v1, const_float_t v2) {
|
||||
auto decreasing_accuracy = [](const float v1, const float v2) {
|
||||
if (v1 < v2 * 0.7f) {
|
||||
SERIAL_ECHOLNPGM("Decreasing Accuracy Detected.");
|
||||
LCD_MESSAGE(MSG_DECREASING_ACCURACY);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,9 @@
|
|||
|
||||
enum side_t : uint8_t {
|
||||
TOP, RIGHT, FRONT, LEFT, BACK, NUM_SIDES,
|
||||
LIST_N(DOUBLE(SECONDARY_AXES), IMINIMUM, IMAXIMUM, JMINIMUM, JMAXIMUM, KMINIMUM, KMAXIMUM, UMINIMUM, UMAXIMUM, VMINIMUM, VMAXIMUM, WMINIMUM, WMAXIMUM)
|
||||
LIST_N(DOUBLE(SECONDARY_AXES),
|
||||
IMINIMUM, IMAXIMUM, JMINIMUM, JMAXIMUM, KMINIMUM, KMAXIMUM,
|
||||
UMINIMUM, UMAXIMUM, VMINIMUM, VMAXIMUM, WMINIMUM, WMAXIMUM)
|
||||
};
|
||||
|
||||
static constexpr xyz_pos_t true_center CALIBRATION_OBJECT_CENTER;
|
||||
|
|
|
|||
|
|
@ -109,25 +109,26 @@ void GcodeSuite::M425_report(const bool forReplay/*=true*/) {
|
|||
TERN_(MARLIN_SMALL_BUILD, return);
|
||||
|
||||
report_heading_etc(forReplay, F(STR_BACKLASH_COMPENSATION));
|
||||
SERIAL_ECHOLNPGM_P(
|
||||
SERIAL_ECHOPGM_P(
|
||||
PSTR(" M425 F"), backlash.get_correction()
|
||||
#ifdef BACKLASH_SMOOTHING_MM
|
||||
, PSTR(" S"), LINEAR_UNIT(backlash.get_smoothing_mm())
|
||||
#endif
|
||||
#if NUM_AXES
|
||||
, LIST_N(DOUBLE(NUM_AXES),
|
||||
SP_X_STR, LINEAR_UNIT(backlash.get_distance_mm(X_AXIS)),
|
||||
SP_Y_STR, LINEAR_UNIT(backlash.get_distance_mm(Y_AXIS)),
|
||||
SP_Z_STR, LINEAR_UNIT(backlash.get_distance_mm(Z_AXIS)),
|
||||
SP_I_STR, I_AXIS_UNIT(backlash.get_distance_mm(I_AXIS)),
|
||||
SP_J_STR, J_AXIS_UNIT(backlash.get_distance_mm(J_AXIS)),
|
||||
SP_K_STR, K_AXIS_UNIT(backlash.get_distance_mm(K_AXIS)),
|
||||
SP_U_STR, U_AXIS_UNIT(backlash.get_distance_mm(U_AXIS)),
|
||||
SP_V_STR, V_AXIS_UNIT(backlash.get_distance_mm(V_AXIS)),
|
||||
SP_W_STR, W_AXIS_UNIT(backlash.get_distance_mm(W_AXIS))
|
||||
)
|
||||
#endif
|
||||
);
|
||||
#if NUM_AXES
|
||||
SERIAL_ECHOPGM_P(NUM_AXIS_PAIRED_LIST(
|
||||
SP_X_STR, LINEAR_UNIT(backlash.get_distance_mm(X_AXIS)),
|
||||
SP_Y_STR, LINEAR_UNIT(backlash.get_distance_mm(Y_AXIS)),
|
||||
SP_Z_STR, LINEAR_UNIT(backlash.get_distance_mm(Z_AXIS)),
|
||||
SP_I_STR, I_AXIS_UNIT(backlash.get_distance_mm(I_AXIS)),
|
||||
SP_J_STR, J_AXIS_UNIT(backlash.get_distance_mm(J_AXIS)),
|
||||
SP_K_STR, K_AXIS_UNIT(backlash.get_distance_mm(K_AXIS)),
|
||||
SP_U_STR, U_AXIS_UNIT(backlash.get_distance_mm(U_AXIS)),
|
||||
SP_V_STR, V_AXIS_UNIT(backlash.get_distance_mm(V_AXIS)),
|
||||
SP_W_STR, W_AXIS_UNIT(backlash.get_distance_mm(W_AXIS))
|
||||
));
|
||||
#endif
|
||||
SERIAL_EOL();
|
||||
}
|
||||
|
||||
#endif // BACKLASH_GCODE
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ void GcodeSuite::M48() {
|
|||
max = -99999.9, // Largest value sampled so far
|
||||
sample_set[n_samples]; // Storage for sampled values
|
||||
|
||||
auto dev_report = [](const bool verbose, const_float_t mean, const_float_t sigma, const_float_t min, const_float_t max, const bool final=false) {
|
||||
auto dev_report = [](const bool verbose, const float mean, const float sigma, const float min, const float max, const bool final=false) {
|
||||
if (verbose) {
|
||||
SERIAL_ECHOPGM("Mean: ", p_float_t(mean, 6));
|
||||
if (!final) SERIAL_ECHOPGM(" Sigma: ", p_float_t(sigma, 6));
|
||||
|
|
|
|||
|
|
@ -157,19 +157,17 @@ void GcodeSuite::M201_report(const bool forReplay/*=true*/) {
|
|||
|
||||
#if NUM_AXES
|
||||
eol = true;
|
||||
SERIAL_ECHOPGM_P(
|
||||
LIST_N(DOUBLE(NUM_AXES),
|
||||
PSTR(" M201 X"), LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[X_AXIS]),
|
||||
SP_Y_STR, LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Y_AXIS]),
|
||||
SP_Z_STR, LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Z_AXIS]),
|
||||
SP_I_STR, I_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[I_AXIS]),
|
||||
SP_J_STR, J_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[J_AXIS]),
|
||||
SP_K_STR, K_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[K_AXIS]),
|
||||
SP_U_STR, U_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[U_AXIS]),
|
||||
SP_V_STR, V_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[V_AXIS]),
|
||||
SP_W_STR, W_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[W_AXIS])
|
||||
)
|
||||
);
|
||||
SERIAL_ECHOPGM_P(NUM_AXIS_PAIRED_LIST(
|
||||
PSTR(" M201 X"), LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[X_AXIS]),
|
||||
SP_Y_STR, LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Y_AXIS]),
|
||||
SP_Z_STR, LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Z_AXIS]),
|
||||
SP_I_STR, I_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[I_AXIS]),
|
||||
SP_J_STR, J_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[J_AXIS]),
|
||||
SP_K_STR, K_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[K_AXIS]),
|
||||
SP_U_STR, U_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[U_AXIS]),
|
||||
SP_V_STR, V_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[V_AXIS]),
|
||||
SP_W_STR, W_AXIS_UNIT(planner.settings.max_acceleration_mm_per_s2[W_AXIS])
|
||||
));
|
||||
#endif
|
||||
|
||||
#if HAS_EXTRUDERS && DISABLED(DISTINCT_E_FACTORS)
|
||||
|
|
@ -224,19 +222,17 @@ void GcodeSuite::M203_report(const bool forReplay/*=true*/) {
|
|||
|
||||
#if NUM_AXES
|
||||
eol = true;
|
||||
SERIAL_ECHOPGM_P(
|
||||
LIST_N(DOUBLE(NUM_AXES),
|
||||
PSTR(" M203 X"), LINEAR_UNIT(planner.settings.max_feedrate_mm_s[X_AXIS]),
|
||||
SP_Y_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Y_AXIS]),
|
||||
SP_Z_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Z_AXIS]),
|
||||
SP_I_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[I_AXIS]),
|
||||
SP_J_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[J_AXIS]),
|
||||
SP_K_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[K_AXIS]),
|
||||
SP_U_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[U_AXIS]),
|
||||
SP_V_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[V_AXIS]),
|
||||
SP_W_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[W_AXIS])
|
||||
)
|
||||
);
|
||||
SERIAL_ECHOPGM_P(NUM_AXIS_PAIRED_LIST(
|
||||
PSTR(" M203 X"), LINEAR_UNIT(planner.settings.max_feedrate_mm_s[X_AXIS]),
|
||||
SP_Y_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Y_AXIS]),
|
||||
SP_Z_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Z_AXIS]),
|
||||
SP_I_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[I_AXIS]),
|
||||
SP_J_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[J_AXIS]),
|
||||
SP_K_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[K_AXIS]),
|
||||
SP_U_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[U_AXIS]),
|
||||
SP_V_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[V_AXIS]),
|
||||
SP_W_STR, LINEAR_UNIT(planner.settings.max_feedrate_mm_s[W_AXIS])
|
||||
));
|
||||
#endif
|
||||
|
||||
#if HAS_EXTRUDERS && DISABLED(DISTINCT_E_FACTORS)
|
||||
|
|
@ -377,7 +373,7 @@ void GcodeSuite::M205_report(const bool forReplay/*=true*/) {
|
|||
, PSTR(" J"), LINEAR_UNIT(planner.junction_deviation_mm)
|
||||
#endif
|
||||
#if ENABLED(CLASSIC_JERK) && NUM_AXES
|
||||
, LIST_N(DOUBLE(NUM_AXES),
|
||||
, NUM_AXIS_PAIRED_LIST(
|
||||
SP_X_STR, LINEAR_UNIT(planner.max_jerk.x),
|
||||
SP_Y_STR, LINEAR_UNIT(planner.max_jerk.y),
|
||||
SP_Z_STR, LINEAR_UNIT(planner.max_jerk.z),
|
||||
|
|
|
|||
|
|
@ -82,19 +82,17 @@ void GcodeSuite::M210_report(const bool forReplay/*=true*/) {
|
|||
report_heading_etc(forReplay, F(STR_HOMING_FEEDRATE));
|
||||
|
||||
SERIAL_ECHOPGM(" M210");
|
||||
SERIAL_ECHOLNPGM_P(
|
||||
LIST_N(DOUBLE(NUM_AXES)
|
||||
, SP_X_STR, X_AXIS_UNIT(homing_feedrate_mm_m.x)
|
||||
, SP_Y_STR, Y_AXIS_UNIT(homing_feedrate_mm_m.y)
|
||||
, SP_Z_STR, Z_AXIS_UNIT(homing_feedrate_mm_m.z)
|
||||
, SP_I_STR, I_AXIS_UNIT(homing_feedrate_mm_m.i)
|
||||
, SP_J_STR, J_AXIS_UNIT(homing_feedrate_mm_m.j)
|
||||
, SP_K_STR, K_AXIS_UNIT(homing_feedrate_mm_m.k)
|
||||
, SP_U_STR, U_AXIS_UNIT(homing_feedrate_mm_m.u)
|
||||
, SP_V_STR, V_AXIS_UNIT(homing_feedrate_mm_m.v)
|
||||
, SP_W_STR, W_AXIS_UNIT(homing_feedrate_mm_m.w)
|
||||
)
|
||||
);
|
||||
SERIAL_ECHOLNPGM_P(NUM_AXIS_PAIRED_LIST(
|
||||
SP_X_STR, X_AXIS_UNIT(homing_feedrate_mm_m.x),
|
||||
SP_Y_STR, Y_AXIS_UNIT(homing_feedrate_mm_m.y),
|
||||
SP_Z_STR, Z_AXIS_UNIT(homing_feedrate_mm_m.z),
|
||||
SP_I_STR, I_AXIS_UNIT(homing_feedrate_mm_m.i),
|
||||
SP_J_STR, J_AXIS_UNIT(homing_feedrate_mm_m.j),
|
||||
SP_K_STR, K_AXIS_UNIT(homing_feedrate_mm_m.k),
|
||||
SP_U_STR, U_AXIS_UNIT(homing_feedrate_mm_m.u),
|
||||
SP_V_STR, V_AXIS_UNIT(homing_feedrate_mm_m.v),
|
||||
SP_W_STR, W_AXIS_UNIT(homing_feedrate_mm_m.w)
|
||||
));
|
||||
}
|
||||
|
||||
#endif // EDITABLE_HOMING_FEEDRATE
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ void GcodeSuite::M92_report(const bool forReplay/*=true*/, const int8_t e/*=-1*/
|
|||
report_heading_etc(forReplay, F(STR_STEPS_PER_UNIT));
|
||||
#if NUM_AXES
|
||||
#define PRINT_EOL
|
||||
SERIAL_ECHOPGM_P(LIST_N(DOUBLE(NUM_AXES),
|
||||
SERIAL_ECHOPGM_P(NUM_AXIS_PAIRED_LIST(
|
||||
PSTR(" M92 X"), LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]),
|
||||
SP_Y_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]),
|
||||
SP_Z_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS]),
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue