Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x

This commit is contained in:
InsanityAutomation
2024-01-09 09:00:33 -05:00
80 changed files with 809 additions and 473 deletions
+8 -3
View File
@@ -2032,7 +2032,7 @@
* Commands to execute at the end of G29 probing.
* Useful to retract or move the Z probe out of the way.
*/
//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
//#define EVENT_GCODE_AFTER_G29 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10"
/**
* Normally G28 leaves leveling disabled on completion. Enable one of
@@ -2054,7 +2054,7 @@
/**
* Enable detailed logging of G28, G29, M48, etc.
* Turn on with the command 'M111 S32'.
* NOTE: Requires a lot of PROGMEM!
* NOTE: Requires a lot of flash!
*/
//#define DEBUG_LEVELING_FEATURE
@@ -2343,7 +2343,7 @@
*/
//#define EEPROM_SETTINGS // Persistent storage with M500 and M501
//#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release!
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save flash.
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
#if ENABLED(EEPROM_SETTINGS)
//#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.
@@ -3015,6 +3015,11 @@
//
//#define BTT_MINI_12864
//
// BEEZ MINI 12864 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight.
//
//#define BEEZ_MINI_12864
//
// Factory display for Creality CR-10 / CR-7 / Ender-3
// https://www.aliexpress.com/item/32833148327.html
+49 -37
View File
@@ -1342,7 +1342,7 @@
#define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm
#define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm
// Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM).
// Uncomment to enable reporting (required for "G425 V", but consumes flash).
//#define CALIBRATION_REPORTING
// The true location and dimension the cube/bolt/washer on the bed.
@@ -2929,6 +2929,7 @@
//#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu.
//#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302)
#define CONFIGURE_FILAMENT_CHANGE // Add M603 G-code and menu items. Requires ~1.3K bytes of flash.
#endif
// @section tmc_smart
@@ -3835,38 +3836,6 @@
*/
//#define CNC_COORDINATE_SYSTEMS
// @section reporting
/**
* Auto-report fan speed with M123 S<seconds>
* Requires fans with tachometer pins
*/
//#define AUTO_REPORT_FANS
/**
* Auto-report temperatures with M155 S<seconds>
*/
#define AUTO_REPORT_TEMPERATURES
#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT
//#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report
#endif
/**
* Auto-report position with M154 S<seconds>
*/
//#define AUTO_REPORT_POSITION
#if ENABLED(AUTO_REPORT_POSITION)
//#define AUTO_REPORT_REAL_POSITION // Auto-report the real position
#endif
/**
* Include capabilities in M115 output
*/
#define EXTENDED_CAPABILITIES_REPORT
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
//#define M115_GEOMETRY_REPORT
#endif
// @section security
/**
@@ -3909,13 +3878,50 @@
// @section reporting
// Extra options for the M114 "Current Position" report
/**
* Extra options for the M114 "Current Position" report
*/
//#define M114_DETAIL // Use 'M114` for details to check planner calculations
//#define M114_REALTIME // Real current position based on forward kinematics
//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.
/**
* Auto-report fan speed with M123 S<seconds>
* Requires fans with tachometer pins
*/
//#define AUTO_REPORT_FANS
//#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others)
/**
* Auto-report temperatures with M155 S<seconds>
*/
#define AUTO_REPORT_TEMPERATURES
#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT
//#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report
#endif
/**
* Auto-report position with M154 S<seconds>
*/
//#define AUTO_REPORT_POSITION
#if ENABLED(AUTO_REPORT_POSITION)
//#define AUTO_REPORT_REAL_POSITION // Auto-report the real position
#endif
/**
* M115 - Report capabilites. Disable to save ~1150 bytes of flash.
* Some hosts (and serial TFT displays) rely on this feature.
*/
#define CAPABILITIES_REPORT
#if ENABLED(CAPABILITIES_REPORT)
// Include capabilities in M115 output
#define EXTENDED_CAPABILITIES_REPORT
#if ENABLED(EXTENDED_CAPABILITIES_REPORT)
//#define M115_GEOMETRY_REPORT
#endif
#endif
// @section gcode
/**
@@ -3927,7 +3933,9 @@
//#define GCODE_QUOTED_STRINGS // Support for quoted string parameters
#endif
// Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack)
/**
* Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack)
*/
//#define MEATPACK_ON_SERIAL_PORT_1
//#define MEATPACK_ON_SERIAL_PORT_2
@@ -3935,6 +3943,12 @@
//#define REPETIER_GCODE_M360 // Add commands originally from Repetier FW
/**
* Enable M111 debug flags 1=ECHO, 2=INFO, 4=ERRORS (unimplemented).
* Disable to save some flash. Some hosts (Repetier Host) may rely on this feature.
*/
#define DEBUG_FLAGS_GCODE
/**
* Enable this option for a leaner build of Marlin that removes
* workspace offsets to slightly optimize performance.
@@ -3962,8 +3976,6 @@
//#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode
#endif
// @section gcode
/**
* Startup commands
*
+1 -1
View File
@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2024-01-01"
//#define STRING_DISTRIBUTION_DATE "2024-01-09"
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
+29
View File
@@ -0,0 +1,29 @@
# USB Files Source Documentation
## Source
We sourced the USB files in Marlin from the Atmel ASF (Advanced Software Framework). The framework provides a variety of examples which were utilized in this project.
Atmel doesn't provide these files in a source repository but they can be extracted from ASF, which can be downloaded from Atmel.
[Advanced Software Framework](https://www.microchip.com/en-us/tools-resources/develop/libraries/advanced-software-framework)
## Modifications
The files are mostly unmodified except for minor cosmetic changes but some more significant changes were needed.
The changes that prompted the addition of this README file are listed below. Other changes may have been made prior to this.
1. Modified `uotghs_device_due.c` to resolve race conditions that could leave interrupts asserted when freezing the peripheral clock, resulting in hangs and watchdog resets due to the ensuing interrupt storm.
## Version Information
We don't know the exact version of ASF used as the source. However, the copyright information in the files indicates they are from 2015.
## Upgrade Considerations
We looked at the ASF 3.52.0 files released in 2022 but saw no immediate benefits to justify an upgrade. It's important to note that the files in Marlin don't follow the same folder structure as the files in ASF, which complicates the process of comparing and applying updated files.
When these files are updated it's important to carefully compare them to Marlin's versions so any improvements in the Marlin sources are brought forward.
It would be best to make Marlin's directory structure align with ASF or at least document the source of each file to ease future updates.
+70 -9
View File
@@ -116,6 +116,23 @@
//#define dbg_print printf
#define dbg_print(...)
// Marlin modification: Redefine the otg_freeze_clock and otg_unfreeze_clock macros
// to add memory barriers to ensure that any accesses to USB registers aren't re-ordered
// to occur while the clock is frozen.
#undef otg_freeze_clock
#undef otg_unfreeze_clock
#define otg_freeze_clock() do { \
__DSB(); \
Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_FRZCLK); \
} while (0)
#define otg_unfreeze_clock() \
do { \
Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_FRZCLK); \
__DSB(); \
} while (0)
/**
* \ingroup udd_group
* \defgroup udd_udphs_group USB On-The-Go High-Speed Port for device mode (UOTGHS)
@@ -611,6 +628,18 @@ ISR(UDD_USB_INT_FUN)
// The wakeup interrupt is automatic acked when a suspend occur
udd_disable_wake_up_interrupt();
udd_enable_suspend_interrupt();
// Marlin modification: The RESET, SOF, and MSOF interrupts were previously
// enabled in udd_attach, which caused a race condition where they could
// be raised and unclearable with the clock is frozen. They are now
// enabled here, after the clock has been unfrozen in response to the wake
// interrupt.
udd_enable_reset_interrupt();
udd_enable_sof_interrupt();
#ifdef USB_DEVICE_HS_SUPPORT
udd_enable_msof_interrupt();
#endif
udd_sleep_mode(true); // Enter in IDLE mode
#ifdef UDC_RESUME_EVENT
UDC_RESUME_EVENT();
@@ -776,6 +805,27 @@ void udd_disable(void)
cpu_irq_restore(flags);
}
// Marlin modification: The original implementation did not use a memory
// barrier between disabling and clearing interrupts. This sometimes
// allowed interrupts to remain raised and unclearable after the clock
// was frozen. This helper was added to ensure that memory barriers
// are used consistently from all places where interrupts are disabled.
static void disable_and_ack_sync_interrupts()
{
// Disable USB line events
udd_disable_reset_interrupt();
udd_disable_sof_interrupt();
#ifdef USB_DEVICE_HS_SUPPORT
udd_disable_msof_interrupt();
#endif
__DSB();
udd_ack_reset();
udd_ack_sof();
#ifdef USB_DEVICE_HS_SUPPORT
udd_ack_msof();
#endif
__DSB();
}
void udd_attach(void)
{
@@ -796,17 +846,16 @@ void udd_attach(void)
udd_attach_device();
// Enable USB line events
udd_enable_reset_interrupt();
udd_enable_suspend_interrupt();
udd_enable_wake_up_interrupt();
udd_enable_sof_interrupt();
#ifdef USB_DEVICE_HS_SUPPORT
udd_enable_msof_interrupt();
#endif
// Reset following interrupts flag
udd_ack_reset();
udd_ack_sof();
udd_ack_msof();
// Marlin modification: The RESET, SOF, and MSOF interrupts were previously
// enabled here, which caused a race condition where they could be raised
// and unclearable with the clock is frozen. They are now enabled in the
// wake interrupt handler, after the clock has been unfrozen. They are now
// explicitly disabled here to ensure that they cannot be raised before
// the clock is frozen.
disable_and_ack_sync_interrupts();
// The first suspend interrupt must be forced
// The first suspend interrupt is not detected else raise it
@@ -824,6 +873,12 @@ void udd_detach(void)
// Detach device from the bus
udd_detach_device();
// Marlin modification: Added the explicit disabling of the RESET, SOF, and
// MSOF interrupts here, to ensure that they cannot be raised after the
// clock is frozen.
disable_and_ack_sync_interrupts();
otg_freeze_clock();
udd_sleep_mode(false);
}
@@ -2043,6 +2098,12 @@ static bool udd_ep_interrupt(void)
dbg_print("I ");
udd_disable_in_send_interrupt(ep);
// One bank is free then send a ZLP
// Marlin modification: Add a barrier to ensure in_send is disabled
// before it is cleared. This was not an observed problem, but
// other interrupts were seen to misbehave without this barrier.
__DSB();
udd_ack_in_send(ep);
udd_ack_fifocon(ep);
udd_ep_finish_job(ptr_job, false, ep);
+37 -19
View File
@@ -34,6 +34,10 @@
#include <freertos/queue.h>
#include "../../module/stepper.h"
#if ENABLED(FT_MOTION)
#include "../../module/ft_motion.h"
#endif
#define DMA_BUF_COUNT 8 // number of DMA buffers to store data
#define DMA_BUF_LEN 4092 // maximum size in bytes
#define I2S_SAMPLE_SIZE 4 // 4 bytes, 32 bits per sample
@@ -134,8 +138,8 @@ static void IRAM_ATTR i2s_intr_handler_default(void *arg) {
if (high_priority_task_awoken == pdTRUE) portYIELD_FROM_ISR();
// clear interrupt
I2S0.int_clr.val = I2S0.int_st.val; //clear pending interrupt
// Clear pending interrupt
I2S0.int_clr.val = I2S0.int_st.val;
}
void stepperTask(void *parameter) {
@@ -148,29 +152,43 @@ void stepperTask(void *parameter) {
xQueueReceive(dma.queue, &dma.current, portMAX_DELAY);
dma.rw_pos = 0;
const bool using_ftMotion = TERN0(FT_MOTION, ftMotion.cfg.mode);
while (dma.rw_pos < DMA_SAMPLE_COUNT) {
if (!nextMainISR) {
Stepper::pulse_phase_isr();
nextMainISR = Stepper::block_phase_isr();
}
#if ENABLED(LIN_ADVANCE)
else if (!nextAdvanceISR) {
Stepper::advance_isr();
nextAdvanceISR = Stepper::la_interval;
#if ENABLED(FT_MOTION)
if (using_ftMotion) {
if (!nextMainISR) stepper.ftMotion_stepper();
nextMainISR = 0;
}
#endif
else
i2s_push_sample();
nextMainISR--;
if (!using_ftMotion) {
if (!nextMainISR) {
Stepper::pulse_phase_isr();
nextMainISR = Stepper::block_phase_isr();
}
#if ENABLED(LIN_ADVANCE)
else if (!nextAdvanceISR) {
Stepper::advance_isr();
nextAdvanceISR = Stepper::la_interval;
}
#endif
else
i2s_push_sample();
#if ENABLED(LIN_ADVANCE)
if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
nextAdvanceISR = Stepper::la_interval;
nextMainISR--;
if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER)
nextAdvanceISR--;
#endif
#if ENABLED(LIN_ADVANCE)
if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
nextAdvanceISR = Stepper::la_interval;
if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER)
nextAdvanceISR--;
#endif
}
}
}
}
+46
View File
@@ -19,6 +19,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#ifdef __PLAT_LINUX__
#include "../../inc/MarlinConfig.h"
@@ -57,4 +58,49 @@ uint16_t MarlinHAL::adc_value() {
void MarlinHAL::reboot() { /* Reset the application state and GPIO */ }
// ------------------------
// BSD String
// ------------------------
/**
* Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef HAS_LIBBSD
/**
* Copy string src to buffer dst of size dsize. At most dsize-1
* chars will be copied. Always NUL terminates (unless dsize == 0).
* Returns strlen(src); if retval >= dsize, truncation occurred.
*/
size_t MarlinHAL::_strlcpy(char *dst, const char *src, size_t dsize) {
const char *osrc = src;
size_t nleft = dsize;
// Copy as many bytes as will fit.
if (nleft != 0) while (--nleft != 0) if ((*dst++ = *src++) == '\0') break;
// Not enough room in dst, add NUL and traverse rest of src.
if (nleft == 0) {
if (dsize != 0) *dst = '\0'; // NUL-terminate dst
while (*src++) { /* nada */ }
}
return (src - osrc - 1); // count does not include NUL
}
#endif // HAS_LIBBSD
#endif // __PLAT_LINUX__
+14
View File
@@ -26,6 +26,11 @@
#include <iostream>
#include <stdint.h>
#include <stdarg.h>
#ifdef HAS_LIBBSD
#include <bsd/string.h>
#endif
#undef min
#undef max
#include <algorithm>
@@ -162,4 +167,13 @@ public:
}
static void set_pwm_frequency(const pin_t, int) {}
#ifndef HAS_LIBBSD
/**
* Redirect missing strlcpy here
*/
static size_t _strlcpy(char *dst, const char *src, size_t dsize);
#define strlcpy hal._strlcpy
#endif
};
-3
View File
@@ -28,9 +28,6 @@
#include <pinmapping.h>
#define strlcpy(A, B, C) strncpy(A, B, (C) - 1)
#define strlcpy_P(A, B, C) strncpy_P(A, B, (C) - 1)
#define HIGH 0x01
#define LOW 0x00
+67
View File
@@ -0,0 +1,67 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/**
* Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef __PLAT_NATIVE_SIM__
#ifndef HAS_LIBBSD
#include "HAL.h"
/**
* Copy string src to buffer dst of size dsize. At most dsize-1
* chars will be copied. Always NUL terminates (unless dsize == 0).
* Returns strlen(src); if retval >= dsize, truncation occurred.
*/
size_t MarlinHAL::_strlcpy(char *dst, const char *src, size_t dsize) {
const char *osrc = src;
size_t nleft = dsize;
// Copy as many bytes as will fit.
if (nleft != 0) while (--nleft != 0) if ((*dst++ = *src++) == '\0') break;
// Not enough room in dst, add NUL and traverse rest of src.
if (nleft == 0) {
if (dsize != 0) *dst = '\0'; // NUL-terminate dst
while (*src++) { /* nada */ }
}
return (src - osrc - 1); // count does not include NUL
}
#endif // HAS_LIBBSD
#endif // __PLAT_NATIVE_SIM__
+10
View File
@@ -263,4 +263,14 @@ public:
analogWrite(pin, v);
}
static void set_pwm_frequency(const pin_t, int) {}
#ifndef HAS_LIBBSD
/**
* Redirect missing strlcpy here
*/
static size_t _strlcpy(char *dst, const char *src, size_t dsize);
#define strlcpy hal._strlcpy
#endif
};
+66 -45
View File
@@ -31,6 +31,10 @@
#include "tft_spi.h"
#include "pinconfig.h"
//#define DEBUG_TFT_IO
#define DEBUG_OUT ENABLED(DEBUG_TFT_IO)
#include "../../../core/debug_out.h"
SPI_HandleTypeDef TFT_SPI::SPIx;
DMA_HandleTypeDef TFT_SPI::DMAtx;
@@ -43,8 +47,9 @@ void TFT_SPI::init() {
if ((spiInstance = (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_SCK_PIN), PinMap_SPI_SCLK)) == NP) return;
if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MOSI_PIN), PinMap_SPI_MOSI)) return;
#if PIN_EXISTS(TFT_MISO) && TFT_MISO_PIN != TFT_MOSI_PIN
if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO)) return;
#if PIN_EXISTS(TFT_MISO)
// Check these pins in code because they are sometimes defined as analog pin references
if ((TFT_MISO_PIN != TFT_MOSI_PIN) && (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO))) return;
#endif
SPIx.Instance = spiInstance;
@@ -76,10 +81,13 @@ void TFT_SPI::init() {
pinmap_pinout(digitalPinToPinName(TFT_SCK_PIN), PinMap_SPI_SCLK);
pinmap_pinout(digitalPinToPinName(TFT_MOSI_PIN), PinMap_SPI_MOSI);
#if PIN_EXISTS(TFT_MISO) && TFT_MISO_PIN != TFT_MOSI_PIN
pinmap_pinout(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO);
#if PIN_EXISTS(TFT_MISO)
// Check these pins in code because they are sometimes defined as analog pin references
if (TFT_MISO_PIN != TFT_MOSI_PIN) pinmap_pinout(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO);
#endif
//pin_PullConfig(get_GPIO_Port(STM_PORT(digitalPinToPinName(TFT_SCK_PIN))), STM_LL_GPIO_PIN(digitalPinToPinName(TFT_SCK_PIN)), GPIO_PULLDOWN);
#ifdef SPI1_BASE
if (SPIx.Instance == SPI1) {
__HAL_RCC_SPI1_CLK_ENABLE();
@@ -151,29 +159,47 @@ void TFT_SPI::dataTransferBegin(uint16_t dataSize) {
WRITE(TFT_CS_PIN, LOW);
}
#ifdef TFT_DEFAULT_DRIVER
#include "../../../lcd/tft_io/tft_ids.h"
#endif
#include "../../../lcd/tft_io/tft_ids.h"
uint32_t TFT_SPI::getID() {
uint32_t id;
id = readID(LCD_READ_ID);
DEBUG_ECHOLNPGM("TFT_SPI::getID()");
uint32_t id = readID(LCD_READ_ID);
#if ENABLED(DEBUG_TFT_IO)
char debug_register[3], debug_value[5];
sprintf_P(debug_register, PSTR("%02X"), LCD_READ_ID);
sprintf_P(debug_value, PSTR("%04X"), uint16_t(id));
DEBUG_ECHOLNPGM(" readID(0x", debug_register, ") : 0x", debug_value);
#endif
if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF) {
id = readID(LCD_READ_ID4);
#ifdef TFT_DEFAULT_DRIVER
if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF)
id = TFT_DEFAULT_DRIVER;
#if ENABLED(DEBUG_TFT_IO)
sprintf_P(debug_register, PSTR("%02X"), LCD_READ_ID4);
sprintf_P(debug_value, PSTR("%04X"), uint16_t(id));
DEBUG_ECHOLNPGM(" readID(0x", debug_register, ") : 0x", debug_value);
#endif
}
}
#ifdef TFT_DEFAULT_DRIVER
if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF) {
id = TFT_DEFAULT_DRIVER;
#if ENABLED(DEBUG_TFT_IO)
sprintf_P(debug_value, PSTR("%04X"), uint16_t(id));
DEBUG_ECHOLNPGM(" Fallback to TFT_DEFAULT_DRIVER : 0x", debug_value);
#endif
}
#endif
return id;
}
uint32_t TFT_SPI::readID(const uint16_t inReg) {
uint32_t data = 0;
#if PIN_EXISTS(TFT_MISO)
const uint32_t oldPrescaler = SPIx.Init.BaudRatePrescaler;
uint32_t BaudRatePrescaler = SPIx.Init.BaudRatePrescaler;
SPIx.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_64;
dataTransferBegin(DATASIZE_8BIT);
writeReg(inReg);
@@ -185,10 +211,8 @@ uint32_t TFT_SPI::readID(const uint16_t inReg) {
__HAL_SPI_ENABLE(&SPIx);
SET_BIT(SPIx.Instance->CR1, SPI_CR1_CSTART);
#if TFT_MISO_PIN != TFT_MOSI_PIN
SPIx.Instance->TXDR = 0;
#endif
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_EOT)) {}
if (SPIx.Init.Direction == SPI_DIRECTION_2LINES) SPIx.Instance->TXDR = 0;
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_EOT)) { /* nada */ }
data = (data << 8) | SPIx.Instance->RXDR;
__HAL_SPI_DISABLE(&SPIx);
__HAL_SPI_CLEAR_EOTFLAG(&SPIx);
@@ -197,19 +221,22 @@ uint32_t TFT_SPI::readID(const uint16_t inReg) {
#else
__HAL_SPI_ENABLE(&SPIx);
for (uint32_t i = 0; i < 4; i++) {
#if TFT_MISO_PIN != TFT_MOSI_PIN
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_TXE)) {}
if (SPIx.Init.Direction == SPI_DIRECTION_2LINES) {
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_TXE)) { /* nada */ }
SPIx.Instance->DR = 0;
#endif
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_RXNE)) {}
}
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_RXNE)) { /* nada */ }
data = (data << 8) | SPIx.Instance->DR;
}
#endif
dataTransferEnd();
SPIx.Init.BaudRatePrescaler = oldPrescaler;
#if DISABLED(DEBUG_TFT_IO)
SPIx.Init.BaudRatePrescaler = BaudRatePrescaler;
#endif
#endif
DEBUG_ECHOLNPGM(" raw data : ", data);
return data >> 7;
}
@@ -238,13 +265,13 @@ bool TFT_SPI::isBusy() {
// Check if SPI data transfer is completed
if (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_EOT)) return true;
#else
// Check if SPI is idle
if (__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY)) return true;
// Check if SPI transmit butter is empty and SPI is idle
if ((!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_TXE)) || (__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY))) return true;
#endif
}
abort();
return false;
return true;
}
void TFT_SPI::abort() {
@@ -263,9 +290,7 @@ void TFT_SPI::abort() {
}
void TFT_SPI::transmit(uint16_t data) {
#if TFT_MISO_PIN == TFT_MOSI_PIN
SPI_1LINE_TX(&SPIx);
#endif
if (SPIx.Init.Direction == SPI_DIRECTION_1LINE) SPI_1LINE_TX(&SPIx);
#ifdef STM32H7xx
MODIFY_REG(SPIx.Instance->CR2, SPI_CR2_TSIZE, 1);
@@ -274,30 +299,26 @@ void TFT_SPI::transmit(uint16_t data) {
SPIx.Instance->TXDR = data;
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_SR_EOT)) {}
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_SR_EOT)) { /* nada */ }
__HAL_SPI_CLEAR_EOTFLAG(&SPIx);
__HAL_SPI_CLEAR_TXTFFLAG(&SPIx);
__HAL_SPI_DISABLE(&SPIx);
#else
__HAL_SPI_ENABLE(&SPIx);
SPIx.Instance->DR = data;
while (__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY)) {}
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_TXE)) { /* nada */ } // Wait for data transfer to actually start
while ( __HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY)) { /* nada */ } // Wait until SPI is idle
#endif
__HAL_SPI_DISABLE(&SPIx);
#if TFT_MISO_PIN != TFT_MOSI_PIN
__HAL_SPI_CLEAR_OVRFLAG(&SPIx); // Clear overrun flag in 2 Lines communication mode because received data is not read
#endif
if (SPIx.Init.Direction == SPI_DIRECTION_2LINES) __HAL_SPI_CLEAR_OVRFLAG(&SPIx); // Clear overrun flag in 2 Lines communication mode because received data is not read
}
void TFT_SPI::transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t count) {
DMAtx.Init.MemInc = memoryIncrease;
HAL_DMA_Init(&DMAtx);
#if TFT_MISO_PIN == TFT_MOSI_PIN
SPI_1LINE_TX(&SPIx);
#endif
if (SPIx.Init.Direction == SPI_DIRECTION_1LINE) SPI_1LINE_TX(&SPIx);
dataTransferBegin();
@@ -316,7 +337,7 @@ void TFT_SPI::transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t coun
SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN); // Enable Tx DMA Request
#endif
TERN_(TFT_SHARED_IO, while (isBusy()));
TERN_(TFT_SHARED_IO, while (isBusy()) { /* nada */ });
}
void TFT_SPI::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) {
@@ -324,9 +345,10 @@ void TFT_SPI::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count)
HAL_DMA_PollForTransfer(&DMAtx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY);
#ifdef STM32H7xx
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_SR_EOT)) {}
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_SR_EOT)) { /* nada */ }
#else
while (__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY)) {}
while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_TXE)) { /* nada */ }
while (__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY)) { /* nada */ }
#endif
abort();
}
@@ -337,8 +359,7 @@ void TFT_SPI::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count)
DMAtx.Init.MemInc = memoryIncrease;
HAL_DMA_Init(&DMAtx);
if (TFT_MISO_PIN == TFT_MOSI_PIN)
SPI_1LINE_TX(&SPIx);
if (SPIx.Init.Direction == SPI_DIRECTION_1LINE) SPI_1LINE_TX(&SPIx);
dataTransferBegin();
+4 -2
View File
@@ -219,7 +219,9 @@
#include "feature/fanmux.h"
#endif
#include "module/tool_change.h"
#if HAS_TOOLCHANGE
#include "module/tool_change.h"
#endif
#if HAS_FANCHECK
#include "feature/fancheck.h"
@@ -776,7 +778,7 @@ void idle(const bool no_stepper_sleep/*=false*/) {
if (marlin_state == MF_INITIALIZING) goto IDLE_DONE;
// TODO: Still causing errors
(void)check_tool_sensor_stats(active_extruder, true);
TERN_(TOOL_SENSOR, (void)check_tool_sensor_stats(active_extruder, true));
// Handle filament runout sensors
#if HAS_FILAMENT_SENSOR
+8 -13
View File
@@ -33,19 +33,14 @@
//
enum MarlinDebugFlags : uint8_t {
MARLIN_DEBUG_NONE = 0,
MARLIN_DEBUG_ECHO = _BV(0), ///< Echo commands in order as they are processed
MARLIN_DEBUG_INFO = _BV(1), ///< Print messages for code that has debug output
MARLIN_DEBUG_ERRORS = _BV(2), ///< Not implemented
MARLIN_DEBUG_DRYRUN = _BV(3), ///< Ignore temperature setting and E movement commands
MARLIN_DEBUG_COMMUNICATION = _BV(4), ///< Not implemented
#if ENABLED(DEBUG_LEVELING_FEATURE)
MARLIN_DEBUG_LEVELING = _BV(5), ///< Print detailed output for homing and leveling
MARLIN_DEBUG_MESH_ADJUST = _BV(6), ///< UBL bed leveling
#else
MARLIN_DEBUG_LEVELING = 0,
MARLIN_DEBUG_MESH_ADJUST = 0,
#endif
MARLIN_DEBUG_ALL = 0xFF
MARLIN_DEBUG_ECHO = TERN0(DEBUG_FLAGS_GCODE, _BV(0)), //!< Echo commands in order as they are processed
MARLIN_DEBUG_INFO = TERN0(DEBUG_FLAGS_GCODE, _BV(1)), //!< Print messages for code that has debug output
MARLIN_DEBUG_ERRORS = TERN0(DEBUG_FLAGS_GCODE, _BV(2)), //!< Not implemented
MARLIN_DEBUG_DRYRUN = _BV(3), //!< Ignore temperature setting and E movement commands
MARLIN_DEBUG_COMMUNICATION = TERN0(DEBUG_FLAGS_GCODE, _BV(4)), //!< Not implemented
MARLIN_DEBUG_LEVELING = TERN0(DEBUG_LEVELING_FEATURE, _BV(5)), //!< Print detailed output for homing and leveling
MARLIN_DEBUG_MESH_ADJUST = TERN0(DEBUG_LEVELING_FEATURE, _BV(6)), //!< UBL bed leveling
MARLIN_DEBUG_ALL = MARLIN_DEBUG_ECHO|MARLIN_DEBUG_INFO|MARLIN_DEBUG_ERRORS|MARLIN_DEBUG_COMMUNICATION|MARLIN_DEBUG_LEVELING|MARLIN_DEBUG_MESH_ADJUST
};
extern uint8_t marlin_debug_flags;
+3 -7
View File
@@ -37,10 +37,6 @@
#include "../../../gcode/gcode.h"
#include "../../../libs/least_squares_fit.h"
#if HAS_MULTI_HOTEND
#include "../../../module/tool_change.h"
#endif
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../../core/debug_out.h"
@@ -685,11 +681,11 @@ void unified_bed_leveling::G29() {
ui.release();
#endif
#ifdef Z_PROBE_END_SCRIPT
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Probe End Script: ", Z_PROBE_END_SCRIPT);
#ifdef EVENT_GCODE_AFTER_G29
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Probe End Script: ", EVENT_GCODE_AFTER_G29);
if (probe_deployed) {
planner.synchronize();
gcode.process_subcommands_now(F(Z_PROBE_END_SCRIPT));
gcode.process_subcommands_now(F(EVENT_GCODE_AFTER_G29));
}
#else
UNUSED(probe_deployed);
+1 -1
View File
@@ -39,7 +39,7 @@
#if ENABLED(MAX7219_DEBUG)
#define MAX7219_ERRORS // Disable to save 406 bytes of Program Memory
#define MAX7219_ERRORS // Requires ~400 bytes of flash
#include "max7219.h"
-4
View File
@@ -43,10 +43,6 @@
typedef int8_t mixer_perc_t;
#ifndef MIXING_VIRTUAL_TOOLS
#define MIXING_VIRTUAL_TOOLS 1
#endif
enum MixTool {
FIRST_USER_VIRTUAL_TOOL = 0
, LAST_USER_VIRTUAL_TOOL = MIXING_VIRTUAL_TOOLS - 1
+3 -1
View File
@@ -89,7 +89,9 @@ static xyze_pos_t resume_position;
PauseMode pause_mode = PAUSE_MODE_PAUSE_PRINT;
#endif
fil_change_settings_t fc_settings[EXTRUDERS];
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
fil_change_settings_t fc_settings[EXTRUDERS];
#endif
#if HAS_MEDIA
#include "../sd/cardreader.h"
+14 -5
View File
@@ -26,10 +26,6 @@
* This may be combined with related G-codes if features are consolidated.
*/
typedef struct {
float unload_length, load_length;
} fil_change_settings_t;
#include "../inc/MarlinConfigPre.h"
#if ENABLED(ADVANCED_PAUSE_FEATURE)
@@ -69,7 +65,20 @@ enum PauseMessage : char {
extern PauseMode pause_mode;
#endif
extern fil_change_settings_t fc_settings[EXTRUDERS];
typedef struct FilamentChangeSettings {
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
float load_length, unload_length;
#else
static constexpr float load_length = FILAMENT_CHANGE_FAST_LOAD_LENGTH,
unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH;
#endif
} fil_change_settings_t;
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
extern fil_change_settings_t fc_settings[EXTRUDERS];
#else
constexpr fil_change_settings_t fc_settings[EXTRUDERS];
#endif
extern uint8_t did_pause_print;
+1 -1
View File
@@ -27,7 +27,7 @@
#include "solenoid.h"
#include "../module/motion.h" // for active_extruder
#include "../module/tool_change.h"
#include "../module/tool_change.h" // for parking_extruder_set_parked
// Used primarily with MANUAL_SOLENOID_CONTROL
static void set_solenoid(const uint8_t num, const uint8_t state) {
+4 -2
View File
@@ -501,8 +501,10 @@ void GcodeSuite::G26() {
// or if the parameter parsing did not go OK, abort
if (homing_needed_error()) return;
// Change the tool first, if specified
if (parser.seenval('T')) tool_change(parser.value_int());
#if HAS_TOOLCHANGE
// Change the tool first, if specified
if (parser.seenval('T')) tool_change(parser.value_int());
#endif
g26_helper_t g26;
-4
View File
@@ -29,10 +29,6 @@
#include "../../module/probe.h"
#include "../../feature/bedlevel/bedlevel.h"
#if HAS_MULTI_HOTEND
#include "../../module/tool_change.h"
#endif
#if ENABLED(BLTOUCH)
#include "../../feature/bltouch.h"
#endif
+3 -7
View File
@@ -55,10 +55,6 @@
#include "../../../lcd/e3v2/proui/dwin.h"
#endif
#if HAS_MULTI_HOTEND
#include "../../../module/tool_change.h"
#endif
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../../../core/debug_out.h"
@@ -991,10 +987,10 @@ G29_TYPE GcodeSuite::G29() {
TERN_(HAS_BED_PROBE, probe.move_z_after_probing());
#ifdef Z_PROBE_END_SCRIPT
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Probe End Script: ", Z_PROBE_END_SCRIPT);
#ifdef EVENT_GCODE_AFTER_G29
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Probe End Script: ", EVENT_GCODE_AFTER_G29);
planner.synchronize();
process_subcommands_now(F(Z_PROBE_END_SCRIPT));
process_subcommands_now(F(EVENT_GCODE_AFTER_G29));
#endif
probe.use_probing_tool(false);
+2 -2
View File
@@ -639,8 +639,8 @@ void GcodeSuite::G28() {
#endif
#ifdef XY_AFTER_HOMING
constexpr xy_pos_t xy_after XY_AFTER_HOMING;
do_blocking_move_to(xy_after);
if (!axes_should_home(_BV(X_AXIS) | _BV(Y_AXIS)))
do_blocking_move_to(xy_pos_t(XY_AFTER_HOMING));
#endif
restore_feedrate_and_scaling();
-4
View File
@@ -35,10 +35,6 @@
#include "../../module/probe.h"
#endif
#if HAS_MULTI_HOTEND
#include "../../module/tool_change.h"
#endif
#if HAS_LEVELING
#include "../../feature/bedlevel/bedlevel.h"
#endif
-4
View File
@@ -37,10 +37,6 @@
#include "../../feature/bedlevel/bedlevel.h"
#endif
#if HAS_MULTI_HOTEND
#include "../../module/tool_change.h"
#endif
#if HAS_Z_STEPPER_ALIGN_STEPPER_XY
#include "../../libs/least_squares_fit.h"
#endif
+4 -1
View File
@@ -33,10 +33,13 @@
#include "../../lcd/marlinui.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#include "../../module/tool_change.h"
#include "../../module/endstops.h"
#include "../../feature/bedlevel/bedlevel.h"
#if HAS_MULTI_HOTEND
#include "../../module/tool_change.h"
#endif
#if !AXIS_CAN_CALIBRATE(X)
#undef CALIBRATION_MEASURE_LEFT
#undef CALIBRATION_MEASURE_RIGHT
+6 -5
View File
@@ -25,13 +25,14 @@
#if HAS_MULTI_EXTRUDER
#include "../gcode.h"
#include "../../module/tool_change.h"
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
#include "../../module/motion.h"
#if HAS_TOOLCHANGE
#include "../../module/tool_change.h"
#endif
#include "../../MarlinCore.h" // for SP_X_STR, etc.
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
#include "../../module/motion.h" // for active_extruder
#endif
/**
* M217 - Set toolchange parameters
@@ -121,7 +122,7 @@ void GcodeSuite::M217() {
#endif
#endif
#if HAS_Z_AXIS
#if HAS_Z_AXIS && HAS_TOOLCHANGE
if (parser.seenval('Z')) { toolchange_settings.z_raise = parser.value_linear_units(); }
#endif
+19 -13
View File
@@ -20,6 +20,7 @@
*
*/
#include "../../inc/MarlinConfig.h"
#include "../gcode.h"
/**
@@ -27,18 +28,25 @@
*/
void GcodeSuite::M111() {
if (parser.seenval('S')) marlin_debug_flags = parser.value_byte();
static PGMSTR(str_debug_1, STR_DEBUG_ECHO);
static PGMSTR(str_debug_2, STR_DEBUG_INFO);
static PGMSTR(str_debug_4, STR_DEBUG_ERRORS);
#if ENABLED(DEBUG_FLAGS_GCODE)
static PGMSTR(str_debug_1, STR_DEBUG_ECHO);
static PGMSTR(str_debug_2, STR_DEBUG_INFO);
static PGMSTR(str_debug_4, STR_DEBUG_ERRORS);
#endif
static PGMSTR(str_debug_8, STR_DEBUG_DRYRUN);
static PGMSTR(str_debug_16, STR_DEBUG_COMMUNICATION);
#if ENABLED(DEBUG_FLAGS_GCODE)
static PGMSTR(str_debug_16, STR_DEBUG_COMMUNICATION);
#endif
#if ENABLED(DEBUG_LEVELING_FEATURE)
static PGMSTR(str_debug_detail, STR_DEBUG_DETAIL);
#endif
static PGM_P const debug_strings[] PROGMEM = {
str_debug_1, str_debug_2, str_debug_4, str_debug_8, str_debug_16,
TERN(DEBUG_FLAGS_GCODE, str_debug_1, nullptr),
TERN(DEBUG_FLAGS_GCODE, str_debug_2, nullptr),
TERN(DEBUG_FLAGS_GCODE, str_debug_4, nullptr),
str_debug_8,
TERN(DEBUG_FLAGS_GCODE, str_debug_16, nullptr),
TERN_(DEBUG_LEVELING_FEATURE, str_debug_detail)
};
@@ -47,31 +55,29 @@ void GcodeSuite::M111() {
if (marlin_debug_flags) {
uint8_t comma = 0;
for (uint8_t i = 0; i < COUNT(debug_strings); ++i) {
if (TEST(marlin_debug_flags, i)) {
PGM_P const pstr = (PGM_P)pgm_read_ptr(&debug_strings[i]);
if (pstr && TEST(marlin_debug_flags, i)) {
if (comma++) SERIAL_CHAR(',');
SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&debug_strings[i]));
SERIAL_ECHOPGM_P(pstr);
}
}
}
else {
SERIAL_ECHOPGM(STR_DEBUG_OFF);
#if !defined(__AVR__) || !defined(USBCON)
#if !(defined(__AVR__) && defined(USBCON))
#if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS)
SERIAL_ECHOPGM("\nBuffer Overruns: ", MYSERIAL1.buffer_overruns());
#endif
#if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS)
SERIAL_ECHOPGM("\nFraming Errors: ", MYSERIAL1.framing_errors());
#endif
#if ENABLED(SERIAL_STATS_DROPPED_RX)
SERIAL_ECHOPGM("\nDropped bytes: ", MYSERIAL1.dropped());
#endif
#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
SERIAL_ECHOPGM("\nMax RX Queue Size: ", MYSERIAL1.rxMaxEnqueued());
#endif
#endif // !__AVR__ || !USBCON
#endif // !(__AVR__ && USBCON)
}
SERIAL_EOL();
}
+8 -2
View File
@@ -20,6 +20,10 @@
*
*/
#include "../../inc/MarlinConfigPre.h"
#if HAS_TOOLCHANGE
#include "../gcode.h"
#include "../../module/tool_change.h"
@@ -71,8 +75,10 @@ void GcodeSuite::T(const int8_t tool_index) {
tool_change(tool_index
#if HAS_MULTI_EXTRUDER
, TERN(PARKING_EXTRUDER, false, tool_index == active_extruder) // For PARKING_EXTRUDER motion is decided in tool_change()
|| parser.boolval('S')
, parser.boolval('S')
|| TERN(PARKING_EXTRUDER, false, tool_index == active_extruder) // For PARKING_EXTRUDER motion is decided in tool_change()
#endif
);
}
#endif // HAS_TOOLCHANGE
+31 -21
View File
@@ -38,14 +38,14 @@ void say_shaping() {
SERIAL_ECHOPGM(" with ");
switch (ftMotion.cfg.mode) {
default: break;
case ftMotionMode_ZV: SERIAL_ECHOPGM("ZV"); break;
case ftMotionMode_ZVD: SERIAL_ECHOPGM("ZVD"); break;
case ftMotionMode_ZVDD: SERIAL_ECHOPGM("ZVDD"); break;
case ftMotionMode_ZVDDD: SERIAL_ECHOPGM("ZVDDD"); break;
case ftMotionMode_EI: SERIAL_ECHOPGM("EI"); break;
case ftMotionMode_2HEI: SERIAL_ECHOPGM("2 Hump EI"); break;
case ftMotionMode_3HEI: SERIAL_ECHOPGM("3 Hump EI"); break;
case ftMotionMode_MZV: SERIAL_ECHOPGM("MZV"); break;
case ftMotionMode_ZV: SERIAL_ECHOPGM("ZV"); break;
case ftMotionMode_ZVD: SERIAL_ECHOPGM("ZVD"); break;
case ftMotionMode_ZVDD: SERIAL_ECHOPGM("ZVDD"); break;
case ftMotionMode_ZVDDD: SERIAL_ECHOPGM("ZVDDD"); break;
case ftMotionMode_EI: SERIAL_ECHOPGM("EI"); break;
case ftMotionMode_2HEI: SERIAL_ECHOPGM("2 Hump EI"); break;
case ftMotionMode_3HEI: SERIAL_ECHOPGM("3 Hump EI"); break;
case ftMotionMode_MZV: SERIAL_ECHOPGM("MZV"); break;
//case ftMotionMode_DISCTF: SERIAL_ECHOPGM("discrete transfer functions"); break;
//case ftMotionMode_ULENDO_FBS: SERIAL_ECHOPGM("Ulendo FBS."); return;
}
@@ -79,7 +79,7 @@ void say_shaping() {
SERIAL_ECHO_TERNARY(dynamic, "X/A ", "base dynamic", "static", " compensator frequency: ");
SERIAL_ECHO(p_float_t(ftMotion.cfg.baseFreq[X_AXIS], 2), F("Hz"));
#if HAS_DYNAMIC_FREQ
if (dynamic) SERIAL_ECHO(" scaling: ", p_float_t(ftMotion.cfg.dynFreqK[X_AXIS], 8), F("Hz/"), z_based ? F("mm") : F("g"));
if (dynamic) SERIAL_ECHO(F(" scaling: "), p_float_t(ftMotion.cfg.dynFreqK[X_AXIS], 2), F("Hz/"), z_based ? F("mm") : F("g"));
#endif
SERIAL_EOL();
#endif
@@ -88,7 +88,7 @@ void say_shaping() {
SERIAL_ECHO_TERNARY(dynamic, "Y/B ", "base dynamic", "static", " compensator frequency: ");
SERIAL_ECHO(p_float_t(ftMotion.cfg.baseFreq[Y_AXIS], 2), F(" Hz"));
#if HAS_DYNAMIC_FREQ
if (dynamic) SERIAL_ECHO(F(" scaling: "), p_float_t(ftMotion.cfg.dynFreqK[Y_AXIS], 8), F("Hz/"), z_based ? F("mm") : F("g"));
if (dynamic) SERIAL_ECHO(F(" scaling: "), p_float_t(ftMotion.cfg.dynFreqK[Y_AXIS], 2), F("Hz/"), z_based ? F("mm") : F("g"));
#endif
SERIAL_EOL();
#endif
@@ -96,7 +96,10 @@ void say_shaping() {
#if HAS_EXTRUDERS
SERIAL_ECHO_TERNARY(ftMotion.cfg.linearAdvEna, "Linear Advance ", "en", "dis", "abled");
SERIAL_ECHOLN(F(". Gain: "), p_float_t(ftMotion.cfg.linearAdvK, 5));
if (ftMotion.cfg.linearAdvEna)
SERIAL_ECHOLNPGM(". Gain: ", ftMotion.cfg.linearAdvK);
else
SERIAL_EOL();
#endif
}
@@ -129,14 +132,17 @@ void GcodeSuite::M493_report(const bool forReplay/*=true*/) {
* M493: Set Fixed-time Motion Control parameters
*
* S<mode> Set the motion / shaping mode. Shaping requires an X axis, at the minimum.
* 0: NORMAL
* 1: FIXED-TIME
* 10: ZV
* 11: ZVD
* 12: EI
* 13: 2HEI
* 14: 3HEI
* 15: MZV
*
* 0: Standard Motion
* 1: Fixed-Time Motion
* 10: ZV : Zero Vibration
* 11: ZVD : Zero Vibration and Derivative
* 12: ZVDD : Zero Vibration, Derivative, and Double Derivative
* 13: ZVDDD : Zero Vibration, Derivative, Double Derivative, and Triple Derivative
* 14: EI : Extra-Intensive
* 15: 2HEI : 2-Hump Extra-Intensive
* 16: 3HEI : 3-Hump Extra-Intensive
* 17: MZV : Mass-based Zero Vibration
*
* P<bool> Enable (1) or Disable (0) Linear Advance pressure control
*
@@ -147,11 +153,15 @@ void GcodeSuite::M493_report(const bool forReplay/*=true*/) {
* 1: Z-based (Requires a Z axis)
* 2: Mass-based (Requires X and E axes)
*
* A<Hz> Set static/base frequency for the X axis
* F<Hz> Set frequency scaling for the X axis
* A<Hz> Set static/base frequency for the X axis
* F<Hz> Set frequency scaling for the X axis
* I 0.0 Set damping ratio for the X axis
* Q 0.00 Set the vibration tolerance for the X axis
*
* B<Hz> Set static/base frequency for the Y axis
* H<Hz> Set frequency scaling for the Y axis
* J 0.0 Set damping ratio for the Y axis
* R 0.00 Set the vibration tolerance for the Y axis
*/
void GcodeSuite::M493() {
struct { bool update_n:1, update_a:1, reset_ft:1, report_h:1; } flag = { false };
+3 -7
View File
@@ -20,19 +20,15 @@
*
*/
#include "../../../inc/MarlinConfig.h"
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
#include "../../gcode.h"
#include "../../../feature/pause.h"
#include "../../../module/motion.h"
#include "../../../module/printcounter.h"
#if HAS_MULTI_EXTRUDER
#include "../../../module/tool_change.h"
#endif
/**
* M603: Configure filament change
*
@@ -80,4 +76,4 @@ void GcodeSuite::M603_report(const bool forReplay/*=true*/) {
#endif
}
#endif // ADVANCED_PAUSE_FEATURE
#endif // CONFIGURE_FILAMENT_CHANGE
+17 -10
View File
@@ -122,14 +122,16 @@ void GcodeSuite::say_units() {
* Return -1 if the T parameter is out of range
*/
int8_t GcodeSuite::get_target_extruder_from_command() {
if (parser.seenval('T')) {
const int8_t e = parser.value_byte();
if (e < EXTRUDERS) return e;
SERIAL_ECHO_START();
SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum);
SERIAL_ECHOLNPGM(" " STR_INVALID_EXTRUDER " ", e);
return -1;
}
#if HAS_TOOLCHANGE
if (parser.seenval('T')) {
const int8_t e = parser.value_byte();
if (e < EXTRUDERS) return e;
SERIAL_ECHO_START();
SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum);
SERIAL_ECHOLNPGM(" " STR_INVALID_EXTRUDER " ", e);
return -1;
}
#endif
return active_extruder;
}
@@ -669,7 +671,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 92: M92(); break; // M92: Set the steps-per-unit for one or more axes
case 114: M114(); break; // M114: Report current position
case 115: M115(); break; // M115: Report capabilities
#if ENABLED(CAPABILITIES_REPORT)
case 115: M115(); break; // M115: Report capabilities
#endif
case 117: TERN_(HAS_STATUS_MESSAGE, M117()); break; // M117: Set LCD message text, if possible
@@ -945,7 +950,9 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
case 600: M600(); break; // M600: Pause for Filament Change
case 603: M603(); break; // M603: Configure Filament Change
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
case 603: M603(); break; // M603: Configure Filament Change
#endif
#endif
#if HAS_DUPLICATION_MODE
+6 -3
View File
@@ -149,7 +149,7 @@
*
* M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE)
* M114 - Report current position.
* M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT)
* M115 - Report capabilities. (Requires CAPABILITIES_REPORT)
* M117 - Display a message on the controller screen. (Requires an LCD)
* M118 - Display a message in the host console.
*
@@ -760,7 +760,10 @@ private:
#endif
static void M114();
static void M115();
#if ENABLED(CAPABILITIES_REPORT)
static void M115();
#endif
#if HAS_STATUS_MESSAGE
static void M117();
@@ -1282,7 +1285,7 @@ private:
static void M710_report(const bool forReplay=true);
#endif
static void T(const int8_t tool_index);
static void T(const int8_t tool_index) IF_DISABLED(HAS_TOOLCHANGE, { UNUSED(tool_index); });
};
+6 -1
View File
@@ -20,8 +20,11 @@
*
*/
#include "../gcode.h"
#include "../../inc/MarlinConfig.h"
#if ENABLED(CAPABILITIES_REPORT)
#include "../gcode.h"
#include "../queue.h" // for getting the command port
#if ENABLED(M115_GEOMETRY_REPORT)
@@ -271,3 +274,5 @@ void GcodeSuite::M115() {
#endif // EXTENDED_CAPABILITIES_REPORT
}
#endif // CAPABILITIES_REPORT
-4
View File
@@ -34,10 +34,6 @@
#include "../../feature/probe_temp_comp.h"
#endif
#if HAS_MULTI_HOTEND
#include "../../module/tool_change.h"
#endif
/**
* G30: Do a single Z probe at the given XY (default: current)
*
-8
View File
@@ -37,14 +37,6 @@ GCodeQueue queue;
#include "../MarlinCore.h"
#include "../core/bug_on.h"
#if ENABLED(PRINTER_EVENT_LEDS)
#include "../feature/leds/printer_event_leds.h"
#endif
#if HAS_ETHERNET
#include "../feature/ethernet.h"
#endif
#if ENABLED(BINARY_FILE_TRANSFER)
#include "../feature/binary_stream.h"
#endif
-4
View File
@@ -45,10 +45,6 @@
#endif
#endif
#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
#include "../../module/tool_change.h"
#endif
/**
* M104: Set Hotend Temperature target and return immediately
* M109: Set Hotend Temperature target and wait
+34
View File
@@ -579,6 +579,18 @@
#error "Y_DUAL_STEPPER_DRIVERS is no longer needed and should be removed."
#elif defined(NUM_Z_STEPPER_DRIVERS)
#error "NUM_Z_STEPPER_DRIVERS is no longer needed and should be removed."
#elif defined(SNMM)
#error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
#elif defined(MK2_MULTIPLEXER)
#error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
#elif defined(PRUSA_MMU2)
#error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead."
#elif defined(PRUSA_MMU2_S_MODE)
#error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead."
#elif defined(SMUFF_EMU_MMU2)
#error "SMUFF_EMU_MMU2 is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2 instead."
#elif defined(SMUFF_EMU_MMU2S)
#error "SMUFF_EMU_MMU2S is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2S instead."
#elif defined(LEVEL_BED_CORNERS)
#error "LEVEL_BED_CORNERS is now LCD_BED_TRAMMING."
#elif defined(LEVEL_CORNERS_INSET_LFRB) || defined(LEVEL_CORNERS_HEIGHT) || defined(LEVEL_CORNERS_Z_HOP) || defined(LEVEL_CORNERS_USE_PROBE) || defined(LEVEL_CORNERS_PROBE_TOLERANCE) || defined(LEVEL_CORNERS_VERIFY_RAISED) || defined(LEVEL_CORNERS_AUDIO_FEEDBACK)
@@ -673,8 +685,30 @@
#error "SDIO_SUPPORT is now ONBOARD_SDIO."
#elif defined(ANET_FULL_GRAPHICS_LCD_ALT_WIRING)
#error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING is now CTC_A10S_A13."
#elif defined(Z_PROBE_END_SCRIPT)
#error "Z_PROBE_END_SCRIPT is now EVENT_GCODE_AFTER_G29."
#endif
// Changes to Probe Temp Compensation (#17392)
#if HAS_PTC && TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
#if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
#error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
#elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
#error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
#endif
#endif
// Consolidate TMC26X, validate migration (#24373)
#define _ISMAX_1(A) defined(A##_MAX_CURRENT)
#define _ISSNS_1(A) defined(A##_SENSE_RESISTOR)
#if DO(ISMAX,||,ALL_AXIS_NAMES)
#error "*_MAX_CURRENT is now set with *_CURRENT."
#elif DO(ISSNS,||,ALL_AXIS_NAMES)
#error "*_SENSE_RESISTOR (in Milli-Ohms) is now set with *_RSENSE (in Ohms), so you must divide values by 1000."
#endif
#undef _ISMAX_1
#undef _ISSNS_1
// L64xx stepper drivers have been removed
#define _L6470 0x6470
#define _L6474 0x6474
+24 -18
View File
@@ -82,33 +82,36 @@
/**
* Multi-Material-Unit supported models
*/
#define PRUSA_MMU1 1
#define PRUSA_MMU2 2
#define PRUSA_MMU2S 3
#define EXTENDABLE_EMU_MMU2 12
#define EXTENDABLE_EMU_MMU2S 13
#ifdef MMU_MODEL
#define HAS_MMU 1
#define SINGLENOZZLE
#if MMU_MODEL == PRUSA_MMU1
#define _PRUSA_MMU1 1
#define _PRUSA_MMU2 2
#define _PRUSA_MMU2S 3
#define _EXTENDABLE_EMU_MMU2 12
#define _EXTENDABLE_EMU_MMU2S 13
#define _MMU CAT(_,MMU_MODEL)
#if _MMU == _PRUSA_MMU1
#define HAS_PRUSA_MMU1 1
#elif MMU_MODEL % 10 == PRUSA_MMU2
#elif _MMU % 10 == _PRUSA_MMU2
#define HAS_PRUSA_MMU2 1
#elif MMU_MODEL % 10 == PRUSA_MMU2S
#elif _MMU % 10 == _PRUSA_MMU2S
#define HAS_PRUSA_MMU2 1
#define HAS_PRUSA_MMU2S 1
#endif
#if MMU_MODEL >= EXTENDABLE_EMU_MMU2
#if _MMU == _EXTENDABLE_EMU_MMU2 || _MMU == _EXTENDABLE_EMU_MMU2S
#define HAS_EXTENDABLE_MMU 1
#endif
#endif
#undef PRUSA_MMU1
#undef PRUSA_MMU2
#undef PRUSA_MMU2S
#undef EXTENDABLE_EMU_MMU2
#undef EXTENDABLE_EMU_MMU2S
#undef _MMU
#undef _PRUSA_MMU1
#undef _PRUSA_MMU2
#undef _PRUSA_MMU2S
#undef _EXTENDABLE_EMU_MMU2
#undef _EXTENDABLE_EMU_MMU2S
#endif
#if ENABLED(E_DUAL_STEPPER_DRIVERS) // E0/E1 steppers act in tandem as E0
@@ -132,6 +135,9 @@
#if MIXING_STEPPERS == 2
#define HAS_DUAL_MIXING 1
#endif
#ifndef MIXING_VIRTUAL_TOOLS
#define MIXING_VIRTUAL_TOOLS 1
#endif
#elif ENABLED(SWITCHING_TOOLHEAD) // Toolchanger
@@ -566,8 +572,8 @@
#define MKS_MINI_12864
#endif
// MKS_MINI_12864_V3 and BTT_MINI_12864 have identical pinouts to FYSETC_MINI_12864_2_1
#if ANY(MKS_MINI_12864_V3, BTT_MINI_12864)
// MKS_MINI_12864_V3 , BTT_MINI_12864 and BEEZ_MINI_12864 have identical pinouts to FYSETC_MINI_12864_2_1
#if ANY(MKS_MINI_12864_V3, BTT_MINI_12864, BEEZ_MINI_12864)
#define FYSETC_MINI_12864_2_1
#endif
+10
View File
@@ -803,6 +803,10 @@
#endif
#endif
#if HAS_MULTI_EXTRUDER || HAS_MULTI_HOTEND || HAS_PRUSA_MMU2 || (ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1)
#define HAS_TOOLCHANGE 1
#endif
#if ENABLED(MIXING_EXTRUDER) && (ENABLED(RETRACT_SYNC_MIXING) || ALL(FILAMENT_LOAD_UNLOAD_GCODES, FILAMENT_UNLOAD_ALL_EXTRUDERS))
#define HAS_MIXER_SYNC_CHANNEL 1
#endif
@@ -1305,6 +1309,12 @@
#define HAS_ZV_SHAPING 1
#endif
// FT Motion unified window and batch size
#if ALL(FT_MOTION, FTM_UNIFIED_BWS)
#define FTM_WINDOW_SIZE FTM_BW_SIZE
#define FTM_BATCH_SIZE FTM_BW_SIZE
#endif
// Toolchange Event G-code
#if !HAS_MULTI_EXTRUDER || !(defined(EVENT_GCODE_TOOLCHANGE_T0) || defined(EVENT_GCODE_TOOLCHANGE_T1) || defined(EVENT_GCODE_TOOLCHANGE_T2) || defined(EVENT_GCODE_TOOLCHANGE_T3) || defined(EVENT_GCODE_TOOLCHANGE_T4) || defined(EVENT_GCODE_TOOLCHANGE_T5) || defined(EVENT_GCODE_TOOLCHANGE_T6) || defined(EVENT_GCODE_TOOLCHANGE_T7))
#undef TC_GCODE_USE_GLOBAL_X
+10 -10
View File
@@ -30,6 +30,16 @@
// Extras for CI testing
#endif
// Arduino IDE with Teensy Additions
#ifdef TEENSYDUINO
#undef max
#define max(a,b) ((a)>(b)?(a):(b))
#undef min
#define min(a,b) ((a)<(b)?(a):(b))
#undef NOT_A_PIN // Override Teensyduino legacy CapSense define work-around
#define NOT_A_PIN 0 // For PINS_DEBUGGING
#endif
// ADC
#ifdef BOARD_ADC_VREF_MV
#define ADC_VREF_MV BOARD_ADC_VREF_MV
@@ -64,16 +74,6 @@
#undef OTA_FIRMWARE_UPDATE
#endif
#ifdef TEENSYDUINO
#undef max
#define max(a,b) ((a)>(b)?(a):(b))
#undef min
#define min(a,b) ((a)<(b)?(a):(b))
#undef NOT_A_PIN // Override Teensyduino legacy CapSense define work-around
#define NOT_A_PIN 0 // For PINS_DEBUGGING
#endif
/**
* Axis lengths and center
*/
+13 -45
View File
@@ -116,17 +116,6 @@
constexpr float arm[] = AXIS_RELATIVE_MODES;
static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements.");
// Consolidate TMC26X, validate migration (#24373)
#define _ISMAX_1(A) defined(A##_MAX_CURRENT)
#define _ISSNS_1(A) defined(A##_SENSE_RESISTOR)
#if DO(ISMAX,||,ALL_AXIS_NAMES)
#error "*_MAX_CURRENT is now set with *_CURRENT."
#elif DO(ISSNS,||,ALL_AXIS_NAMES)
#error "*_SENSE_RESISTOR (in Milli-Ohms) is now set with *_RSENSE (in Ohms), so you must divide values by 1000."
#endif
#undef _ISMAX_1
#undef _ISSNS_1
/**
* RADDS is forbidden for non-DUE boards, for now.
*/
@@ -160,16 +149,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
* Probe temp compensation requirements
*/
#if HAS_PTC
#if TEMP_SENSOR_PROBE && TEMP_SENSOR_BED
#if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z)
#error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)."
#elif !defined(PTC_PARK_POS)
#error "PTC_PARK_POS is required for Probe Temperature Compensation."
#elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y)
#error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)."
#elif !defined(PTC_PROBE_POS)
#error "PTC_PROBE_POS is required for Probe Temperature Compensation."
#endif
#if TEMP_SENSOR_PROBE && TEMP_SENSOR_BED && !(defined(PTC_PARK_POS) && defined(PTC_PROBE_POS))
#error "PTC_PARK_POS and PTC_PROBE_POS are required for Probe Temperature Compensation."
#endif
#if ENABLED(PTC_PROBE)
@@ -611,23 +592,6 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
#endif
/**
* Sanity checking for all Průša MMU
*/
#ifdef SNMM
#error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
#elif ENABLED(MK2_MULTIPLEXER)
#error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
#elif ENABLED(PRUSA_MMU2)
#error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead."
#elif ENABLED(PRUSA_MMU2_S_MODE)
#error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead."
#elif ENABLED(SMUFF_EMU_MMU2)
#error "SMUFF_EMU_MMU2 is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2 instead."
#elif ENABLED(SMUFF_EMU_MMU2S)
#error "SMUFF_EMU_MMU2S is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2S instead."
#endif
/**
* Multi-Material-Unit 2 / EXTENDABLE_EMU_MMU2 requirements
*/
@@ -2275,7 +2239,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#endif
/**
* FYSETC/MKS/BTT Mini Panel Requirements
* FYSETC/MKS/BTT/BEEZ Mini Panel Requirements
*/
#if ANY(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1)
#ifndef NEO_RGB
@@ -2283,9 +2247,9 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
#define FAUX_RGB 1
#endif
#if defined(NEOPIXEL_TYPE) && NEOPIXEL_TYPE != NEO_RGB
#error "Your FYSETC/MKS/BTT Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB."
#error "Your FYSETC/MKS/BTT/BEEZ Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB."
#elif defined(NEOPIXEL_PIXELS) && NEOPIXEL_PIXELS < 3
#error "Your FYSETC/MKS/BTT Mini Panel requires NEOPIXEL_PIXELS >= 3."
#error "Your FYSETC/MKS/BTT/BEEZ Mini Panel requires NEOPIXEL_PIXELS >= 3."
#endif
#if FAUX_RGB
#undef NEO_RGB
@@ -2618,8 +2582,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
+ (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \
+ (ENABLED(MINIPANEL) && NONE(MKS_MINI_12864, ENDER2_STOCKDISPLAY)) \
+ (ENABLED(MKS_MINI_12864) && NONE(MKS_LCD12864A, MKS_LCD12864B)) \
+ (ENABLED(FYSETC_MINI_12864_2_1) && NONE(MKS_MINI_12864_V3, BTT_MINI_12864)) \
+ COUNT_ENABLED(MKS_MINI_12864_V3, BTT_MINI_12864) \
+ (ENABLED(FYSETC_MINI_12864_2_1) && NONE(MKS_MINI_12864_V3, BTT_MINI_12864, BEEZ_MINI_12864)) \
+ COUNT_ENABLED(MKS_MINI_12864_V3, BTT_MINI_12864, BEEZ_MINI_12864) \
+ (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \
+ (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \
+ (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \
@@ -4159,8 +4123,12 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive."
/**
* Fixed-Time Motion limitations
*/
#if ALL(FT_MOTION, MIXING_EXTRUDER)
#error "FT_MOTION does not currently support MIXING_EXTRUDER."
#if ENABLED(FT_MOTION)
#if ENABLED(MIXING_EXTRUDER)
#error "FT_MOTION does not currently support MIXING_EXTRUDER."
#elif DISABLED(FTM_UNIFIED_BWS)
#error "FT_MOTION requires FTM_UNIFIED_BWS to be enabled because FBS is not yet implemented."
#endif
#endif
// Multi-Stepping Limit
+1 -1
View File
@@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2024-01-01"
#define STRING_DISTRIBUTION_DATE "2024-01-09"
#endif
/**
+18 -3
View File
@@ -42,6 +42,14 @@
#endif
#endif
#if DISABLED(DEBUG_FLAGS_GCODE)
#warning "DEBUG_FLAGS_GCODE is recommended if you have space. Some hosts rely on it."
#endif
#if DISABLED(CAPABILITIES_REPORT)
#warning "CAPABILITIES_REPORT is recommended if you have space. Some hosts rely on it."
#endif
#if ENABLED(LA_DEBUG)
#warning "WARNING! Disable LA_DEBUG for the final build!"
#endif
@@ -695,16 +703,16 @@
#endif
/**
* FYSETC/MKS/BTT Mini Panel backlighting
* FYSETC/MKS/BTT/BEEZ Mini Panel backlighting
*/
#if ANY(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1) && !ALL(NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, LED_COLOR_PRESETS)
#warning "Your FYSETC/MKS/BTT Mini Panel works best with NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, and LED_COLOR_PRESETS."
#warning "Your FYSETC/MKS/BTT/BEEZ Mini Panel works best with NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, and LED_COLOR_PRESETS."
#endif
#if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED)
#warning "Your FYSETC Mini Panel works best with RGB_LED."
#elif ANY(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP)
#warning "Your FYSETC/MKS/BTT Mini Panel works best with LED_USER_PRESET_STARTUP."
#warning "Your FYSETC/MKS/BTT/BEEZ Mini Panel works best with LED_USER_PRESET_STARTUP."
#endif
#if ANY(FYSETC_242_OLED_12864, FYSETC_MINI_12864) && ALL(PSU_CONTROL, HAS_COLOR_LEDS) && !LED_POWEROFF_TIMEOUT
@@ -818,3 +826,10 @@
#if PIN_EXISTS(BEEPER) && ALL(SPEAKER, NO_SPEAKER)
#warning "The BEEPER cannot produce tones so you can disable SPEAKER."
#endif
/**
* Fixed-Time Motion
*/
#if ALL(FT_MOTION, I2S_STEPPER_STREAM)
#warning "FT_MOTION has not been tested with I2S_STEPPER_STREAM."
#endif
+2 -2
View File
@@ -2910,7 +2910,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
break;
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
case ADVANCED_LOAD:
if (draw) {
drawMenuItem(row, ICON_WriteEEPROM, F("Load Length"));
@@ -2927,7 +2927,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
else
modifyValue(fc_settings[0].unload_length, 0, EXTRUDE_MAXLENGTH, 1);
break;
#endif // ADVANCED_PAUSE_FEATURE
#endif // CONFIGURE_FILAMENT_CHANGE
#if ENABLED(PREVENT_COLD_EXTRUSION)
case ADVANCED_COLD_EXTRUDE:
+2 -2
View File
@@ -2306,7 +2306,7 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS,
#endif
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
void setFilLoad() { setPFloatOnClick(0, EXTRUDE_MAXLENGTH, UNITFDIGITS); }
void setFilUnload() { setPFloatOnClick(0, EXTRUDE_MAXLENGTH, UNITFDIGITS); }
#endif
@@ -3302,7 +3302,7 @@ void drawFilSetMenu() {
#if ENABLED(PREVENT_COLD_EXTRUSION)
EDIT_ITEM(ICON_ExtrudeMinT, MSG_EXTRUDER_MIN_TEMP, onDrawPIntMenu, setExtMinT, &hmiData.extMinT);
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
EDIT_ITEM(ICON_FilLoad, MSG_FILAMENT_LOAD, onDrawPFloatMenu, setFilLoad, &fc_settings[0].load_length);
EDIT_ITEM(ICON_FilUnload, MSG_FILAMENT_UNLOAD, onDrawPFloatMenu, setFilUnload, &fc_settings[0].unload_length);
#endif
@@ -1655,9 +1655,9 @@ void RTS::handleData() {
case AutolevelVal: {
uint8_t meshPoint = (recdat.addr - AutolevelVal) / 2,
yPnt = floor(meshPoint / GRID_MAX_POINTS_X),
xPnt = meshPoint - (yPnt * GRID_MAX_POINTS_X);
if (yPnt % 2 != 0) xPnt = (GRID_MAX_POINTS_X - 1) - xPnt; // zag row
yPnt = meshPoint / (GRID_MAX_POINTS_X),
xPnt = meshPoint - yPnt * (GRID_MAX_POINTS_X);
if (yPnt % 2 != 0) xPnt = (GRID_MAX_POINTS_X) - 1 - xPnt; // zag row
float meshVal = float(recdat.data[0] - (recdat.data[0] >= 32768 ? 65536 : 0)) / 1000;
+1 -3
View File
@@ -63,9 +63,7 @@ void TFT::lcdInit() {
#if PIN_EXISTS(TFT_BACKLIGHT)
OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH);
#endif
#if HAS_LOGO_IN_FLASH
delay(2000);
#endif
TERN_(HAS_LOGO_IN_FLASH, delay(2000));
}
void TFT::lcdClear(uint16_t color) {
+1 -1
View File
@@ -323,7 +323,7 @@ void NextionTFT::panelInfo(uint8_t req) {
SEND_PRINT_INFO("t8", getFilamentUsed_str);
break;
case 28: // Filament laod/unload
case 28: // Filament load/unload
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#define SEND_PAUSE_INFO(A, B) SEND_VALasTXT(A, fc_settings[getActiveTool()].B)
#else
+1 -1
View File
@@ -136,7 +136,7 @@ void menu_backlash();
}
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
constexpr float extrude_maxlength = TERN(PREVENT_LENGTHY_EXTRUDE, EXTRUDE_MAXLENGTH, 999);
EDIT_ITEM_FAST(float4, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength);
-4
View File
@@ -39,10 +39,6 @@
#include "../../feature/cooler.h"
#endif
#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
#include "../../module/tool_change.h"
#endif
//
// "Temperature" submenu items
//
-4
View File
@@ -34,10 +34,6 @@
#include "../../module/temperature.h"
#include "../../MarlinCore.h"
#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
#include "../../module/tool_change.h"
#endif
#if HAS_LEVELING
#include "../../feature/bedlevel/bedlevel.h"
#endif
+1 -1
View File
@@ -58,7 +58,7 @@ void TFT_String::set_font(const uint8_t *font) {
for (glyph = 0; glyph < EXTRA_GLYPHS; glyph++) glyphs_extra[glyph] = nullptr;
#endif
DEBUG_ECHOLNPGM("Format: ", ((unifont_t *)font_header)->format);
DEBUG_ECHOLNPGM("format: ", ((unifont_t *)font_header)->format);
DEBUG_ECHOLNPGM("capitalAHeight: ", ((unifont_t *)font_header)->capitalAHeight);
DEBUG_ECHOLNPGM("fontStartEncoding: ", ((unifont_t *)font_header)->fontStartEncoding);
DEBUG_ECHOLNPGM("fontEndEncoding: ", ((unifont_t *)font_header)->fontEndEncoding);
+16 -16
View File
@@ -111,37 +111,37 @@ void TFT_IO::initTFT() {
switch (lcd_id) {
case LTDC_RGB:
break;
case ST7796: // ST7796S 480x320
DEBUG_ECHO_MSG(" ST7796S");
case ST7796:
DEBUG_ECHO_MSG(" ST7796S"); // 480x320
write_esc_sequence(st7796s_init);
break;
case ST7789: // ST7789V 320x240
DEBUG_ECHO_MSG(" ST7789V");
case ST7789:
DEBUG_ECHO_MSG(" ST7789V"); // 320x240
write_esc_sequence(st7789v_init);
break;
case SSD1963: // SSD1963
case SSD1963:
DEBUG_ECHO_MSG(" SSD1963");
write_esc_sequence(ssd1963_init);
break;
case ST7735: // ST7735 160x128
DEBUG_ECHO_MSG(" ST7735");
case ST7735:
DEBUG_ECHO_MSG(" ST7735"); // 160x128
write_esc_sequence(st7735_init);
break;
case R61505: // R61505U 320x240
DEBUG_ECHO_MSG(" R61505U");
case R61505:
DEBUG_ECHO_MSG(" R61505U"); // 320x240
write_esc_sequence(r61505_init);
break;
case ILI9328: // ILI9328 320x240
DEBUG_ECHO_MSG(" ILI9328");
case ILI9328:
DEBUG_ECHO_MSG(" ILI9328"); // 320x240
write_esc_sequence(ili9328_init);
break;
case ILI9341: // ILI9341 320x240
DEBUG_ECHO_MSG(" ILI9341");
case ILI9341:
DEBUG_ECHO_MSG(" ILI9341"); // 320x240
write_esc_sequence(ili9341_init);
break;
case ILI9488: // ILI9488 480x320
case ILI9488_ID1: // 0x8066 ILI9488 480x320
DEBUG_ECHO_MSG(" ILI9488");
case ILI9488:
case ILI9488_ID1:
DEBUG_ECHO_MSG(" ILI9488"); // 480x320
write_esc_sequence(ili9488_init);
break;
default:
+1 -1
View File
@@ -38,7 +38,7 @@
#endif
#ifndef TFT_DRIVER
#define TFT_DRIVER AUTO
#define TFT_DRIVER AUTO
#endif
#define ESC_REG(x) 0xFFFF, 0x00FF & (uint16_t)x
+26 -15
View File
@@ -55,8 +55,8 @@ FTMotion ftMotion;
ft_config_t FTMotion::cfg;
bool FTMotion::busy; // = false
ft_command_t FTMotion::stepperCmdBuff[FTM_STEPPERCMD_BUFF_SIZE] = {0U}; // Stepper commands buffer.
uint32_t FTMotion::stepperCmdBuff_produceIdx = 0, // Index of next stepper command write to the buffer.
FTMotion::stepperCmdBuff_consumeIdx = 0; // Index of next stepper command read from the buffer.
int32_t FTMotion::stepperCmdBuff_produceIdx = 0, // Index of next stepper command write to the buffer.
FTMotion::stepperCmdBuff_consumeIdx = 0; // Index of next stepper command read from the buffer.
bool FTMotion::sts_stepperBusy = false; // The stepper buffer has items and is in use.
@@ -123,6 +123,8 @@ uint32_t FTMotion::interpIdx = 0, // Index of current data point b
float FTMotion::e_advanced_z1 = 0.0f; // (ms) Unit delay of advanced extruder position.
#endif
constexpr uint32_t last_batchIdx = (FTM_WINDOW_SIZE) - (FTM_BATCH_SIZE);
//-----------------------------------------------------------------
// Function definitions.
//-----------------------------------------------------------------
@@ -145,8 +147,16 @@ void FTMotion::runoutBlock() {
ratio.reset();
max_intervals = cfg.modeHasShaper() ? shaper_intervals : 0;
if (max_intervals <= TERN(FTM_UNIFIED_BWS, FTM_BW_SIZE, min_max_intervals - (FTM_BATCH_SIZE))) max_intervals = min_max_intervals;
max_intervals += TERN(FTM_UNIFIED_BWS, FTM_BW_SIZE, FTM_WINDOW_SIZE) - makeVector_batchIdx;
if (max_intervals <= TERN(FTM_UNIFIED_BWS, FTM_BATCH_SIZE, min_max_intervals - (FTM_BATCH_SIZE)))
max_intervals = min_max_intervals;
max_intervals += (
#if ENABLED(FTM_UNIFIED_BWS)
FTM_WINDOW_SIZE - makeVector_batchIdx
#else
FTM_WINDOW_SIZE - ((last_batchIdx < (FTM_BATCH_SIZE)) ? 0 : makeVector_batchIdx)
#endif
);
blockProcRdy = blockDataIsRunout = true;
runoutEna = blockProcDn = false;
}
@@ -198,7 +208,7 @@ void FTMotion::loop() {
);
// Shift the time series back in the window
#define TSHIFT(A) memcpy(traj.A, &traj.A[FTM_BATCH_SIZE], (FTM_WINDOW_SIZE - FTM_BATCH_SIZE) * sizeof(traj.A[0]))
#define TSHIFT(A) memcpy(traj.A, &traj.A[FTM_BATCH_SIZE], last_batchIdx * sizeof(traj.A[0]))
LOGICAL_AXIS_CODE(
TSHIFT(e),
TSHIFT(x), TSHIFT(y), TSHIFT(z),
@@ -219,7 +229,7 @@ void FTMotion::loop() {
&& (interpIdx - interpIdx_z1 < (FTM_STEPS_PER_LOOP))
) {
convertToSteps(interpIdx);
if (++interpIdx == TERN(FTM_UNIFIED_BWS, FTM_BW_SIZE, FTM_BATCH_SIZE)) {
if (++interpIdx == FTM_BATCH_SIZE) {
batchRdyForInterp = false;
interpIdx = 0;
}
@@ -449,7 +459,7 @@ void FTMotion::reset() {
endPosn_prevBlock.reset();
makeVector_idx = makeVector_idx_z1 = 0;
makeVector_batchIdx = 0;
makeVector_batchIdx = TERN(FTM_UNIFIED_BWS, 0, _MAX(last_batchIdx, FTM_BATCH_SIZE));
steps.reset();
interpIdx = interpIdx_z1 = 0;
@@ -464,10 +474,11 @@ void FTMotion::reset() {
}
// Private functions.
// Auxiliary function to get number of step commands in the buffer.
uint32_t FTMotion::stepperCmdBuffItems() {
const uint32_t udiff = stepperCmdBuff_produceIdx - stepperCmdBuff_consumeIdx;
return stepperCmdBuff_produceIdx < stepperCmdBuff_consumeIdx ? (FTM_STEPPERCMD_BUFF_SIZE) + udiff : udiff;
int32_t FTMotion::stepperCmdBuffItems() {
const int32_t udiff = stepperCmdBuff_produceIdx - stepperCmdBuff_consumeIdx;
return (udiff < 0) ? udiff + (FTM_STEPPERCMD_BUFF_SIZE) : udiff;
}
// Initializes storage variables before startup.
@@ -544,9 +555,9 @@ void FTMotion::loadBlockData(block_t * const current_block) {
const float T1 = (F_n - f_s) * oneOverAccel,
T3 = (F_n - f_e) * oneOverAccel;
N1 = ceil(T1 * (FTM_FS)); // Accel datapoints based on Hz frequency
N2 = ceil(T2 * (FTM_FS)); // Coast
N3 = ceil(T3 * (FTM_FS)); // Decel
N1 = CEIL(T1 * (FTM_FS)); // Accel datapoints based on Hz frequency
N2 = CEIL(T2 * (FTM_FS)); // Coast
N3 = CEIL(T3 * (FTM_FS)); // Decel
const float T1_P = N1 * (FTM_TS), // (s) Accel datapoints x timestep resolution
T2_P = N2 * (FTM_TS), // (s) Coast
@@ -677,8 +688,8 @@ void FTMotion::makeVector() {
#endif
// Filled up the queue with regular and shaped steps
if (++makeVector_batchIdx == TERN(FTM_UNIFIED_BWS, FTM_BW_SIZE, (FTM_WINDOW_SIZE - FTM_BATCH_SIZE))) {
makeVector_batchIdx = 0;
if (++makeVector_batchIdx == FTM_WINDOW_SIZE) {
makeVector_batchIdx = last_batchIdx;
batchRdy = true;
}
+7 -8
View File
@@ -102,12 +102,11 @@ class FTMotion {
}
static ft_command_t stepperCmdBuff[FTM_STEPPERCMD_BUFF_SIZE]; // Buffer of stepper commands.
static uint32_t stepperCmdBuff_produceIdx, // Index of next stepper command write to the buffer.
stepperCmdBuff_consumeIdx; // Index of next stepper command read from the buffer.
static int32_t stepperCmdBuff_produceIdx, // Index of next stepper command write to the buffer.
stepperCmdBuff_consumeIdx; // Index of next stepper command read from the buffer.
static bool sts_stepperBusy; // The stepper buffer has items and is in use.
// Public methods
static void init();
static void startBlockProc(); // Set controller states to begin processing a block.
@@ -153,10 +152,10 @@ class FTMotion {
static uint32_t N1, N2, N3;
static uint32_t max_intervals;
static constexpr uint32_t _ftm_size = TERN(FTM_UNIFIED_BWS, FTM_BW_SIZE, FTM_BATCH_SIZE),
_ftm_wind = TERN(FTM_UNIFIED_BWS, 2, CEIL((FTM_WINDOW_SIZE) / _ftm_size)),
shaper_intervals = _ftm_size * CEIL((FTM_ZMAX) / _ftm_size),
min_max_intervals = _ftm_size * _ftm_wind;
#define _DIVCEIL(A,B) (((A) + (B) - 1) / (B))
static constexpr uint32_t _ftm_ratio = TERN(FTM_UNIFIED_BWS, 2, _DIVCEIL(FTM_WINDOW_SIZE, FTM_BATCH_SIZE)),
shaper_intervals = (FTM_BATCH_SIZE) * _DIVCEIL(FTM_ZMAX, FTM_BATCH_SIZE),
min_max_intervals = (FTM_BATCH_SIZE) * _ftm_ratio;
// Make vector variables.
static uint32_t makeVector_idx,
@@ -203,7 +202,7 @@ class FTMotion {
#endif
// Private methods
static uint32_t stepperCmdBuffItems();
static int32_t stepperCmdBuffItems();
static void loadBlockData(block_t *const current_block);
static void makeVector();
static void convertToSteps(const uint32_t idx);
+15 -22
View File
@@ -24,35 +24,28 @@
#include "../core/types.h"
typedef enum FXDTICtrlMode : uint8_t {
ftMotionMode_DISABLED = 0U,
ftMotionMode_ENABLED = 1U,
//ftMotionMode_ULENDO_FBS = 2U,
ftMotionMode_ZV = 10U,
ftMotionMode_ZVD = 11U,
ftMotionMode_ZVDD = 12U,
ftMotionMode_ZVDDD = 13U,
ftMotionMode_EI = 14U,
ftMotionMode_2HEI = 15U,
ftMotionMode_3HEI = 16U,
ftMotionMode_MZV = 17U,
//ftMotionMode_DISCTF = 20U
ftMotionMode_DISABLED = 0, // Standard Motion
ftMotionMode_ENABLED = 1, // Time-Based Motion
ftMotionMode_ZV = 10, // Zero Vibration
ftMotionMode_ZVD = 11, // Zero Vibration and Derivative
ftMotionMode_ZVDD = 12, // Zero Vibration, Derivative, and Double Derivative
ftMotionMode_ZVDDD = 13, // Zero Vibration, Derivative, Double Derivative, and Triple Derivative
ftMotionMode_EI = 14, // Extra-Intensive
ftMotionMode_2HEI = 15, // 2-Hump Extra-Intensive
ftMotionMode_3HEI = 16, // 3-Hump Extra-Intensive
ftMotionMode_MZV = 17 // Mass-based Zero Vibration
} ftMotionMode_t;
enum dynFreqMode_t : uint8_t {
dynFreqMode_DISABLED = 0U,
dynFreqMode_Z_BASED = 1U,
dynFreqMode_MASS_BASED = 2U
dynFreqMode_DISABLED = 0,
dynFreqMode_Z_BASED = 1,
dynFreqMode_MASS_BASED = 2
};
#define IS_EI_MODE(N) WITHIN(N, ftMotionMode_EI, ftMotionMode_3HEI)
#if ENABLED(FTM_UNIFIED_BWS)
typedef struct XYZEarray<float, FTM_BW_SIZE> xyze_trajectory_t;
typedef struct XYZEarray<float, FTM_BW_SIZE> xyze_trajectoryMod_t;
#else
typedef struct XYZEarray<float, FTM_WINDOW_SIZE> xyze_trajectory_t;
typedef struct XYZEarray<float, FTM_BATCH_SIZE> xyze_trajectoryMod_t;
#endif
typedef struct XYZEarray<float, FTM_WINDOW_SIZE> xyze_trajectory_t;
typedef struct XYZEarray<float, FTM_BATCH_SIZE> xyze_trajectoryMod_t;
enum {
LIST_N(DOUBLE(LOGICAL_AXES),
+6 -12
View File
@@ -36,7 +36,7 @@
*/
// Change EEPROM version if the structure changes
#define EEPROM_VERSION "V89"
#define EEPROM_VERSION "V90"
#define EEPROM_OFFSET 100
// Check the integrity of data offsets.
@@ -508,7 +508,7 @@ typedef struct SettingsDataStruct {
//
// ADVANCED_PAUSE_FEATURE
//
#if HAS_EXTRUDERS
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
fil_change_settings_t fc_settings[EXTRUDERS]; // M603 T U L
#endif
@@ -1551,11 +1551,8 @@ void MarlinSettings::postprocess() {
//
// Advanced Pause filament load & unload lengths
//
#if HAS_EXTRUDERS
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
{
#if DISABLED(ADVANCED_PAUSE_FEATURE)
const fil_change_settings_t fc_settings[EXTRUDERS] = { 0, 0 };
#endif
_FIELD_TEST(fc_settings);
EEPROM_WRITE(fc_settings);
}
@@ -2626,11 +2623,8 @@ void MarlinSettings::postprocess() {
//
// Advanced Pause filament load & unload lengths
//
#if HAS_EXTRUDERS
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
{
#if DISABLED(ADVANCED_PAUSE_FEATURE)
fil_change_settings_t fc_settings[EXTRUDERS];
#endif
_FIELD_TEST(fc_settings);
EEPROM_READ(fc_settings);
}
@@ -3549,7 +3543,7 @@ void MarlinSettings::reset() {
//
// Advanced Pause filament load & unload lengths
//
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
EXTRUDER_LOOP() {
fc_settings[e].unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH;
fc_settings[e].load_length = FILAMENT_CHANGE_FAST_LOAD_LENGTH;
@@ -3924,7 +3918,7 @@ void MarlinSettings::reset() {
//
// Advanced Pause filament load & unload lengths
//
TERN_(ADVANCED_PAUSE_FEATURE, gcode.M603_report(forReplay));
TERN_(CONFIGURE_FILAMENT_CHANGE, gcode.M603_report(forReplay));
//
// Tool-changing Parameters
+16 -9
View File
@@ -1508,14 +1508,12 @@ void Stepper::isr() {
#if ENABLED(FT_MOTION)
if (using_ftMotion) {
if (!nextMainISR) {
nextMainISR = FTM_MIN_TICKS;
ftMotion_stepper();
endstops.update();
TERN_(BABYSTEPPING, if (babystep.has_steps()) babystepping_isr());
if (!nextMainISR) { // Main ISR is ready to fire during this iteration?
nextMainISR = FTM_MIN_TICKS; // Set to minimum interval (a limit on the top speed)
ftMotion_stepper(); // Run FTM Stepping
}
interval = nextMainISR;
nextMainISR -= interval;
interval = nextMainISR; // Interval is either some old nextMainISR or FTM_MIN_TICKS
nextMainISR = 0; // For FT Motion fire again ASAP
}
#endif
@@ -3161,7 +3159,7 @@ void Stepper::init() {
factor2 += -7.58095488 * zeta2;
const float zeta3 = zeta2 * zeta;
factor2 += 43.073216 * zeta3;
factor2 = floor(factor2);
factor2 = FLOOR(factor2);
}
const bool was_on = hal.isr_state();
@@ -3448,7 +3446,8 @@ void Stepper::report_positions() {
// Use one byte to restore one stepper command in the format:
// |X_step|X_direction|Y_step|Y_direction|Z_step|Z_direction|E_step|E_direction|
const ft_command_t command = ftMotion.stepperCmdBuff[ftMotion.stepperCmdBuff_consumeIdx];
if (++ftMotion.stepperCmdBuff_consumeIdx == (FTM_STEPPERCMD_BUFF_SIZE)) ftMotion.stepperCmdBuff_consumeIdx = 0U;
if (++ftMotion.stepperCmdBuff_consumeIdx == (FTM_STEPPERCMD_BUFF_SIZE))
ftMotion.stepperCmdBuff_consumeIdx = 0;
if (abort_current_block) return;
@@ -3492,6 +3491,8 @@ void Stepper::report_positions() {
U_APPLY_STEP(axis_did_move.u, false), V_APPLY_STEP(axis_did_move.v, false), W_APPLY_STEP(axis_did_move.w, false)
);
TERN_(I2S_STEPPER_STREAM, i2s_push_sample());
// Begin waiting for the minimum pulse duration
START_TIMED_PULSE();
@@ -3533,6 +3534,12 @@ void Stepper::report_positions() {
U_APPLY_STEP(!STEP_STATE_U, false), V_APPLY_STEP(!STEP_STATE_V, false), W_APPLY_STEP(!STEP_STATE_W, false)
);
// Check endstops on every step
IF_DISABLED(ENDSTOP_INTERRUPTS_FEATURE, endstops.update());
// Also handle babystepping here
TERN_(BABYSTEPPING, if (babystep.has_steps()) babystepping_isr());
} // Stepper::ftMotion_stepper
void Stepper::ftMotion_blockQueueUpdate() {
+3 -7
View File
@@ -182,10 +182,6 @@
#include "../feature/joystick.h"
#endif
#if ENABLED(SINGLENOZZLE)
#include "tool_change.h"
#endif
#if HAS_BEEPER
#include "../libs/buzzer.h"
#endif
@@ -849,9 +845,9 @@ volatile bool Temperature::raw_temps_ready = false;
#if ANY(PIDTEMPBED, PIDTEMPCHAMBER)
FSTR_P const estring = GHV(F("chamber"), F("bed"), FPSTR(NUL_STR));
say_default_(); SERIAL_ECHO(estring, F("Kp "), tune_pid.p);
say_default_(); SERIAL_ECHO(estring, F("Ki "), tune_pid.i);
say_default_(); SERIAL_ECHO(estring, F("Kd "), tune_pid.d);
say_default_(); SERIAL_ECHOLN(estring, F("Kp "), tune_pid.p);
say_default_(); SERIAL_ECHOLN(estring, F("Ki "), tune_pid.i);
say_default_(); SERIAL_ECHOLN(estring, F("Kd "), tune_pid.d);
#else
say_default_(); SERIAL_ECHOLNPGM("Kp ", tune_pid.p);
say_default_(); SERIAL_ECHOLNPGM("Ki ", tune_pid.i);
+4
View File
@@ -22,6 +22,8 @@
#include "../inc/MarlinConfigPre.h"
#if HAS_TOOLCHANGE
#include "tool_change.h"
#include "motion.h"
@@ -1629,3 +1631,5 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
}
#endif // TOOLCHANGE_MIGRATION_FEATURE
#endif // HAS_TOOLCHANGE
+3 -1
View File
@@ -34,7 +34,9 @@
//
// I2S (steppers & other output-only pins)
//
#define I2S_STEPPER_STREAM
#ifndef I2S_STEPPER_STREAM
#define I2S_STEPPER_STREAM
#endif
#if ENABLED(I2S_STEPPER_STREAM)
#define I2S_WS 17
#define I2S_BCK 22
+3 -1
View File
@@ -32,7 +32,9 @@
//
// I2S (steppers & other output-only pins)
//
#define I2S_STEPPER_STREAM
#ifndef I2S_STEPPER_STREAM
#define I2S_STEPPER_STREAM
#endif
#if ENABLED(I2S_STEPPER_STREAM)
#define I2S_WS 25
#define I2S_BCK 26
+4 -2
View File
@@ -56,7 +56,9 @@
//
// Enable I2S stepper stream
//
#define I2S_STEPPER_STREAM
#ifndef I2S_STEPPER_STREAM
#define I2S_STEPPER_STREAM
#endif
#if ENABLED(I2S_STEPPER_STREAM)
#define I2S_WS 26
#define I2S_BCK 25
@@ -169,7 +171,7 @@
#define DOGLCD_A0 EXP1_07_PIN
#define LCD_RESET_PIN -1
#elif ENABLED(FYSETC_MINI_12864_2_1)
// MKS_MINI_12864_V3, BTT_MINI_12864, FYSETC_MINI_12864_2_1
// MKS_MINI_12864_V3, BTT_MINI_12864, FYSETC_MINI_12864_2_1, BEEZ_MINI_12864
#define DOGLCD_CS EXP1_03_PIN
#define DOGLCD_A0 EXP1_04_PIN
#define LCD_RESET_PIN EXP1_05_PIN
+3 -1
View File
@@ -85,7 +85,9 @@
//
// Enable I2S stepper stream
//
#define I2S_STEPPER_STREAM
#ifndef I2S_STEPPER_STREAM
#define I2S_STEPPER_STREAM
#endif
#if ENABLED(I2S_STEPPER_STREAM)
#define I2S_WS 26
#define I2S_BCK 25
+3 -1
View File
@@ -51,7 +51,9 @@
//
// Enable I2S stepper stream
//
#define I2S_STEPPER_STREAM
#ifndef I2S_STEPPER_STREAM
#define I2S_STEPPER_STREAM
#endif
#if ENABLED(I2S_STEPPER_STREAM)
#define I2S_WS 26
#define I2S_BCK 25
+3 -1
View File
@@ -34,4 +34,6 @@
//
// I2S (steppers & other output-only pins)
//
#define I2S_STEPPER_STREAM
#ifndef I2S_STEPPER_STREAM
#define I2S_STEPPER_STREAM
#endif
+3 -3
View File
@@ -187,7 +187,7 @@
*
* Only the following displays are supported:
* ZONESTAR_LCD
* CTC_A10S_A13G
* CTC_A10S_A13
* REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
*/
@@ -209,10 +209,10 @@
#elif IS_RRD_FG_SC
// Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics
// display using an adapter board // https://go.aisler.net/benlye/anet-lcd-adapter/pcb
// display using an adapter board. See https://go.aisler.net/benlye/anet-lcd-adapter/pcb
// See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748
#if ENABLED(CTC_A10S_A13G)
#if ENABLED(CTC_A10S_A13)
/**
* CTC_A10S_A13 pinout
@@ -238,7 +238,7 @@
#endif
/**
* FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 display pinout
* FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 / BEEZ_MINI_12864 display pinout
*
* Board Display
* ------ ------
@@ -251,13 +251,13 @@
* EXP1 EXP1
*
*
* ----- ------
* --- ------
* | 1 | RST -- |10 9 | --
* | 2 | PA3 RX2 RESET_BTN | 8 7 | SD_DETECT
* | 3 | PA2 TX2 LCD_MOSI | 6 5 EN2
* | 4 | GND -- | 4 3 | EN1
* | 5 | 5V LCD_SCK | 2 1 | --
* ----- ------
* --- ------
* TFT EXP2
*
@@ -275,11 +275,11 @@
#elif ENABLED(FYSETC_MINI_12864_2_1)
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
#error "CAUTION! FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 / BEEZ_MINI_12864 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
#endif
/**
* FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 display pinout
* FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 / BEEZ_MINI_12864 display pinout
*
* Board Display
* ------ ------
+1
View File
@@ -18,6 +18,7 @@ opt_set E0_AUTO_FAN_PIN PC10 E1_AUTO_FAN_PIN PC11 E2_AUTO_FAN_PIN PC12 NEOPIXEL_
opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER BLTOUCH NEOPIXEL_LED Z_SAFE_HOMING NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE \
FILAMENT_RUNOUT_SENSOR FIL_RUNOUT4_PULLUP FIL_RUNOUT8_PULLUP FILAMENT_CHANGE_RESUME_ON_INSERT PAUSE_REHEAT_FAST_RESUME \
LCD_BED_TRAMMING BED_TRAMMING_USE_PROBE
opt_disable CONFIGURE_FILAMENT_CHANGE
exec_test $1 $2 "BigTreeTech GTR | 8 Extruders | Auto-Fan | Mixed TMC Drivers | Runout Sensors w/ distinct states" "$3"
restore_configs
+1
View File
@@ -16,6 +16,7 @@ exec_test $1 $2 "Archim 1 base configuration" "$3"
# Test Archim 2
#
use_example_configs UltiMachine/Archim2
opt_enable USB_FLASH_DRIVE_SUPPORT
exec_test $1 $2 "Archim 2 base configuration" "$3"
restore_configs
+2 -2
View File
@@ -87,7 +87,7 @@ opt_disable X_DRIVER_TYPE Y_DRIVER_TYPE Z_DRIVER_TYPE
exec_test $1 $2 "E Axis Only | DOGM MarlinUI" "$3"
#
# Mixing Extruder with 5 steppers, Greek
# Mixing Extruder with 5 steppers, Russian
#
restore_configs
opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO MIXING_STEPPERS 5 LCD_LANGUAGE ru \
@@ -98,7 +98,7 @@ opt_enable MIXING_EXTRUDER GRADIENT_MIX GRADIENT_VTOOL CR10_STOCKDISPLAY \
XY_AFTER_HOMING EVENT_GCODE_AFTER_HOMING \
FILAMENT_RUNOUT_SENSOR ADVANCED_PAUSE_FEATURE NOZZLE_PARK_FEATURE INPUT_SHAPING_X INPUT_SHAPING_Y
opt_disable DISABLE_OTHER_EXTRUDERS
exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Input Shaping | Greek" "$3"
exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Input Shaping | Russian" "$3"
#
# Test SPEAKER with BOARD_BQ_ZUM_MEGA_3D and BQ_LCD_SMART_CONTROLLER
+1 -1
View File
@@ -1,5 +1,5 @@
# Marlin Binary File Transfer (BFT)
Marlin is capable of transferring binary data to the internal storage (SD card) via serial when built with `BINARY_FILE_TRANSFER` enabled. The following is a description of the binary protocol that must be used to conduct transfers once the printer is in binary mode after running `M28 B1`.
Marlin is capable of transferring binary data to the internal storage (SD card) via serial when built with `BINARY_FILE_TRANSFER` enabled. The following is a description of the binary protocol that must be used to conduct transfers once the printer is in binary mode after running `M28 B1`.
## Data Endianness
All data structures are **little-endian**! This means that when constructing the packets with multi-byte values, the lower bits are packed first. For example, each packet should start with a 16-bit start token with the value of `0xB5AD`. The data itself should start with a value of `0xAD` followed by `0xB5` etc.
+11 -9
View File
@@ -13,15 +13,17 @@
# Espressif ESP32
#
[env:esp32]
platform = espressif32@2.1.0
board = esp32dev
build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0
build_src_filter = ${common.default_src_filter} +<src/HAL/ESP32>
lib_ignore = NativeEthernet
upload_speed = 500000
monitor_speed = 250000
monitor_filters = colorize, time, send_on_enter, log2file, esp32_exception_decoder
#upload_port = marlinesp.local
platform = espressif32@2.1.0
platform_packages = espressif/toolchain-xtensa-esp32s3
board = esp32dev
build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0 -std=gnu++17
build_unflags = -std=gnu11 -std=gnu++11
build_src_filter = ${common.default_src_filter} +<src/HAL/ESP32>
lib_ignore = NativeEthernet
upload_speed = 500000
monitor_speed = 250000
monitor_filters = colorize, time, send_on_enter, log2file, esp32_exception_decoder
#upload_port = marlinesp.local
#board_build.flash_mode = qio
[env:FYSETC_E4]
+4 -1
View File
@@ -259,7 +259,8 @@ MIXING_EXTRUDER = build_src_filter=+<src/feature/mixing.c
HAS_PRUSA_MMU1 = build_src_filter=+<src/feature/mmu/mmu.cpp>
HAS_PRUSA_MMU2 = build_src_filter=+<src/feature/mmu/mmu2.cpp> +<src/gcode/feature/prusa_MMU2>
PASSWORD_FEATURE = build_src_filter=+<src/feature/password> +<src/gcode/feature/password>
ADVANCED_PAUSE_FEATURE = build_src_filter=+<src/feature/pause.cpp> +<src/gcode/feature/pause/M600.cpp> +<src/gcode/feature/pause/M603.cpp>
ADVANCED_PAUSE_FEATURE = build_src_filter=+<src/feature/pause.cpp> +<src/gcode/feature/pause/M600.cpp>
CONFIGURE_FILAMENT_CHANGE = build_src_filter=+<src/gcode/feature/pause/M603.cpp>
PSU_CONTROL = build_src_filter=+<src/feature/power.cpp>
HAS_POWER_MONITOR = build_src_filter=+<src/feature/power_monitor.cpp> +<src/gcode/feature/power_monitor>
POWER_LOSS_RECOVERY = build_src_filter=+<src/feature/powerloss.cpp> +<src/gcode/feature/powerloss>
@@ -305,6 +306,7 @@ SERVO_DETACH_GCODE = build_src_filter=+<src/gcode/control/M2
HAS_DUPLICATION_MODE = build_src_filter=+<src/gcode/control/M605.cpp>
SPI_FLASH_BACKUP = build_src_filter=+<src/gcode/control/M993_M994.cpp>
PLATFORM_M997_SUPPORT = build_src_filter=+<src/gcode/control/M997.cpp>
HAS_TOOLCHANGE = build_src_filter=+<src/gcode/control/T.cpp>
FT_MOTION = build_src_filter=+<src/module/ft_motion.cpp> +<src/gcode/feature/ft_motion>
LIN_ADVANCE = build_src_filter=+<src/gcode/feature/advance>
PHOTO_GCODE = build_src_filter=+<src/gcode/feature/camera>
@@ -322,6 +324,7 @@ CNC_COORDINATE_SYSTEMS = build_src_filter=+<src/gcode/geometry/G
HAS_HOME_OFFSET = build_src_filter=+<src/gcode/geometry/M206_M428.cpp>
EXPECTED_PRINTER_CHECK = build_src_filter=+<src/gcode/host/M16.cpp>
HOST_KEEPALIVE_FEATURE = build_src_filter=+<src/gcode/host/M113.cpp>
CAPABILITIES_REPORT = build_src_filter=+<src/gcode/host/M115.cpp>
AUTO_REPORT_POSITION = build_src_filter=+<src/gcode/host/M154.cpp>
REPETIER_GCODE_M360 = build_src_filter=+<src/gcode/host/M360.cpp>
HAS_GCODE_M876 = build_src_filter=+<src/gcode/host/M876.cpp>
+7 -2
View File
@@ -36,7 +36,8 @@ build_src_filter = ${common.default_src_filter} +<src/HAL/LINUX>
[simulator_common]
platform = native
framework =
build_flags = ${common.build_flags} -std=gnu++17 -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS -I/usr/include/SDL2 -IMarlin -IMarlin/src/HAL/NATIVE_SIM/u8g
build_flags = ${common.build_flags} -std=gnu++17 -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS
-I/usr/include/SDL2 -IMarlin -IMarlin/src/HAL/NATIVE_SIM/u8g
build_src_flags = -Wall -Wno-expansion-to-defined -Wno-deprecated-declarations -Wcast-align
release_flags = -g0 -O3 -flto
debug_build_flags = -fstack-protector-strong -g -g3 -ggdb
@@ -99,6 +100,7 @@ build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags}
[simulator_macos]
build_unflags = -lGL -fstack-protector-strong
build_flags =
-DHAS_LIBBSD
-I/opt/local/include
-I/opt/local/include/freetype2
-I/opt/local/include/SDL2/
@@ -135,5 +137,8 @@ custom_gcc = g++
[env:simulator_windows]
extends = simulator_common
build_src_flags = ${simulator_common.build_src_flags} -fpermissive
build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags} -IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows -ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp
build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags}
-IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows
-ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp
-DHAS_LIBBSD
build_type = debug
-2
View File
@@ -107,11 +107,9 @@ default_src_filter = +<src/*> -<src/config> -<src/tests>
+<src/gcode/control/M111.cpp>
+<src/gcode/control/M120_M121.cpp>
+<src/gcode/control/M999.cpp>
+<src/gcode/control/T.cpp>
+<src/gcode/geometry/G92.cpp>
+<src/gcode/host/M110.cpp>
+<src/gcode/host/M114.cpp>
+<src/gcode/host/M115.cpp>
+<src/gcode/host/M118.cpp>
+<src/gcode/host/M119.cpp>
+<src/gcode/motion/G0_G1.cpp>