|
@@ -88,6 +88,10 @@
|
88
|
88
|
#include "../feature/pause.h"
|
89
|
89
|
#endif
|
90
|
90
|
|
|
91
|
+#if ENABLED(PID_EXTRUSION_SCALING)
|
|
92
|
+ #define LPQ_LEN thermalManager.lpq_len
|
|
93
|
+#endif
|
|
94
|
+
|
91
|
95
|
#pragma pack(push, 1) // No padding between variables
|
92
|
96
|
|
93
|
97
|
typedef struct PID { float Kp, Ki, Kd; } PID;
|
|
@@ -198,7 +202,7 @@ typedef struct SettingsDataStruct {
|
198
|
202
|
//
|
199
|
203
|
PIDC hotendPID[MAX_EXTRUDERS]; // M301 En PIDC / M303 En U
|
200
|
204
|
|
201
|
|
- int lpq_len; // M301 L
|
|
205
|
+ int16_t lpq_len; // M301 L
|
202
|
206
|
|
203
|
207
|
//
|
204
|
208
|
// PIDTEMPBED
|
|
@@ -594,9 +598,9 @@ void MarlinSettings::postprocess() {
|
594
|
598
|
_FIELD_TEST(lpq_len);
|
595
|
599
|
|
596
|
600
|
#if DISABLED(PID_EXTRUSION_SCALING)
|
597
|
|
- int lpq_len = 20;
|
|
601
|
+ const int16_t LPQ_LEN = 20;
|
598
|
602
|
#endif
|
599
|
|
- EEPROM_WRITE(lpq_len);
|
|
603
|
+ EEPROM_WRITE(LPQ_LEN);
|
600
|
604
|
|
601
|
605
|
#if DISABLED(PIDTEMPBED)
|
602
|
606
|
dummy = DUMMY_PID_VALUE;
|
|
@@ -1199,9 +1203,9 @@ void MarlinSettings::postprocess() {
|
1199
|
1203
|
_FIELD_TEST(lpq_len);
|
1200
|
1204
|
|
1201
|
1205
|
#if DISABLED(PID_EXTRUSION_SCALING)
|
1202
|
|
- int lpq_len;
|
|
1206
|
+ int16_t LPQ_LEN;
|
1203
|
1207
|
#endif
|
1204
|
|
- EEPROM_READ(lpq_len);
|
|
1208
|
+ EEPROM_READ(LPQ_LEN);
|
1205
|
1209
|
|
1206
|
1210
|
//
|
1207
|
1211
|
// Heated Bed PID
|
|
@@ -1812,7 +1816,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
1812
|
1816
|
#endif
|
1813
|
1817
|
}
|
1814
|
1818
|
#if ENABLED(PID_EXTRUSION_SCALING)
|
1815
|
|
- lpq_len = 20; // default last-position-queue size
|
|
1819
|
+ thermalManager.lpq_len = 20; // default last-position-queue size
|
1816
|
1820
|
#endif
|
1817
|
1821
|
#endif // PIDTEMP
|
1818
|
1822
|
|
|
@@ -2288,7 +2292,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
2288
|
2292
|
SERIAL_ECHOPAIR_P(port, " D", unscalePID_d(PID_PARAM(Kd, e)));
|
2289
|
2293
|
#if ENABLED(PID_EXTRUSION_SCALING)
|
2290
|
2294
|
SERIAL_ECHOPAIR_P(port, " C", PID_PARAM(Kc, e));
|
2291
|
|
- if (e == 0) SERIAL_ECHOPAIR_P(port, " L", lpq_len);
|
|
2295
|
+ if (e == 0) SERIAL_ECHOPAIR_P(port, " L", thermalManager.lpq_len);
|
2292
|
2296
|
#endif
|
2293
|
2297
|
SERIAL_EOL_P(port);
|
2294
|
2298
|
}
|
|
@@ -2303,7 +2307,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
2303
|
2307
|
SERIAL_ECHOPAIR_P(port, " D", unscalePID_d(PID_PARAM(Kd, 0)));
|
2304
|
2308
|
#if ENABLED(PID_EXTRUSION_SCALING)
|
2305
|
2309
|
SERIAL_ECHOPAIR_P(port, " C", PID_PARAM(Kc, 0));
|
2306
|
|
- SERIAL_ECHOPAIR_P(port, " L", lpq_len);
|
|
2310
|
+ SERIAL_ECHOPAIR_P(port, " L", thermalManager.lpq_len);
|
2307
|
2311
|
#endif
|
2308
|
2312
|
SERIAL_EOL_P(port);
|
2309
|
2313
|
}
|