Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' into mike-config
Browse files Browse the repository at this point in the history
* bugfix-2.1.x: (73 commits)
  🐛 Fix hangs in DUE native USB (MarlinFirmware#26572)
  🩹 Fix Bed PID Autotune output (MarlinFirmware#26606)
  [cron] Bump distribution date (2024-01-04)
  🎨 Clean up old #includes (MarlinFirmware#26621)
  📝 Update M493 (FT_MOTION) comments (MarlinFirmware#26620)
  🔧 CONFIGURE_FILAMENT_CHANGE - Optional M603 (MarlinFirmware#26613)
  📺 I3DBEE TECH Beez Mini 12864 (MarlinFirmware#26596)
  🔪 Options to slim M111, remove M115 (MarlinFirmware#26603)
  [cron] Bump distribution date (2024-01-03)
  🔨 BSD string workaround (MarlinFirmware#26532)
  [cron] Bump distribution date (2024-01-02)
  🧑‍💻 Update pinsformat
  🧑‍💻 Python version of pins formatting script
  [cron] Bump distribution date (2024-01-01)
  🔨 Fix formatting issue in Makefile (MarlinFirmware#26599)
  🐛 Fix homing with FT_MOTION (MarlinFirmware#26595)
  ✨ CTC_A10S_A13 (MarlinFirmware#26514)
  [cron] Bump distribution date (2023-12-31)
  🔧 Fix, extend FAN / AUTOFAN confict check (MarlinFirmware#26591)
  🩹 Restore usleep for native / sim
  ...

# Conflicts:
#	Marlin/Configuration.h
  • Loading branch information
mikezs committed Jan 11, 2024
2 parents 99b5eb1 + 991f433 commit 5071fc0
Show file tree
Hide file tree
Showing 316 changed files with 12,464 additions and 2,697 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONTAINER_IMAGE := marlin-dev

help:
@echo "Tasks for local development:"
@echo "* format-pins: Reformat all pins files
@echo "* format-pins: Reformat all pins files"
@echo "* tests-single-ci: Run a single test from inside the CI"
@echo "* tests-single-local: Run a single test locally"
@echo "* tests-single-local-docker: Run a single test locally, using docker"
Expand Down
21 changes: 13 additions & 8 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -2059,7 +2059,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

Expand Down Expand Up @@ -2348,7 +2348,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.
Expand Down Expand Up @@ -3020,6 +3020,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
Expand All @@ -3034,14 +3039,14 @@
//#define ENDER2_STOCKDISPLAY

//
// ANET and Tronxy Graphical Controller
//
// Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6
// A clone of the RepRapDiscount full graphics display but with
// different pins/wiring (see pins_ANET_10.h). Enable one of these.
// ANET and Tronxy 128×64 Full Graphics Controller as used on Anet A6
//
//#define ANET_FULL_GRAPHICS_LCD
//#define ANET_FULL_GRAPHICS_LCD_ALT_WIRING

//
// GUCOCO CTC 128×64 Full Graphics Controller as used on GUCOCO CTC A10S
//
//#define CTC_A10S_A13

//
// AZSMZ 12864 LCD with SD
Expand Down
99 changes: 66 additions & 33 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1121,42 +1121,62 @@
#if ENABLED(FT_MOTION)
#define FTM_DEFAULT_MODE ftMotionMode_DISABLED // Default mode of fixed time control. (Enums in ft_types.h)
#define FTM_DEFAULT_DYNFREQ_MODE dynFreqMode_DISABLED // Default mode of dynamic frequency calculation. (Enums in ft_types.h)
#define FTM_SHAPING_DEFAULT_X_FREQ 37.0f // (Hz) Default peak frequency used by input shapers.
#define FTM_SHAPING_DEFAULT_Y_FREQ 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.
#define FTM_SHAPING_ZETA 0.1f // Zeta used by input shapers.
#define FTM_SHAPING_V_TOL 0.05f // Vibration tolerance used by EI input shapers.
#define FTM_SHAPING_DEFAULT_X_FREQ 37.0f // (Hz) Default peak frequency used by input shapers
#define FTM_SHAPING_DEFAULT_Y_FREQ 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
#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_SHAPING_V_TOL_X 0.05f // Vibration tolerance used by EI input shapers for X 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

/**
* Advanced configuration
*/
#define FTM_BATCH_SIZE 100 // Batch size for trajectory generation;
#define FTM_WINDOW_SIZE 200 // Window size for trajectory generation.
#define FTM_FS 1000 // (Hz) Frequency for trajectory generation. (1 / FTM_TS)
#define FTM_TS 0.001f // (s) Time step for trajectory generation. (1 / FTM_FS)
#define FTM_STEPPER_FS 20000 // (Hz) Frequency for stepper I/O update.
#define FTM_MIN_TICKS ((STEPPER_TIMER_RATE) / (FTM_STEPPER_FS)) // Minimum stepper ticks between steps.
#define FTM_MIN_SHAPE_FREQ 10 // Minimum shaping frequency.
#define FTM_ZMAX 100 // Maximum delays for shaping functions (even numbers only!).
// Calculate as:
// 1/2 * (FTM_FS / FTM_MIN_SHAPE_FREQ) for ZV.
// (FTM_FS / FTM_MIN_SHAPE_FREQ) for ZVD, MZV.
// 3/2 * (FTM_FS / FTM_MIN_SHAPE_FREQ) for 2HEI.
// 2 * (FTM_FS / FTM_MIN_SHAPE_FREQ) for 3HEI.
#define FTM_STEPS_PER_UNIT_TIME 20 // Interpolated stepper commands per unit time.
// Calculate as (FTM_STEPPER_FS / FTM_FS).
#define FTM_CTS_COMPARE_VAL 10 // Comparison value used in interpolation algorithm.
// Calculate as (FTM_STEPS_PER_UNIT_TIME / 2).
// These values may be configured to adjust duration of loop().
#define FTM_STEPS_PER_LOOP 60 // Number of stepper commands to generate each loop().
#define FTM_POINTS_PER_LOOP 100 // Number of trajectory points to generate each loop().

// This value may be configured to adjust duration to consume the command buffer.
// Try increasing this value if stepper motion is not smooth.
#define FTM_STEPPERCMD_BUFF_SIZE 1000 // Size of the stepper command buffers.

//#define FT_MOTION_MENU // Provide a MarlinUI menu to set M493 parameters.
#define FTM_UNIFIED_BWS // DON'T DISABLE unless you use Ulendo FBS (not implemented)
#if ENABLED(FTM_UNIFIED_BWS)
#define FTM_BW_SIZE 100 // Unified Window and Batch size with a ratio of 2
#else
#define FTM_WINDOW_SIZE 200 // Custom Window size for trajectory generation needed by Ulendo FBS
#define FTM_BATCH_SIZE 100 // Custom Batch size for trajectory generation needed by Ulendo FBS
#endif

#define FTM_FS 1000 // (Hz) Frequency for trajectory generation. (Reciprocal of FTM_TS)
#define FTM_TS 0.001f // (s) Time step for trajectory generation. (Reciprocal of FTM_FS)

// These values may be configured to adjust the duration of loop().
#define FTM_STEPS_PER_LOOP 60 // Number of stepper commands to generate each loop()
#define FTM_POINTS_PER_LOOP 100 // Number of trajectory points to generate each loop()

#if DISABLED(COREXY)
#define FTM_STEPPER_FS 20000 // (Hz) Frequency for stepper I/O update

// Use this to adjust the time required to consume the command buffer.
// Try increasing this value if stepper motion is choppy.
#define FTM_STEPPERCMD_BUFF_SIZE 3000 // Size of the stepper command buffers
// (FTM_STEPS_PER_LOOP * FTM_POINTS_PER_LOOP) is a good start
// If you run out of memory, fall back to 3000 and increase progressively
#else
// CoreXY motion needs a larger buffer size. These values are based on our testing.
#define FTM_STEPPER_FS 30000
#define FTM_STEPPERCMD_BUFF_SIZE 6000
#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
#define FTM_RATIO (FTM_FS / FTM_MIN_SHAPE_FREQ) // Factor for use in FTM_ZMAX. DON'T CHANGE.
#define FTM_ZMAX (FTM_RATIO * 2) // Maximum delays for shaping functions (even numbers only!)
// Calculate as:
// ZV : FTM_RATIO / 2
// ZVD, MZV : FTM_RATIO
// 2HEI : FTM_RATIO * 3 / 2
// 3HEI : FTM_RATIO * 2
#endif

/**
Expand Down Expand Up @@ -1322,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.
Expand Down Expand Up @@ -2912,6 +2932,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
Expand Down Expand Up @@ -3918,6 +3939,18 @@

//#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

/**
* M115 - Report capabilites. Disable to save ~1150 bytes of flash.
* Some hosts (and serial TFT displays) rely on this feature.
*/
#define REPORT_CAPABILITIES_GCODE

/**
* Enable this option for a leaner build of Marlin that removes
* workspace offsets to slightly optimize performance.
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2023-12-14"
//#define STRING_DISTRIBUTION_DATE "2024-01-04"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
29 changes: 29 additions & 0 deletions Marlin/src/HAL/AVR/u8g/LCD_defines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* 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/>.
*
*/
#pragma once

/**
* AVR LCD-specific defines
*/

uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
#define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_AVR_sw_sp_fn
34 changes: 34 additions & 0 deletions Marlin/src/HAL/DUE/u8g/LCD_defines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* 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/>.
*
*/
#pragma once

/**
* DUE (SAM3X8E) LCD-specific defines
*/

uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);

#define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_DUE_sw_spi_fn
#define U8G_COM_HAL_HW_SPI_FN u8g_com_HAL_DUE_shared_hw_spi_fn
#define U8G_COM_ST7920_HAL_SW_SPI u8g_com_HAL_DUE_ST7920_sw_spi_fn
29 changes: 29 additions & 0 deletions Marlin/src/HAL/DUE/usb/README.md
Original file line number Diff line number Diff line change
@@ -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.
Loading

0 comments on commit 5071fc0

Please sign in to comment.