Compare commits

..

13 Commits

Author SHA1 Message Date
Scott Lahteine
5554ccb52f 🔖 Version 2.1.2.6 2026-01-15 16:27:56 -06:00
Scott Lahteine
f869f0eb3b 🔨 No such env env:DUE_debug 2026-01-15 16:27:56 -06:00
Scott Lahteine
14708a3067 Update build scripts 2026-01-14 18:28:59 -06:00
Scott Lahteine
324ce04698 🔧 Uppercase PID, etc. 2026-01-14 18:28:58 -06:00
Scott Lahteine
75a98c6181 🐛 Fix Teensy 4.x stepper timing (#28169)
🧑‍💻 Timer general cleanup
🩹 Teensy 4.x timer mods
2025-11-20 15:25:16 -06:00
ellensp
0f2a057c24 🔨🐛 Don't use broken 'board = fysetc_f6_13' (#28159) 2025-11-05 17:23:55 -06:00
ellensp
d6c4e2f98f 🐛 Fix Hotend > 0 Preheat (#27932) 2025-06-20 16:19:21 -05:00
Scott Lahteine
429b5bcd72 🩹 Fix Y_STOP_PIN alias for Y_MAX_PIN 2025-05-04 15:22:44 -05:00
ellensp
21edd52063 🐛 Fix RAMPS AUX1 RX/TX pins (#27745) 2025-03-19 15:46:52 -05:00
ellensp
a4b7341bbe 🩹 Fix missing BTT_SKR_MINI_E3_V3_0_1 include (#27696) 2025-03-19 15:46:52 -05:00
Scott Lahteine
48142ac7c6 📝 Update HAL documentation, README 2025-03-19 15:46:52 -05:00
Scott Lahteine
f0b960e2ef 🧑‍💻 Update example build scripts 2024-12-16 15:25:47 -06:00
Scott Lahteine
c7e10c5622 🩹 Fix build with Color UI touch items 2024-12-16 15:06:38 -06:00
36 changed files with 422 additions and 262 deletions

View File

@@ -35,7 +35,7 @@
*
* Advanced settings can be found in Configuration_adv.h
*/
#define CONFIGURATION_H_VERSION 02010205
#define CONFIGURATION_H_VERSION 02010206
//===========================================================================
//============================= Getting Started =============================
@@ -682,13 +682,13 @@
#if ENABLED(PID_PARAMS_PER_HOTEND)
// Specify up to one value per hotend here, according to your setup.
// If there are fewer values, the last one applies to the remaining hotends.
#define DEFAULT_Kp_LIST { 22.20, 22.20 }
#define DEFAULT_Ki_LIST { 1.08, 1.08 }
#define DEFAULT_Kd_LIST { 114.00, 114.00 }
#define DEFAULT_KP_LIST { 22.20, 22.20 }
#define DEFAULT_KI_LIST { 1.08, 1.08 }
#define DEFAULT_KD_LIST { 114.00, 114.00 }
#else
#define DEFAULT_Kp 22.20
#define DEFAULT_Ki 1.08
#define DEFAULT_Kd 114.00
#define DEFAULT_KP 22.20
#define DEFAULT_KI 1.08
#define DEFAULT_KD 114.00
#endif
#else
#define BANG_MAX 255 // Limit hotend current while in bang-bang mode; 255=full current
@@ -775,9 +775,9 @@
// 120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
// from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
#define DEFAULT_bedKp 10.00
#define DEFAULT_bedKi .023
#define DEFAULT_bedKd 305.4
#define DEFAULT_BED_KP 10.00
#define DEFAULT_BED_KI .023
#define DEFAULT_BED_KD 305.4
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
#else
@@ -821,9 +821,9 @@
// Lasko "MyHeat Personal Heater" (200w) modified with a Fotek SSR-10DA to control only the heating element
// and placed inside the small Creality printer enclosure tent.
//
#define DEFAULT_chamberKp 37.04
#define DEFAULT_chamberKi 1.40
#define DEFAULT_chamberKd 655.17
#define DEFAULT_CHAMBER_KP 37.04
#define DEFAULT_CHAMBER_KI 1.40
#define DEFAULT_CHAMBER_KD 655.17
// M309 P37.04 I1.04 D655.17
// FIND YOUR OWN: "M303 E-2 C8 S50" to run autotune on the chamber at 50 degreesC for 8 cycles.

View File

@@ -30,7 +30,7 @@
*
* Basic settings can be found in Configuration.h
*/
#define CONFIGURATION_ADV_H_VERSION 02010205
#define CONFIGURATION_ADV_H_VERSION 02010206
// @section develop
@@ -375,14 +375,14 @@
// A well-chosen Kc value should add just enough power to melt the increased material volume.
//#define PID_EXTRUSION_SCALING
#if ENABLED(PID_EXTRUSION_SCALING)
#define DEFAULT_Kc (100) // heating power = Kc * e_speed
#define DEFAULT_KC (100) // heating power = Kc * e_speed
#define LPQ_MAX_LEN 50
#endif
/**
* Add an additional term to the heater power, proportional to the fan speed.
* A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan.
* You can either just add a constant compensation with the DEFAULT_Kf value
* You can either just add a constant compensation with the DEFAULT_KF value
* or follow the instruction below to get speed-dependent compensation.
*
* Constant compensation (use only with fan speeds of 0% and 100%)
@@ -413,18 +413,18 @@
#if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION)
// The alternative definition is used for an easier configuration.
// Just figure out Kf at full speed (255) and PID_FAN_SCALING_MIN_SPEED.
// DEFAULT_Kf and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly.
// DEFAULT_KF and PID_FAN_SCALING_LIN_FACTOR are calculated accordingly.
#define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_Kf
#define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_Kf
#define PID_FAN_SCALING_AT_FULL_SPEED 13.0 //=PID_FAN_SCALING_LIN_FACTOR*255+DEFAULT_KF
#define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTOR*PID_FAN_SCALING_MIN_SPEED+DEFAULT_KF
#define PID_FAN_SCALING_MIN_SPEED 10.0 // Minimum fan speed at which to enable PID_FAN_SCALING
#define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED)
#define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0
#define DEFAULT_KF (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED)
#define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_KF)/255.0
#else
#define PID_FAN_SCALING_LIN_FACTOR (0) // Power-loss due to cooling = Kf * (fan_speed)
#define DEFAULT_Kf 10 // A constant value added to the PID-tuner
#define DEFAULT_KF 10 // A constant value added to the PID-tuner
#define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING
#endif
#endif

View File

@@ -28,7 +28,7 @@
/**
* Marlin release version identifier
*/
//#define SHORT_BUILD_VERSION "2.1.2.5"
//#define SHORT_BUILD_VERSION "2.1.2.6"
/**
* Verbose version identifier which should contain a reference to the location
@@ -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-11-18"
//#define STRING_DISTRIBUTION_DATE "2025-12-24"
/**
* The protocol for communication to the host. Protocol indicates communication

View File

@@ -111,8 +111,8 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
* (otherwise, characters will be lost due to UART overflow).
* Then: Stepper, Endstops, Temperature, and -finally- all others.
*/
#define HAL_timer_isr_prologue(T) NOOP
#define HAL_timer_isr_epilogue(T) NOOP
inline void HAL_timer_isr_prologue(const uint8_t) {}
inline void HAL_timer_isr_epilogue(const uint8_t) {}
#ifndef HAL_STEP_TIMER_ISR

View File

@@ -127,4 +127,4 @@ FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
pConfig->pTimerRegs->TC_CHANNEL[pConfig->channel].TC_SR;
}
#define HAL_timer_isr_epilogue(T) NOOP
inline void HAL_timer_isr_epilogue(const uint8_t) {}

View File

@@ -136,5 +136,5 @@ void HAL_timer_enable_interrupt(const uint8_t timer_num);
void HAL_timer_disable_interrupt(const uint8_t timer_num);
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
#define HAL_timer_isr_prologue(T) NOOP
#define HAL_timer_isr_epilogue(T) NOOP
inline void HAL_timer_isr_prologue(const uint8_t) {}
inline void HAL_timer_isr_epilogue(const uint8_t) {}

View File

@@ -93,5 +93,5 @@ void HAL_timer_enable_interrupt(const uint8_t timer_num);
void HAL_timer_disable_interrupt(const uint8_t timer_num);
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
#define HAL_timer_isr_prologue(T) NOOP
#define HAL_timer_isr_epilogue(T) NOOP
inline void HAL_timer_isr_prologue(const uint8_t) {}
inline void HAL_timer_isr_epilogue(const uint8_t) {}

View File

@@ -171,4 +171,4 @@ FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
}
}
#define HAL_timer_isr_epilogue(T) NOOP
inline void HAL_timer_isr_epilogue(const uint8_t) {}

View File

@@ -88,5 +88,5 @@ void HAL_timer_enable_interrupt(const uint8_t timer_num);
void HAL_timer_disable_interrupt(const uint8_t timer_num);
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
#define HAL_timer_isr_prologue(T) NOOP
#define HAL_timer_isr_epilogue(T) NOOP
inline void HAL_timer_isr_prologue(const uint8_t) {}
inline void HAL_timer_isr_epilogue(const uint8_t) {}

View File

@@ -157,4 +157,4 @@ FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
}
}
#define HAL_timer_isr_epilogue(timer_num)
inline void HAL_timer_isr_epilogue(const uint8_t) {}

View File

@@ -145,4 +145,4 @@ FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
}
}
#define HAL_timer_isr_epilogue(timer_num)
inline void HAL_timer_isr_epilogue(const uint8_t) {}

View File

@@ -116,5 +116,5 @@ FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const ha
}
}
#define HAL_timer_isr_prologue(T) NOOP
#define HAL_timer_isr_epilogue(T) NOOP
inline void HAL_timer_isr_prologue(const uint8_t) {}
inline void HAL_timer_isr_epilogue(const uint8_t) {}

View File

@@ -188,7 +188,7 @@ FORCE_INLINE static void HAL_timer_isr_prologue(const uint8_t timer_num) {
}
}
#define HAL_timer_isr_epilogue(T) NOOP
inline void HAL_timer_isr_epilogue(const uint8_t) {}
// No command is available in framework to turn off ARPE bit, which is turned on by default in libmaple.
// Needed here to reset ARPE=0 for stepper timer

View File

@@ -74,10 +74,10 @@ typedef uint32_t hal_timer_t;
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(MF_TIMER_TEMP)
#ifndef HAL_STEP_TIMER_ISR
#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler()
#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr()
#endif
#ifndef HAL_TEMP_TIMER_ISR
#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler()
#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr()
#endif
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
@@ -110,4 +110,4 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num);
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
void HAL_timer_isr_prologue(const uint8_t timer_num);
#define HAL_timer_isr_epilogue(T) NOOP
inline void HAL_timer_isr_epilogue(const uint8_t) {}

View File

@@ -110,4 +110,4 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num);
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
void HAL_timer_isr_prologue(const uint8_t timer_num);
#define HAL_timer_isr_epilogue(T) NOOP
inline void HAL_timer_isr_epilogue(const uint8_t) {}

View File

@@ -30,41 +30,82 @@
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
switch (timer_num) {
//
// Step Timer GPT1 - Compare Interrupt OCR1 - Reset Mode
//
case MF_TIMER_STEP:
CCM_CSCMR1 &= ~CCM_CSCMR1_PERCLK_CLK_SEL; // turn off 24mhz mode
// 24MHz mode off Use peripheral clock (150MHz)
CCM_CSCMR1 &= ~CCM_CSCMR1_PERCLK_CLK_SEL;
// Enable GPT1 clock gating
CCM_CCGR1 |= CCM_CCGR1_GPT1_BUS(CCM_CCGR_ON);
GPT1_CR = 0; // disable timer
GPT1_SR = 0x3F; // clear all prior status
GPT1_PR = GPT1_TIMER_PRESCALE - 1;
GPT1_CR |= GPT_CR_CLKSRC(1); //clock selection #1 (peripheral clock = 150 MHz)
GPT1_CR |= GPT_CR_ENMOD; //reset count to zero before enabling
GPT1_CR |= GPT_CR_OM1(1); // toggle mode
GPT1_OCR1 = (GPT1_TIMER_RATE / frequency) -1; // Initial compare value
GPT1_IR = GPT_IR_OF1IE; // Compare3 value
GPT1_CR |= GPT_CR_EN; //enable GPT2 counting at 150 MHz
// Disable timer, clear all status bits
GPT1_CR = 0; // Disable timer
GPT1_SR = 0x3F; // Clear all prior status
OUT_WRITE(15, HIGH);
// Prescaler = 2 => 75MHz counting clock
GPT1_PR = GPT1_TIMER_PRESCALE - 1;
GPT1_CR = GPT_CR_CLKSRC(1) // Clock selection #1 (peripheral clock = 150 MHz)
| GPT_CR_ENMOD // Reset count to zero before enabling
| GPT_CR_OM2(TERN(MARLIN_DEV_MODE, 1, 0)); // 0 = edge compare, 1 = toggle
// Compare value the number of clocks between edges
GPT1_OCR1 = (GPT1_TIMER_RATE / frequency) - 1;
// Enable compareevent interrupt
GPT1_IR = GPT_IR_OF1IE; // OF1 interrupt enabled
// Pull Pin 15 HIGH (logichigh is the “idle” state)
TERN_(MARLIN_DEV_MODE, OUT_WRITE(15, HIGH));
// Attach and enable Stepper IRQ
// Note: UART priority is 16
attachInterruptVector(IRQ_GPT1, &stepTC_Handler);
NVIC_SET_PRIORITY(IRQ_GPT1, 16);
NVIC_SET_PRIORITY(IRQ_GPT1, 16); // Priority 16 (higher than Temp Timer)
// Start GPT1 counting at 150 MHz
GPT1_CR |= GPT_CR_EN;
break;
//
// Temperature Timer GPT2 - Compare Interrupt OCR1 - Reset Mode
//
case MF_TIMER_TEMP:
CCM_CSCMR1 &= ~CCM_CSCMR1_PERCLK_CLK_SEL; // turn off 24mhz mode
// 24MHz mode off Use peripheral clock (150MHz)
CCM_CSCMR1 &= ~CCM_CSCMR1_PERCLK_CLK_SEL;
// Enable GPT2 clock gating
CCM_CCGR0 |= CCM_CCGR0_GPT2_BUS(CCM_CCGR_ON);
GPT2_CR = 0; // disable timer
GPT2_SR = 0x3F; // clear all prior status
GPT2_PR = GPT2_TIMER_PRESCALE - 1;
GPT2_CR |= GPT_CR_CLKSRC(1); //clock selection #1 (peripheral clock = 150 MHz)
GPT2_CR |= GPT_CR_ENMOD; //reset count to zero before enabling
GPT2_CR |= GPT_CR_OM1(1); // toggle mode
GPT2_OCR1 = (GPT2_TIMER_RATE / frequency) -1; // Initial compare value
GPT2_IR = GPT_IR_OF1IE; // Compare3 value
GPT2_CR |= GPT_CR_EN; //enable GPT2 counting at 150 MHz
// Disable timer, clear all status bits
GPT2_CR = 0; // Disable timer
GPT2_SR = 0x3F; // Clear all prior status
OUT_WRITE(14, HIGH);
// Prescaler = 10 => 15MHz counting clock
GPT2_PR = GPT2_TIMER_PRESCALE - 1;
GPT2_CR = GPT_CR_CLKSRC(1) // Clock selection #1 (peripheral clock = 150 MHz)
| GPT_CR_ENMOD // and reset count to zero before enabling
| GPT_CR_OM2(TERN(MARLIN_DEV_MODE, 1, 0)); // 0 = edge compare, 1 = toggle
// Compare value the number of clocks between edges
GPT2_OCR1 = (GPT2_TIMER_RATE / frequency) - 1;
// Enable compareevent interrupt
GPT2_IR = GPT_IR_OF1IE; // OF1 interrupt enabled
// Pull Pin 14 HIGH (logichigh is the “idle” state)
TERN_(MARLIN_DEV_MODE, OUT_WRITE(14, HIGH));
// Attach Temperature ISR
attachInterruptVector(IRQ_GPT2, &tempTC_Handler);
NVIC_SET_PRIORITY(IRQ_GPT2, 32);
NVIC_SET_PRIORITY(IRQ_GPT2, 32); // Priority 32 (lower than Step Timer)
// Start GPT2 counting at 150 MHz
GPT2_CR |= GPT_CR_EN;
break;
}
}
@@ -82,6 +123,7 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num) {
case MF_TIMER_TEMP: NVIC_DISABLE_IRQ(IRQ_GPT2); break;
}
// Ensure the CPU actually stops servicing the IRQ
// We NEED memory barriers to ensure Interrupts are actually disabled!
// ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the )
asm volatile("dsb");
@@ -97,8 +139,8 @@ bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
void HAL_timer_isr_prologue(const uint8_t timer_num) {
switch (timer_num) {
case MF_TIMER_STEP: GPT1_SR = GPT_IR_OF1IE; break; // clear OF3 bit
case MF_TIMER_TEMP: GPT2_SR = GPT_IR_OF1IE; break; // clear OF3 bit
case MF_TIMER_STEP: GPT1_SR = GPT_IR_OF1IE; break; // clear OF1
case MF_TIMER_TEMP: GPT2_SR = GPT_IR_OF1IE; break;
}
asm volatile("dsb");
}

View File

@@ -60,7 +60,7 @@ typedef uint32_t hal_timer_t;
#define HAL_TIMER_RATE GPT1_TIMER_RATE
#define STEPPER_TIMER_RATE HAL_TIMER_RATE
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000)
#define STEPPER_TIMER_PRESCALE ((GPT_TIMER_RATE / 1000000) / STEPPER_TIMER_TICKS_PER_US)
#define STEPPER_TIMER_PRESCALE (GPT_TIMER_RATE / STEPPER_TIMER_RATE)
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer
#define PULSE_TIMER_PRESCALE STEPPER_TIMER_PRESCALE
@@ -89,8 +89,16 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
FORCE_INLINE static void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t compare) {
switch (timer_num) {
case MF_TIMER_STEP: GPT1_OCR1 = compare - 1; break;
case MF_TIMER_TEMP: GPT2_OCR1 = compare - 1; break;
case MF_TIMER_STEP:
GPT1_CR |= GPT_CR_FRR; // Free Run Mode (setting OCRx preserves CNT)
GPT1_OCR1 = compare - 1;
GPT1_CR &= ~GPT_CR_FRR; // Reset Mode (CNT resets on trigger)
break;
case MF_TIMER_TEMP:
GPT2_CR |= GPT_CR_FRR; // Free Run Mode (setting OCRx preserves CNT)
GPT2_OCR1 = compare - 1;
GPT2_CR &= ~GPT_CR_FRR; // Reset Mode (CNT resets on trigger)
break;
}
}
@@ -115,5 +123,4 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num);
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
void HAL_timer_isr_prologue(const uint8_t timer_num);
//void HAL_timer_isr_epilogue(const uint8_t timer_num) {}
#define HAL_timer_isr_epilogue(T) NOOP
inline void HAL_timer_isr_epilogue(const uint8_t) {}

View File

@@ -621,6 +621,18 @@
#error "BTT_MINI_12864_V1 is now BTT_MINI_12864."
#elif defined(SDIO_SUPPORT)
#error "SDIO_SUPPORT is now ONBOARD_SDIO."
#elif defined(DEFAULT_Kp_LIST) || defined(DEFAULT_Ki_LIST) || defined(DEFAULT_Kd_LIST)
#error "DEFAULT_Kp_LIST, DEFAULT_Ki_LIST, DEFAULT_Kd_LIST are now (uppercase) DEFAULT_KP_LIST, DEFAULT_KI_LIST, DEFAULT_KD_LIST."
#elif defined(DEFAULT_Kp) || defined(DEFAULT_Ki) || defined(DEFAULT_Kd)
#error "DEFAULT_Kp, DEFAULT_Ki, DEFAULT_Kd are now (uppercase) DEFAULT_KP, DEFAULT_KI, DEFAULT_KD."
#elif defined(DEFAULT_bedKp) || defined(DEFAULT_bedKi) || defined(DEFAULT_bedKd)
#error "DEFAULT_bedKp, DEFAULT_bedKi, DEFAULT_bedKd are now DEFAULT_BED_KP, DEFAULT_BED_KI, DEFAULT_BED_KD."
#elif defined(DEFAULT_chamberKp) || defined(DEFAULT_chamberKi) || defined(DEFAULT_chamberKd)
#error "DEFAULT_chamberKp, DEFAULT_chamberKi, DEFAULT_chamberKd are now DEFAULT_CHAMBER_KP, DEFAULT_CHAMBER_KI, DEFAULT_CHAMBER_KD."
#elif defined(DEFAULT_Kc)
#error "DEFAULT_Kc is now (uppercase) DEFAULT_KC."
#elif defined(DEFAULT_Kf)
#error "DEFAULT_Kf is now (uppercase) DEFAULT_KF."
#endif
// L64xx stepper drivers have been removed

View File

@@ -25,7 +25,7 @@
* Release version. Leave the Marlin version or apply a custom scheme.
*/
#ifndef SHORT_BUILD_VERSION
#define SHORT_BUILD_VERSION "2.1.2.5"
#define SHORT_BUILD_VERSION "2.1.2.6"
#endif
/**
@@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2024-11-18"
#define STRING_DISTRIBUTION_DATE "2025-12-24"
#endif
/**
@@ -52,7 +52,7 @@
* to alert users to major changes.
*/
#define MARLIN_HEX_VERSION 02010205
#define MARLIN_HEX_VERSION 02010206
#ifndef REQUIRED_CONFIGURATION_H_VERSION
#define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION
#endif

View File

@@ -503,7 +503,9 @@ void MarlinUI::draw_status_screen() {
const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive());
static u8g_uint_t progress_bar_solid_width = 0;
#if HAS_PRINT_PROGRESS
static u8g_uint_t progress_bar_solid_width = 0;
#endif
// At the first page, generate new display values
if (first_page) {

View File

@@ -548,7 +548,7 @@ public:
static FSTR_P get_preheat_label(const uint8_t m);
static void apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e=active_extruder);
static void preheat_set_fan(const uint8_t m) { TERN_(HAS_FAN, apply_preheat(m, _BV(PT_FAN))); }
static void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, _BV(PT_HOTEND))); }
static void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, _BV(PT_HOTEND), e)); }
static void preheat_hotend_and_fan(const uint8_t m, const uint8_t e=active_extruder) { preheat_hotend(m, e); preheat_set_fan(m); }
static void preheat_bed(const uint8_t m) { TERN_(HAS_HEATED_BED, apply_preheat(m, _BV(PT_BED))); }
static void preheat_all(const uint8_t m) { apply_preheat(m, PT_ALL); }

View File

@@ -3242,47 +3242,47 @@ void MarlinSettings::reset() {
#if ENABLED(PIDTEMP)
#if ENABLED(PID_PARAMS_PER_HOTEND)
constexpr float defKp[] =
#ifdef DEFAULT_Kp_LIST
DEFAULT_Kp_LIST
constexpr float defKP[] =
#ifdef DEFAULT_KP_LIST
DEFAULT_KP_LIST
#else
ARRAY_BY_HOTENDS1(DEFAULT_Kp)
ARRAY_BY_HOTENDS1(DEFAULT_KP)
#endif
, defKi[] =
#ifdef DEFAULT_Ki_LIST
DEFAULT_Ki_LIST
, defKI[] =
#ifdef DEFAULT_KI_LIST
DEFAULT_KI_LIST
#else
ARRAY_BY_HOTENDS1(DEFAULT_Ki)
ARRAY_BY_HOTENDS1(DEFAULT_KI)
#endif
, defKd[] =
#ifdef DEFAULT_Kd_LIST
DEFAULT_Kd_LIST
, defKD[] =
#ifdef DEFAULT_KD_LIST
DEFAULT_KD_LIST
#else
ARRAY_BY_HOTENDS1(DEFAULT_Kd)
ARRAY_BY_HOTENDS1(DEFAULT_KD)
#endif
;
static_assert(WITHIN(COUNT(defKp), 1, HOTENDS), "DEFAULT_Kp_LIST must have between 1 and HOTENDS items.");
static_assert(WITHIN(COUNT(defKi), 1, HOTENDS), "DEFAULT_Ki_LIST must have between 1 and HOTENDS items.");
static_assert(WITHIN(COUNT(defKd), 1, HOTENDS), "DEFAULT_Kd_LIST must have between 1 and HOTENDS items.");
static_assert(WITHIN(COUNT(defKP), 1, HOTENDS), "DEFAULT_KP_LIST must have between 1 and HOTENDS items.");
static_assert(WITHIN(COUNT(defKI), 1, HOTENDS), "DEFAULT_KI_LIST must have between 1 and HOTENDS items.");
static_assert(WITHIN(COUNT(defKD), 1, HOTENDS), "DEFAULT_KD_LIST must have between 1 and HOTENDS items.");
#if ENABLED(PID_EXTRUSION_SCALING)
constexpr float defKc[] =
#ifdef DEFAULT_Kc_LIST
DEFAULT_Kc_LIST
constexpr float defKC[] =
#ifdef DEFAULT_KC_LIST
DEFAULT_KC_LIST
#else
ARRAY_BY_HOTENDS1(DEFAULT_Kc)
ARRAY_BY_HOTENDS1(DEFAULT_KC)
#endif
;
static_assert(WITHIN(COUNT(defKc), 1, HOTENDS), "DEFAULT_Kc_LIST must have between 1 and HOTENDS items.");
static_assert(WITHIN(COUNT(defKC), 1, HOTENDS), "DEFAULT_KC_LIST must have between 1 and HOTENDS items.");
#endif
#if ENABLED(PID_FAN_SCALING)
constexpr float defKf[] =
#ifdef DEFAULT_Kf_LIST
DEFAULT_Kf_LIST
constexpr float defKF[] =
#ifdef DEFAULT_KF_LIST
DEFAULT_KF_LIST
#else
ARRAY_BY_HOTENDS1(DEFAULT_Kf)
ARRAY_BY_HOTENDS1(DEFAULT_KF)
#endif
;
static_assert(WITHIN(COUNT(defKf), 1, HOTENDS), "DEFAULT_Kf_LIST must have between 1 and HOTENDS items.");
static_assert(WITHIN(COUNT(defKF), 1, HOTENDS), "DEFAULT_KF_LIST must have between 1 and HOTENDS items.");
#endif
#define PID_DEFAULT(N,E) def##N[E]
#else
@@ -3290,11 +3290,11 @@ void MarlinSettings::reset() {
#endif
HOTEND_LOOP() {
thermalManager.temp_hotend[e].pid.set(
PID_DEFAULT(Kp, ALIM(e, defKp)),
PID_DEFAULT(Ki, ALIM(e, defKi)),
PID_DEFAULT(Kd, ALIM(e, defKd))
OPTARG(PID_EXTRUSION_SCALING, PID_DEFAULT(Kc, ALIM(e, defKc)))
OPTARG(PID_FAN_SCALING, PID_DEFAULT(Kf, ALIM(e, defKf)))
PID_DEFAULT(KP, ALIM(e, defKP)),
PID_DEFAULT(KI, ALIM(e, defKI)),
PID_DEFAULT(KD, ALIM(e, defKD))
OPTARG(PID_EXTRUSION_SCALING, PID_DEFAULT(KC, ALIM(e, defKC)))
OPTARG(PID_FAN_SCALING, PID_DEFAULT(KF, ALIM(e, defKF)))
);
}
#endif
@@ -3308,14 +3308,14 @@ void MarlinSettings::reset() {
// Heated Bed PID
//
#if ENABLED(PIDTEMPBED)
thermalManager.temp_bed.pid.set(DEFAULT_bedKp, DEFAULT_bedKi, DEFAULT_bedKd);
thermalManager.temp_bed.pid.set(DEFAULT_BED_KP, DEFAULT_BED_KI, DEFAULT_BED_KD);
#endif
//
// Heated Chamber PID
//
#if ENABLED(PIDTEMPCHAMBER)
thermalManager.temp_chamber.pid.set(DEFAULT_chamberKp, DEFAULT_chamberKi, DEFAULT_chamberKd);
thermalManager.temp_chamber.pid.set(DEFAULT_CHAMBER_KP, DEFAULT_CHAMBER_KI, DEFAULT_CHAMBER_KD);
#endif
//

View File

@@ -1454,11 +1454,7 @@ HAL_STEP_TIMER_ISR() {
HAL_timer_isr_epilogue(MF_TIMER_STEP);
}
#ifdef CPU_32_BIT
#define STEP_MULTIPLY(A,B) MultiU32X24toH32(A, B)
#else
#define STEP_MULTIPLY(A,B) MultiU24X32toH16(A, B)
#endif
#define STEP_MULTIPLY(A,B) TERN(CPU_32_BIT, MultiU32X24toH32, MultiU24X32toH16)(A, B)
void Stepper::isr() {

View File

@@ -839,14 +839,14 @@ volatile bool Temperature::raw_temps_ready = false;
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE)));
#if ANY(PIDTEMPBED, PIDTEMPCHAMBER)
FSTR_P const estring = GHV(F("chamber"), F("bed"), FPSTR(NUL_STR));
say_default_(); SERIAL_ECHOF(estring); SERIAL_ECHOLNPGM("Kp ", tune_pid.p);
say_default_(); SERIAL_ECHOF(estring); SERIAL_ECHOLNPGM("Ki ", tune_pid.i);
say_default_(); SERIAL_ECHOF(estring); SERIAL_ECHOLNPGM("Kd ", tune_pid.d);
FSTR_P const estring = GHV(F("CHAMBER_"), F("BED_"), FPSTR(NUL_STR));
say_default_(); SERIAL_ECHOF(estring); SERIAL_ECHOLNPGM("KP ", tune_pid.p);
say_default_(); SERIAL_ECHOF(estring); SERIAL_ECHOLNPGM("KI ", tune_pid.i);
say_default_(); SERIAL_ECHOF(estring); SERIAL_ECHOLNPGM("KD ", tune_pid.d);
#else
say_default_(); SERIAL_ECHOLNPGM("Kp ", tune_pid.p);
say_default_(); SERIAL_ECHOLNPGM("Ki ", tune_pid.i);
say_default_(); SERIAL_ECHOLNPGM("Kd ", tune_pid.d);
say_default_(); SERIAL_ECHOLNPGM("KP ", tune_pid.p);
say_default_(); SERIAL_ECHOLNPGM("KI ", tune_pid.i);
say_default_(); SERIAL_ECHOLNPGM("KD ", tune_pid.d);
#endif
auto _set_hotend_pid = [](const uint8_t tool, const raw_pid_t &in_pid) {

View File

@@ -178,9 +178,9 @@
#elif MB(DAGOMA_F5)
#include "ramps/pins_DAGOMA_F5.h" // ATmega2560 env:mega2560
#elif MB(FYSETC_F6_13)
#include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:FYSETC_F6
#include "ramps/pins_FYSETC_F6_13.h" // ATmega2560 env:mega2560ext
#elif MB(FYSETC_F6_14)
#include "ramps/pins_FYSETC_F6_14.h" // ATmega2560 env:FYSETC_F6
#include "ramps/pins_FYSETC_F6_14.h" // ATmega2560 env:mega2560ext
#elif MB(DUPLICATOR_I3_PLUS)
#include "ramps/pins_DUPLICATOR_I3_PLUS.h" // ATmega2560 env:mega2560
#elif MB(VORON)
@@ -449,33 +449,33 @@
//
#elif MB(DUE3DOM)
#include "sam/pins_DUE3DOM.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug
#include "sam/pins_DUE3DOM.h" // SAM3X8E env:DUE env:DUE_USB
#elif MB(DUE3DOM_MINI)
#include "sam/pins_DUE3DOM_MINI.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug
#include "sam/pins_DUE3DOM_MINI.h" // SAM3X8E env:DUE env:DUE_USB
#elif MB(RADDS)
#include "sam/pins_RADDS.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug
#include "sam/pins_RADDS.h" // SAM3X8E env:DUE env:DUE_USB
#elif MB(RAMPS_FD_V1)
#include "sam/pins_RAMPS_FD_V1.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug
#include "sam/pins_RAMPS_FD_V1.h" // SAM3X8E env:DUE env:DUE_USB
#elif MB(RAMPS_FD_V2)
#include "sam/pins_RAMPS_FD_V2.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug
#include "sam/pins_RAMPS_FD_V2.h" // SAM3X8E env:DUE env:DUE_USB
#elif MB(RAMPS_SMART_EFB, RAMPS_SMART_EEB, RAMPS_SMART_EFF, RAMPS_SMART_EEF, RAMPS_SMART_SF)
#include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug
#include "sam/pins_RAMPS_SMART.h" // SAM3X8E env:DUE env:DUE_USB
#elif MB(RAMPS_DUO_EFB, RAMPS_DUO_EEB, RAMPS_DUO_EFF, RAMPS_DUO_EEF, RAMPS_DUO_SF)
#include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug
#include "sam/pins_RAMPS_DUO.h" // SAM3X8E env:DUE env:DUE_USB
#elif MB(RAMPS4DUE_EFB, RAMPS4DUE_EEB, RAMPS4DUE_EFF, RAMPS4DUE_EEF, RAMPS4DUE_SF)
#include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug
#include "sam/pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB
#elif MB(RURAMPS4D_11)
#include "sam/pins_RURAMPS4D_11.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug
#include "sam/pins_RURAMPS4D_11.h" // SAM3X8E env:DUE env:DUE_USB
#elif MB(RURAMPS4D_13)
#include "sam/pins_RURAMPS4D_13.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug
#include "sam/pins_RURAMPS4D_13.h" // SAM3X8E env:DUE env:DUE_USB
#elif MB(ULTRATRONICS_PRO)
#include "sam/pins_ULTRATRONICS_PRO.h" // SAM3X8E env:DUE env:DUE_debug
#include "sam/pins_ULTRATRONICS_PRO.h" // SAM3X8E env:DUE
#elif MB(ARCHIM1)
#include "sam/pins_ARCHIM1.h" // SAM3X8E env:DUE_archim env:DUE_archim_debug
#elif MB(ARCHIM2)
#include "sam/pins_ARCHIM2.h" // SAM3X8E env:DUE_archim env:DUE_archim_debug
#elif MB(ALLIGATOR)
#include "sam/pins_ALLIGATOR_R2.h" // SAM3X8E env:DUE env:DUE_debug
#include "sam/pins_ALLIGATOR_R2.h" // SAM3X8E env:DUE
#elif MB(CNCONTROLS_15D)
#include "sam/pins_CNCONTROLS_15D.h" // SAM3X8E env:DUE env:DUE_USB
#elif MB(KRATOS32)
@@ -488,7 +488,7 @@
#elif MB(PRINTRBOARD_G2)
#include "sam/pins_PRINTRBOARD_G2.h" // SAM3X8C env:DUE_USB
#elif MB(ADSK)
#include "sam/pins_ADSK.h" // SAM3X8C env:DUE env:DUE_debug
#include "sam/pins_ADSK.h" // SAM3X8C env:DUE
//
// STM32 ARM Cortex-M0+

View File

@@ -613,7 +613,7 @@
#endif
#elif X_HOME_TO_MIN
#define X_STOP_PIN X_MIN_PIN
#else
#elif X_HOME_TO_MAX
#define X_STOP_PIN X_MAX_PIN
#endif
#if !defined(X2_USE_ENDSTOP) && ENABLED(X_DUAL_ENDSTOPS) && PIN_EXISTS(X_STOP)
@@ -635,7 +635,7 @@
#endif
#elif Y_HOME_TO_MIN
#define Y_STOP_PIN Y_MIN_PIN
#else
#elif Y_HOME_TO_MAX
#define Y_STOP_PIN Y_MAX_PIN
#endif
#if !defined(Y2_USE_ENDSTOP) && ENABLED(Y_DUAL_ENDSTOPS) && PIN_EXISTS(Y_STOP)
@@ -658,7 +658,7 @@
#endif
#elif Z_HOME_TO_MIN
#define Z_STOP_PIN Z_MIN_PIN
#else
#elif Z_HOME_TO_MAX
#define Z_STOP_PIN Z_MAX_PIN
#endif
#if ENABLED(Z_MULTI_ENDSTOPS) && PIN_EXISTS(Z_STOP)
@@ -689,7 +689,7 @@
#endif
#elif I_HOME_TO_MIN
#define I_STOP_PIN I_MIN_PIN
#else
#elif I_HOME_TO_MAX
#define I_STOP_PIN I_MAX_PIN
#endif
#else
@@ -712,7 +712,7 @@
#endif
#elif J_HOME_TO_MIN
#define J_STOP_PIN J_MIN_PIN
#else
#elif J_HOME_TO_MAX
#define J_STOP_PIN J_MAX_PIN
#endif
#else
@@ -735,7 +735,7 @@
#endif
#elif K_HOME_TO_MIN
#define K_STOP_PIN K_MIN_PIN
#else
#elif K_HOME_TO_MAX
#define K_STOP_PIN K_MAX_PIN
#endif
#else
@@ -758,7 +758,7 @@
#endif
#elif U_HOME_TO_MIN
#define U_STOP_PIN U_MIN_PIN
#else
#elif U_HOME_TO_MAX
#define U_STOP_PIN U_MAX_PIN
#endif
#else
@@ -781,7 +781,7 @@
#endif
#elif V_HOME_TO_MIN
#define V_STOP_PIN V_MIN_PIN
#else
#elif V_HOME_TO_MAX
#define V_STOP_PIN V_MAX_PIN
#endif
#else
@@ -804,7 +804,7 @@
#endif
#elif W_HOME_TO_MIN
#define W_STOP_PIN W_MIN_PIN
#else
#elif W_HOME_TO_MAX
#define W_STOP_PIN W_MAX_PIN
#endif
#else

View File

@@ -484,15 +484,15 @@
#endif
//
// AUX1 5V GND D2 D1
// AUX1 5V GND D1 D0
// 2 4 6 8
// 1 3 5 7
// 5V GND A3 A4
//
#define AUX1_05 57 // (A3)
#define AUX1_06 2
#define AUX1_06 1 // TX0
#define AUX1_07 58 // (A4)
#define AUX1_08 1
#define AUX1_08 0 // RX0
//
// AUX2 GND A9 D40 D42 A11

View File

@@ -158,7 +158,9 @@ shopt -s nullglob
export PAUSE=1
# Get a list of all folders that contain a file matching "Configuration*.h"
find -ds "$CBASE"/config/examples -type d -name 'Configuration.h' -o -name 'Configuration_adv.h' -print0 | while IFS= read -r -d $'\0' CONF; do
find "$CBASE"/config/examples -type d -name 'Configuration.h' -o -name 'Configuration_adv.h' -print0 \
| LC_ALL=C sort -fz \
| while IFS= read -r -d $'\0' CONF; do
# Remove the file name and slash from the end of the path
CONF=${CONF%/*}

View File

@@ -11,6 +11,7 @@
# [-o|--output] - Redirect export / archiving to another location
# (By default export to origin config folder)
# [-f|--nofail] - Don't stop on a failed build
# [-x|--noxfer] - Skip the build if the env ends with _xfer. Implied with --many.
# [-w|--nowarn] - Suppress warnings with extra config options
# [-r|--reveal] - Reveal the config/export folder after the build
# [-h|--help] - Print usage and exit
@@ -28,6 +29,7 @@ build_example -b|--base=<path> - Configurations root folder (e.g., ./.pio/bu
[-o|--output] - Redirect export / archiving to another location
(By default export to origin config folder)
[-f|--nofail] - Don't stop on a failed build
[-x|--noxfer] - Skip the build if the env ends with _xfer. Implied with --many.
[-w|--nowarn] - Suppress warnings with extra config options
[-r|--reveal] - Reveal the config/export folder after the build
[-h|--help] - Print usage and exit
@@ -56,8 +58,9 @@ NOFAIL=
OUTBASE=
BUILDINDEX=1
MANY=
NOXFER=
while getopts 'ab:c:e:fhmn:o:r-:' OFLAG; do
while getopts 'ab:c:e:fhmn:o:r-:x' OFLAG; do
case "${OFLAG}" in
a) ARCHIVE=1 ;;
b) BASE="${OPTARG%/}" ;;
@@ -65,23 +68,25 @@ while getopts 'ab:c:e:fhmn:o:r-:' OFLAG; do
e) EXPNUM="$OPTARG" ;;
f) NOFAIL=1 ;;
h) EXIT_USAGE=1 ; break ;;
m) MANY=1 ;;
m) MANY=1 ; NOXFER=1 ;;
n) BUILDINDEX="$OPTARG" ;;
o) OUTBASE="${OPTARG%/}" ;;
r) REVEAL=1 ;;
x) NOXFER=1 ;;
-) ONAM="${OPTARG%%=*}" ; OVAL="${OPTARG#*=}"
case "$ONAM" in
archive) ARCHIVE=1 ;;
allow) ALLOW=1 ;;
base) BASE="${OVAL%/}" ;;
config) CONFIG="${OVAL%/}" ;;
many) MANY=1 ;;
many) MANY=1 ; NOXFER=1 ;;
index) BUILDINDEX="$OVAL" ;;
export) EXPNUM="$OVAL" ;;
output) OUTBASE="${OVAL%/}" ;;
help) EXIT_USAGE=1 ; break ;;
nofail) NOFAIL=1 ;;
reveal) REVEAL=1 ;;
noxfer) NOXFER=1 ;;
*) EXIT_USAGE=2 ; echo "$SELF: unrecognized option \`--$ONAM'" ; break ;;
esac
;;
@@ -200,83 +205,92 @@ fi
# Build all from BUILDINDEX onward (usually 1) meaning ALL.
# MANY with a BUILDINDEX may be useful for continuing an interrupted build.
while ((1)); do
while true; do
set +e
echo "Building example $CONFIG ($BUILDINDEX)..."
# Skip over "_xfer" environments when specified
if [[ -n $NOXFER && ${ENVARRAY[BUILDINDEX-1]} =~ _xfer$ ]]; then
# Run a build and record the error number
mftest -s -a -n$BUILDINDEX ; ERR=$?
# "Index out of range" can fail without an error
((MANY)) && ((ERR == 66)) && ERR=0 && break # "index out of range"
set -e
if [[ $ERR -gt 0 ]]; then
alrt "Failed ($ERR)"
# Error? For --nofail simply log. Otherwise return the error.
if [[ -n $NOFAIL ]]; then
date +"%F %T [FAIL] $CONFIG ($BUILDINDEX)" >>./.pio/error-log.txt
else
exit $ERR
fi
echo "Skipping example $CONFIG ($BUILDINDEX)..."
else
annc "Success"
echo "Building example $CONFIG ($BUILDINDEX)..."
# Copy exports back to the configs
if [[ -n $EXPNUM ]]; then
annc "Exporting $EXPNUM"
[[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$ARCSUB"/Config.h ; }
find "$BUILD" -type f \( "${ENAME[@]}" \) -exec cp "{}" "$ARCSUB" \;
fi
# Run a build and record the error number
mftest -s -a -n$BUILDINDEX ; ERR=$?
# "Index out of range" can fail without an error
((MANY)) && ((ERR == 66)) && ERR=0 && break # "index out of range"
set -e
if [[ $ERR -gt 0 ]]; then
alrt "Failed ($ERR)"
# Error? For --nofail simply log. Otherwise return the error.
if [[ -n $NOFAIL ]]; then
date +"%F %T [FAIL] $CONFIG ($BUILDINDEX)" >>./.pio/error-log.txt
else
exit $ERR
fi
# When building many, create sub-folders for each build env name
if [[ -n $MANY && $ENVCOUNT -gt 1 ]]; then
ENV=${ENVARRAY[BUILDINDEX-1]}
ARCENVSUB="$ARCSUB/$ENV"
else
ARCENVSUB="$ARCSUB"
fi
# Copy potential firmware files into the config folder
# TODO: Consider firmware that needs an STM32F4_UPDATE folder.
# Currently only BOARD_CREALITY_F401RE env:STM32F401RE_creality
if ((ARCHIVE)); then
annc "Archiving"
find "$BUILD" -type f \( "${BNAME[@]}" \) -exec sh -c '
ARCDIR="$1" ; CONFIG="$2" ; FILE="$3" ; shift 3
NAME=${FILE##*/} ; SHRT=${NAME%.*} ; DIR=${FILE%/*}
ZIPX=
if [[ $CONFIG == *Simulator* ]]; then
case $(uname | tr '[:upper:]' '[:lower:]') in
darwin) SUB="macOS" ; ZIPX="-X" ;;
*linux) SUB="Linux" ;;
win*) SUB="Windows" ;;
msys*) SUB="Windows" ;;
cygwin*) SUB="Windows" ;;
mingw*) SUB="Windows" ;;
*) SUB='Unix' ;;
esac
ARCH=$(uname -m | tr '[:lower:]' '[:upper:]')
ARCDIR="$ARCDIR/$SUB-$ARCH"
fi
mkdir -p "$ARCDIR"
rm -f "$ARCDIR"/*.zip "$ARCDIR"/*.sha256.txt
cd "$DIR"
SHASUM=$(sha256sum "$NAME" | cut -d" " -f1)
echo "$CONFIG\n$SHASUM" > "$ARCDIR/$NAME.sha256.txt"
zip $ZIPX "$ARCDIR/$SHRT.zip" "$NAME" && rm "$NAME"
cd - >/dev/null
' sh "$ARCENVSUB" "$CONFIG" {} +
fi
annc "Success"
# Reveal the configs after the build, if requested
((REVEAL)) && { annc "Revealing $ARCENVSUB" ; open "$ARCENVSUB" ; }
# Copy exports back to the configs
if [[ -n $EXPNUM ]]; then
annc "Exporting $EXPNUM"
[[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$ARCSUB"/Config.h ; }
find "$BUILD" -type f \( "${ENAME[@]}" \) -exec cp "{}" "$ARCSUB" \;
fi
# When building many, create sub-folders for each build env name
if [[ -n $MANY ]]; then
ENV=${ENVARRAY[BUILDINDEX-1]}
ARCENVSUB="$ARCSUB/$ENV"
else
ARCENVSUB="$ARCSUB"
fi
# Copy potential firmware files into the config folder
# TODO: Consider firmware that needs an STM32F4_UPDATE folder.
# Currently only BOARD_CREALITY_F401RE env:STM32F401RE_creality
if ((ARCHIVE)); then
annc "Archiving"
find "$BUILD" -type f \( "${BNAME[@]}" \) -exec sh -c '
ARCDIR="$1" ; CONFIG="$2" ; FILE="$3" ; shift 3
NAME=${FILE##*/} ; SHRT=${NAME%.*} ; DIR=${FILE%/*}
ZIPX=
if [[ $CONFIG == *Simulator* ]]; then
case $(uname | tr '[:upper:]' '[:lower:]') in
darwin) SUB="macOS" ; ZIPX="-X" ;;
*linux) SUB="Linux" ;;
win*) SUB="Windows" ;;
msys*) SUB="Windows" ;;
cygwin*) SUB="Windows" ;;
mingw*) SUB="Windows" ;;
*) SUB='Unix' ;;
esac
ARCH=$(uname -m | tr '[:lower:]' '[:upper:]')
ARCDIR="$ARCDIR/$SUB-$ARCH"
fi
mkdir -p "$ARCDIR"
rm -f "$ARCDIR"/*.zip "$ARCDIR"/*.sha256.txt
cd "$DIR"
SHASUM=$(sha256sum "$NAME" | cut -d" " -f1)
echo "$CONFIG\n$SHASUM" > "$ARCDIR/$NAME.sha256.txt"
zip $ZIPX "$ARCDIR/$SHRT.zip" "$NAME" && rm "$NAME"
cd - >/dev/null
' sh "$ARCENVSUB" "$CONFIG" {} +
fi # ARCHIVE
# Reveal the configs after the build, if requested
((REVEAL)) && { annc "Revealing $ARCENVSUB" ; open "$ARCENVSUB" ; }
fi # Success
fi

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
#
# mfenvs Print the current board and environment information
# Use -n to remove "*_xfer" environments from the list.
# Output -> "SHORT_NAME (###): [ env1 env2 env3 ... ]"
#
@@ -27,6 +28,7 @@ BLINE=$( grep -E "define\s+BOARD_$MB\b" Marlin/src/core/boards.h )
BNUM=$( sed -E 's/^.+BOARD_[^ ]+ +([0-9]+).+$/\1/' <<<"$BLINE" )
[[ -z $BNUM ]] && { echo "Error - Can't find BOARD_$MB in core/boards.h." ; exit 1 ; }
ENVS=( $( grep -EA1 "MB\(.*\b$MB\b.*\)" Marlin/src/pins/pins.h | grep -E "#include.+//.+(env|$SYS):[^ ]+" | grep -oE "(env|$SYS):[^ ]+" | sed -E "s/(env|$SYS)://" ) )
[[ "$1" = "-n" ]] && ENVS=( $(printf "%s\n" "${ENVS[@]}" | grep -v "_xfer$") )
[[ -z $ENVS ]] && { errout "Error - Can't find target(s) for $MB ($BNUM)." ; exit 1 ; }
ECOUNT=${#ENVS[*]}
[[ $ECOUNT == 1 ]] && EOUT=$ENVS || EOUT="${ENVS[@]}"

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env python
#
# use_example_configs [repo:]configpath
#
@@ -14,40 +14,127 @@
# The fallback branch is bugfix-2.1.x.
#
which curl >/dev/null && TOOL='curl -L -s -S -f -o wgot'
which wget >/dev/null && TOOL='wget -q -O wgot'
import os, subprocess, sys, urllib.request, urllib.error
from pathlib import Path
CURR=$(git branch 2>/dev/null | grep ^* | sed 's/\* //g')
case "$CURR" in
bugfix-2.*.x ) BRANCH=$CURR ;;
*-2.1.x|2.1.x ) BRANCH=latest-2.1.x ;;
*-2.0.x|2.0.x ) BRANCH=latest-2.0.x ;;
*-1.1.x|1.1.x ) BRANCH=latest-1.1.x ;;
*-1.0.x|1.0.x ) BRANCH=latest-1.0.x ;;
* ) BRANCH=bugfix-2.1.x ;;
esac
DEBUGGING = False
CONFIG_FILES = ("Configuration.h", "Configuration_adv.h", "_Bootscreen.h", "_Statusscreen.h")
if [[ $# > 0 ]]; then
IFS=: read -r PART1 PART2 <<< "$@"
[[ -n $PART2 ]] && { UDIR="$PART2" ; BRANCH="$PART1" ; } \
|| { UDIR="$PART1" ; }
RDIR="${UDIR// /%20}"
echo "Fetching $UDIR configurations from $BRANCH..."
EXAMPLES="examples/$RDIR"
else
EXAMPLES="default"
fi
def debug_print(s):
if DEBUGGING: print(s)
CONFIGS="https://raw.githubusercontent.com/MarlinFirmware/Configurations/$BRANCH/config/${EXAMPLES}"
def get_current_branch():
try:
result = subprocess.run(['git', 'branch'], capture_output=True, text=True, check=True)
for line in result.stdout.splitlines():
if line.startswith('*'):
return line[2:]
except subprocess.CalledProcessError:
return None
restore_configs
def sparse_checkout(branch, config_path, repo_url="https://github.com/MarlinFirmware/Configurations.git"):
configs_dir = Path("ConfigurationsRepo")
config_subdir = f"config/{config_path}"
cd Marlin
if not configs_dir.exists():
# Step 1: Clone with no checkout
subprocess.run([
"git", "clone", "--depth", "1", "--filter=blob:none", "--sparse",
"--branch", branch, repo_url, str(configs_dir)
], check=True)
$TOOL "$CONFIGS/Configuration.h" >/dev/null 2>&1 && mv wgot Configuration.h
$TOOL "$CONFIGS/Configuration_adv.h" >/dev/null 2>&1 && mv wgot Configuration_adv.h
$TOOL "$CONFIGS/_Bootscreen.h" >/dev/null 2>&1 && mv wgot _Bootscreen.h
$TOOL "$CONFIGS/_Statusscreen.h" >/dev/null 2>&1 && mv wgot _Statusscreen.h
# Step 2: Enable sparse checkout and set the folder
subprocess.run(["git", "sparse-checkout", "set", config_subdir], cwd=str(configs_dir), check=True)
# Step 3: Pull the latest for that branch/folder
subprocess.run(["git", "pull"], cwd=str(configs_dir), check=True)
rm -f wgot
cd - >/dev/null
def copy_config_files(branch, config_path, dest_dir):
sparse_checkout(branch, config_path)
src_dir = Path("ConfigurationsRepo") / "config" / config_path
for fname in CONFIG_FILES:
src_file = src_dir / fname
if src_file.exists():
dest_file = dest_dir / fname
debug_print(f"Copying {src_file} to {dest_file}")
dest_file.write_bytes(src_file.read_bytes())
else:
debug_print(f"{fname} not found in {src_dir}")
def fetch_config_files(branch, config_path, dest_dir):
config_path_url = config_path.replace(' ', '%20')
base_url = f"https://raw.githubusercontent.com/MarlinFirmware/Configurations/{branch}/config/{config_path_url}"
for file in CONFIG_FILES:
url = f"{base_url}/{file}"
dest_file = dest_dir / file
if os.getenv('DEBUG', '0') == '1':
debug_print(f"Fetching {file} from {url} to {dest_file}")
try:
urllib.request.urlretrieve(url, dest_file)
except urllib.error.HTTPError as e:
if e.code == 404:
if os.getenv('DEBUG', '0') == '1':
print(f"File {file} not found (404), skipping.")
else:
raise
def fetch_configs(branch, config_path):
print(f"Fetching {config_path} configurations from {branch}...")
marlin_dir = Path("Marlin")
if not marlin_dir.exists():
print(f"Directory 'Marlin' not found at the current location.")
sys.exit(1)
if os.environ.get('GITHUB_ACTIONS'): # Running on GitHub ?
copy_config_files(branch, config_path, marlin_dir)
else:
fetch_config_files(branch, config_path, marlin_dir)
def main():
branch = get_current_branch()
if not branch:
print("Not a git repository or no branch found.")
sys.exit(1)
if branch.startswith("bugfix-2."):
branch = branch
elif branch.endswith("bugfix-2.1.x"):
branch = "bugfix-2.1.x"
elif branch.endswith("-2.1.x") or branch == "2.1.x":
branch = "latest-2.1.x"
elif branch.endswith("-2.0.x") or branch == "2.0.x":
branch = "latest-2.0.x"
elif branch.endswith("-1.1.x") or branch == "1.1.x":
branch = "latest-1.1.x"
elif branch.endswith("-1.0.x") or branch == "1.0.x":
branch = "latest-1.0.x"
else:
branch = "bugfix-2.1.x"
if len(sys.argv) > 1:
arg = sys.argv[1]
if ':' in arg:
part1, part2 = arg.split(':', 1)
config_path = part2
branch = part1
else:
config_path = arg
config_path = 'examples/'+config_path
else:
config_path = "default"
try:
subprocess.run(['restore_configs'], check=True)
except FileNotFoundError:
try:
subprocess.run(['./buildroot/bin/restore_configs'], check=True)
except FileNotFoundError:
print("restore_configs not found, skipping.")
fetch_configs(branch, config_path)
if __name__ == "__main__":
main()

View File

@@ -24,7 +24,7 @@ restore_configs
opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \
EXTRUDERS 5 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 TEMP_SENSOR_3 1 TEMP_SENSOR_4 1 \
Z_DRIVER_TYPE A4988 Z2_DRIVER_TYPE A4988 Z3_DRIVER_TYPE A4988 Z4_DRIVER_TYPE A4988 \
DEFAULT_Kp_LIST '{ 22.2, 20.0, 21.0, 19.0, 18.0 }' DEFAULT_Ki_LIST '{ 1.08 }' DEFAULT_Kd_LIST '{ 114.0, 112.0, 110.0, 108.0 }'
DEFAULT_KP_LIST '{ 22.2, 20.0, 21.0, 19.0, 18.0 }' DEFAULT_KI_LIST '{ 1.08 }' DEFAULT_KD_LIST '{ 114.0, 112.0, 110.0, 108.0 }'
opt_enable TOOLCHANGE_FILAMENT_SWAP TOOLCHANGE_MIGRATION_FEATURE TOOLCHANGE_FS_SLOW_FIRST_PRIME TOOLCHANGE_FS_PRIME_FIRST_USED \
REPRAP_DISCOUNT_SMART_CONTROLLER PID_PARAMS_PER_HOTEND Z_MULTI_ENDSTOPS
exec_test $1 $2 "BigTreeTech GTR | 6 Extruders | Quad Z + Endstops" "$3"

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Build tests for AVR ATmega FYSETC F6 1.3
# Build tests for mega2560ext - AVR ATmega (extended)
#
# exit on first failure
@@ -64,7 +64,7 @@ opt_set MOTHERBOARD BOARD_FYSETC_F6_13 \
opt_enable USE_ZMIN_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW \
FYSETC_242_OLED_12864 EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL Z_SAFE_HOMING \
STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING SQUARE_WAVE_STEPPING
exec_test $1 $2 "FYSETC_F6 | SCARA | Mixed TMC | EEPROM" "$3"
exec_test $1 $2 "SCARA | Mixed TMC | EEPROM" "$3"
# clean up
restore_configs

View File

@@ -1,3 +1,3 @@
# Where have all the configurations gone?
## https://github.com/MarlinFirmware/Configurations/archive/release-2.1.2.5.zip
## https://github.com/MarlinFirmware/Configurations/archive/release-2.1.2.6.zip

View File

@@ -87,13 +87,6 @@ board = megaatmega2560
extends = common_avr8
board = reprap_rambo
#
# FYSETC F6 V1.3 / V1.4
#
[env:FYSETC_F6]
extends = common_avr8
board = fysetc_f6_13
#
# Sanguinololu (ATmega644p)
#

View File

@@ -95,3 +95,6 @@ extends = renamed
[env:STM32F407ZE_btt_USB] ;=> STM32F407ZE_btt_usb_flash_drive
extends = renamed
[env:FYSETC_F6] ;=> mega2560ext
extends = renamed