Skip to content

Commit 9c6872d

Browse files
⛙ Merge w/Marlin
2 parents c34ca02 + 29ad078 commit 9c6872d

File tree

99 files changed

+1328
-1499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1328
-1499
lines changed

Marlin/Configuration.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,8 @@
16861686
//#define PROBE_TOOLCHANGE_NO_MOVE // Suppress motion on probe tool-change
16871687
#endif
16881688

1689+
//#define PROBE_WAKEUP_TIME_MS 30 // (ms) Time for the probe to wake up
1690+
16891691
// Most probes should stay away from the edges of the bed, but
16901692
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
16911693
#define PROBING_MARGIN 0

Marlin/Configuration_adv.h

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@
11971197

11981198
#define FTM_TRAJECTORY_TYPE TRAPEZOIDAL // Block acceleration profile (TRAPEZOIDAL, POLY5, POLY6)
11991199
// TRAPEZOIDAL: Continuous Velocity. Max acceleration is respected.
1200-
// POLY5: Like POLY6 with 1.5x but cpu cheaper.
1200+
// POLY5: Like POLY6 with 1.5x but uses less CPU.
12011201
// POLY6: Continuous Acceleration (aka S_CURVE).
12021202
// POLY trajectories not only reduce resonances without rounding corners, but also
12031203
// reduce extruder strain due to linear advance.
@@ -1207,30 +1207,12 @@
12071207
/**
12081208
* Advanced configuration
12091209
*/
1210-
#define FTM_UNIFIED_BWS // DON'T DISABLE unless you use Ulendo FBS (not implemented)
1211-
#if ENABLED(FTM_UNIFIED_BWS)
1212-
#define FTM_BW_SIZE 100 // Unified Window and Batch size with a ratio of 2
1213-
#else
1214-
#define FTM_WINDOW_SIZE 200 // Custom Window size for trajectory generation needed by Ulendo FBS
1215-
#define FTM_BATCH_SIZE 100 // Custom Batch size for trajectory generation needed by Ulendo FBS
1216-
#endif
1217-
1218-
#define FTM_FS 1000 // (Hz) Frequency for trajectory generation
1219-
1220-
#if DISABLED(COREXY)
1221-
#define FTM_STEPPER_FS 20000 // (Hz) Frequency for stepper I/O update
1222-
1223-
// Use this to adjust the time required to consume the command buffer.
1224-
// Try increasing this value if stepper motion is choppy.
1225-
#define FTM_STEPPERCMD_BUFF_SIZE 3000 // Size of the stepper command buffers
1226-
1227-
#else
1228-
// CoreXY motion needs a larger buffer size. These values are based on our testing.
1229-
#define FTM_STEPPER_FS 30000
1230-
#define FTM_STEPPERCMD_BUFF_SIZE 6000
1231-
#endif
1210+
#define FTM_BUFFER_SIZE 128 // Window size for trajectory generation, must be a power of 2 (e.g 64, 128, 256, ...)
1211+
// The total buffered time in seconds is (FTM_BUFFER_SIZE/FTM_FS)
1212+
#define FTM_FS 1000 // (Hz) Frequency for trajectory generation.
1213+
#define FTM_STEPPER_FS 2'000'000 // (Hz) Time resolution of stepper I/O update. Shouldn't affect CPU much (slower board testing needed)
1214+
#define FTM_MIN_SHAPE_FREQ 20 // (Hz) Minimum shaping frequency, lower consumes more RAM
12321215

1233-
#define FTM_MIN_SHAPE_FREQ 10 // (Hz) Minimum shaping frequency, lower consumes more RAM
12341216
#endif // FT_MOTION
12351217

12361218
/**

Marlin/Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* here we define this default string as the date where the latest release
4242
* version was tagged.
4343
*/
44-
//#define STRING_DISTRIBUTION_DATE "2025-11-02"
44+
//#define STRING_DISTRIBUTION_DATE "2025-11-03"
4545

4646
#define STRING_DISTRIBUTION_DATE __DATE__
4747
#define STRING_DISTRIBUTION_TIME __TIME__

Marlin/src/HAL/NATIVE_SIM/fastio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include "../shared/Marduino.h"
2929
#include <pinmapping.h>
3030

31+
#define NO_COMPILE_TIME_PWM
32+
3133
#define SET_DIR_INPUT(IO) Gpio::setDir(IO, 1)
3234
#define SET_DIR_OUTPUT(IO) Gpio::setDir(IO, 0)
3335

Marlin/src/core/language.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@
303303
#define STR_ABL "Auto Bed Leveling"
304304
#define STR_X_TWIST_CORRECTION "X-Twist Correction"
305305
#define STR_SERVO_ANGLES "Servo Angles"
306+
#define STR_AUTOTEMP "Auto Temp Control"
306307
#define STR_HOTEND_PID "Hotend PID"
307308
#define STR_BED_PID "Bed PID"
308309
#define STR_CHAMBER_PID "Chamber PID"

Marlin/src/core/types.h

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,24 @@ struct Flags<N, false> {
238238
FI bool operator[](const int n) const { return test(n); }
239239
FI int size() const { return sizeof(b); }
240240
FI operator bool() const { return b != 0; }
241+
242+
FI Flags<N>& operator|=(Flags<N> &p) const { b |= p.b; return *this; }
243+
FI Flags<N>& operator&=(Flags<N> &p) const { b &= p.b; return *this; }
244+
FI Flags<N>& operator^=(Flags<N> &p) const { b ^= p.b; return *this; }
245+
246+
FI Flags<N>& operator|=(const flagbits_t &p) { b |= flagbits_t(p); return *this; }
247+
FI Flags<N>& operator&=(const flagbits_t &p) { b &= flagbits_t(p); return *this; }
248+
FI Flags<N>& operator^=(const flagbits_t &p) { b ^= flagbits_t(p); return *this; }
249+
250+
FI Flags<N> operator|(Flags<N> &p) const { return Flags<N>(b | p.b); }
251+
FI Flags<N> operator&(Flags<N> &p) const { return Flags<N>(b & p.b); }
252+
FI Flags<N> operator^(Flags<N> &p) const { return Flags<N>(b ^ p.b); }
253+
FI Flags<N> operator~() const { return Flags<N>(~b); }
254+
255+
FI flagbits_t operator|(const flagbits_t &p) const { return b | flagbits_t(p); }
256+
FI flagbits_t operator&(const flagbits_t &p) const { return b & flagbits_t(p); }
257+
FI flagbits_t operator^(const flagbits_t &p) const { return b ^ flagbits_t(p); }
258+
241259
};
242260

243261
// Flag bits for more than 64 states
@@ -635,6 +653,21 @@ struct XYval {
635653
FI bool operator==(const T &p) const { return x == p && y == p; }
636654
FI bool operator!=(const T &p) const { return !operator==(p); }
637655

656+
FI bool operator< (const XYval<T> &rs) const { return x < rs.x && y < rs.y; }
657+
FI bool operator<=(const XYval<T> &rs) const { return x <= rs.x && y <= rs.y; }
658+
FI bool operator> (const XYval<T> &rs) const { return x > rs.x && y > rs.y; }
659+
FI bool operator>=(const XYval<T> &rs) const { return x >= rs.x && y >= rs.y; }
660+
661+
FI bool operator< (const XYZval<T> &rs) const { return true XY_GANG(&& x < rs.x, && y < rs.y); }
662+
FI bool operator<=(const XYZval<T> &rs) const { return true XY_GANG(&& x <= rs.x, && y <= rs.y); }
663+
FI bool operator> (const XYZval<T> &rs) const { return true XY_GANG(&& x > rs.x, && y > rs.y); }
664+
FI bool operator>=(const XYZval<T> &rs) const { return true XY_GANG(&& x >= rs.x, && y >= rs.y); }
665+
666+
FI bool operator< (const XYZEval<T> &rs) const { return true XY_GANG(&& x < rs.x, && y < rs.y); }
667+
FI bool operator<=(const XYZEval<T> &rs) const { return true XY_GANG(&& x <= rs.x, && y <= rs.y); }
668+
FI bool operator> (const XYZEval<T> &rs) const { return true XY_GANG(&& x > rs.x, && y > rs.y); }
669+
FI bool operator>=(const XYZEval<T> &rs) const { return true XY_GANG(&& x >= rs.x, && y >= rs.y); }
670+
638671
};
639672

640673
//
@@ -794,6 +827,16 @@ struct XYZval {
794827
FI bool operator==(const T &p) const { return ENABLED(HAS_X_AXIS) NUM_AXIS_GANG(&& x == p, && y == p, && z == p, && i == p, && j == p, && k == p, && u == p, && v == p, && w == p); }
795828
FI bool operator!=(const T &p) const { return !operator==(p); }
796829

830+
FI bool operator< (const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x < rs.x, && y < rs.y, && z < rs.z, && i < rs.i, && j < rs.j, && k < rs.k, && u < rs.u, && v < rs.v, && w < rs.w); }
831+
FI bool operator<=(const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x <= rs.x, && y <= rs.y, && z <= rs.z, && i <= rs.i, && j <= rs.j, && k <= rs.k, && u <= rs.u, && v <= rs.v, && w <= rs.w); }
832+
FI bool operator> (const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x > rs.x, && y > rs.y, && z > rs.z, && i > rs.i, && j > rs.j, && k > rs.k, && u > rs.u, && v > rs.v, && w > rs.w); }
833+
FI bool operator>=(const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x >= rs.x, && y >= rs.y, && z >= rs.z, && i >= rs.i, && j >= rs.j, && k >= rs.k, && u >= rs.u, && v >= rs.v, && w >= rs.w); }
834+
835+
FI bool operator< (const XYZEval<T> &rs) const { return true NUM_AXIS_GANG(&& x < rs.x, && y < rs.y, && z < rs.z, && i < rs.i, && j < rs.j, && k < rs.k, && u < rs.u, && v < rs.v, && w < rs.w); }
836+
FI bool operator<=(const XYZEval<T> &rs) const { return true NUM_AXIS_GANG(&& x <= rs.x, && y <= rs.y, && z <= rs.z, && i <= rs.i, && j <= rs.j, && k <= rs.k, && u <= rs.u, && v <= rs.v, && w <= rs.w); }
837+
FI bool operator> (const XYZEval<T> &rs) const { return true NUM_AXIS_GANG(&& x > rs.x, && y > rs.y, && z > rs.z, && i > rs.i, && j > rs.j, && k > rs.k, && u > rs.u, && v > rs.v, && w > rs.w); }
838+
FI bool operator>=(const XYZEval<T> &rs) const { return true NUM_AXIS_GANG(&& x >= rs.x, && y >= rs.y, && z >= rs.z, && i >= rs.i, && j >= rs.j, && k >= rs.k, && u >= rs.u, && v >= rs.v, && w >= rs.w); }
839+
797840
};
798841

799842
//
@@ -957,6 +1000,16 @@ struct XYZEval {
9571000
FI bool operator==(const T &p) const { return ENABLED(HAS_X_AXIS) LOGICAL_AXIS_GANG(&& e == p, && x == p, && y == p, && z == p, && i == p, && j == p, && k == p, && u == p, && v == p, && w == p); }
9581001
FI bool operator!=(const T &p) const { return !operator==(p); }
9591002

1003+
FI bool operator< (const XYZEval<T> &rs) const { return true LOGICAL_AXIS_GANG(&& e < rs.e, && x < rs.x, && y < rs.y, && z < rs.z, && i < rs.i, && j < rs.j, && k < rs.k, && u < rs.u, && v < rs.v, && w < rs.w); }
1004+
FI bool operator<=(const XYZEval<T> &rs) const { return true LOGICAL_AXIS_GANG(&& e <= rs.e, && x <= rs.x, && y <= rs.y, && z <= rs.z, && i <= rs.i, && j <= rs.j, && k <= rs.k, && u <= rs.u, && v <= rs.v, && w <= rs.w); }
1005+
FI bool operator> (const XYZEval<T> &rs) const { return true LOGICAL_AXIS_GANG(&& e > rs.e, && x > rs.x, && y > rs.y, && z > rs.z, && i > rs.i, && j > rs.j, && k > rs.k, && u > rs.u, && v > rs.v, && w > rs.w); }
1006+
FI bool operator>=(const XYZEval<T> &rs) const { return true LOGICAL_AXIS_GANG(&& e >= rs.e, && x >= rs.x, && y >= rs.y, && z >= rs.z, && i >= rs.i, && j >= rs.j, && k >= rs.k, && u >= rs.u, && v >= rs.v, && w >= rs.w); }
1007+
1008+
FI bool operator< (const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x < rs.x, && y < rs.y, && z < rs.z, && i < rs.i, && j < rs.j, && k < rs.k, && u < rs.u, && v < rs.v, && w < rs.w); }
1009+
FI bool operator<=(const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x <= rs.x, && y <= rs.y, && z <= rs.z, && i <= rs.i, && j <= rs.j, && k <= rs.k, && u <= rs.u, && v <= rs.v, && w <= rs.w); }
1010+
FI bool operator> (const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x > rs.x, && y > rs.y, && z > rs.z, && i > rs.i, && j > rs.j, && k > rs.k, && u > rs.u, && v > rs.v, && w > rs.w); }
1011+
FI bool operator>=(const XYZval<T> &rs) const { return true NUM_AXIS_GANG(&& x >= rs.x, && y >= rs.y, && z >= rs.z, && i >= rs.i, && j >= rs.j, && k >= rs.k, && u >= rs.u, && v >= rs.v, && w >= rs.w); }
1012+
9601013
};
9611014

9621015
#include <string.h> // for memset
@@ -1263,6 +1316,7 @@ class AxisBits {
12631316
FI AxisBits operator|(const AxisBits &p) const { return AxisBits(bits | p.bits); }
12641317
FI AxisBits operator&(const AxisBits &p) const { return AxisBits(bits & p.bits); }
12651318
FI AxisBits operator^(const AxisBits &p) const { return AxisBits(bits ^ p.bits); }
1319+
FI AxisBits operator~() const { return AxisBits(~bits); }
12661320

12671321
FI operator bool() const { return !!bits; }
12681322
FI operator uint16_t() const { return uint16_t(bits & 0xFFFF); }

Marlin/src/gcode/gcode.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,9 @@ class GcodeSuite {
770770
static void M104_M109(const bool isM109);
771771
FORCE_INLINE static void M104() { M104_M109(false); }
772772
FORCE_INLINE static void M109() { M104_M109(true); }
773+
#if ENABLED(AUTOTEMP)
774+
static void M104_report(const bool forReplay=true);
775+
#endif
773776
#endif
774777

775778
static void M105();

Marlin/src/gcode/temp/M104_M109.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@
7474
* (used by printingIsActive, etc.) and turning off heaters will stop the timer.
7575
*/
7676
void GcodeSuite::M104_M109(const bool isM109) {
77+
#if ENABLED(AUTOTEMP)
78+
if (!isM109 && !parser.seen_any()) return M104_report();
79+
#endif
7780

7881
TERN_(CV_LASER_MODULE, LaserOn(false));
7982
// #if ENABLED(CV_LASER_MODULE)
@@ -134,10 +137,25 @@ void GcodeSuite::M104_M109(const bool isM109) {
134137
thermalManager.set_heating_message(target_extruder, !isM109 && got_temp);
135138
}
136139

137-
TERN_(AUTOTEMP, planner.autotemp_M104_M109());
140+
TERN_(AUTOTEMP, thermalManager.autotemp_M104_M109());
138141

139142
if (isM109 && got_temp)
140143
(void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling);
141144
}
142145

146+
#if ENABLED(AUTOTEMP)
147+
//
148+
// Report AUTOTEMP settings saved to EEPROM
149+
//
150+
void GcodeSuite::M104_report(const bool forReplay/*=true*/) {
151+
TERN_(MARLIN_SMALL_BUILD, return);
152+
report_heading_etc(forReplay, F(STR_AUTOTEMP));
153+
SERIAL_ECHOLNPGM(" M104"
154+
" S", thermalManager.autotemp.cfg.min,
155+
" B", thermalManager.autotemp.cfg.max,
156+
" F", thermalManager.autotemp.cfg.factor
157+
);
158+
}
159+
#endif
160+
143161
#endif // HAS_HOTEND

Marlin/src/inc/Conditionals-4-adv.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,10 +1536,6 @@
15361536
#if !HAS_EXTRUDERS
15371537
#undef FTM_SHAPER_E
15381538
#endif
1539-
#if ENABLED(FTM_UNIFIED_BWS)
1540-
#define FTM_WINDOW_SIZE FTM_BW_SIZE
1541-
#define FTM_BATCH_SIZE FTM_BW_SIZE
1542-
#endif
15431539
#endif
15441540

15451541
// Multi-Stepping Limit

Marlin/src/inc/Conditionals-5-post.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3681,4 +3681,8 @@
36813681
// 2HEI : FTM_RATIO * 3 / 2
36823682
// 3HEI : FTM_RATIO * 2
36833683
#define FTM_SMOOTHING_ORDER 5 // 3 to 5 is closest to gaussian
3684+
#ifndef FTM_BUFFER_SIZE
3685+
#define FTM_BUFFER_SIZE 128
3686+
#endif
3687+
#define FTM_BUFFER_MASK (FTM_BUFFER_SIZE - 1u)
36843688
#endif

0 commit comments

Comments
 (0)