|
@@ -141,7 +141,7 @@
|
141
|
141
|
* 539 M200 D parser.volumetric_enabled (bool)
|
142
|
142
|
* 540 M200 T D planner.filament_size (float x5) (T0..3)
|
143
|
143
|
*
|
144
|
|
- * HAVE_TMC2130: 22 bytes
|
|
144
|
+ * HAS_TRINAMIC: 22 bytes
|
145
|
145
|
* 560 M906 X Stepper X current (uint16_t)
|
146
|
146
|
* 562 M906 Y Stepper Y current (uint16_t)
|
147
|
147
|
* 564 M906 Z Stepper Z current (uint16_t)
|
|
@@ -155,28 +155,28 @@
|
155
|
155
|
* 580 M906 E4 Stepper E4 current (uint16_t)
|
156
|
156
|
*
|
157
|
157
|
* SENSORLESS HOMING 4 bytes
|
158
|
|
- * 580 M914 X Stepper X and X2 threshold (int16_t)
|
159
|
|
- * 582 M914 Y Stepper Y and Y2 threshold (int16_t)
|
|
158
|
+ * 582 M914 X Stepper X and X2 threshold (int16_t)
|
|
159
|
+ * 584 M914 Y Stepper Y and Y2 threshold (int16_t)
|
160
|
160
|
*
|
161
|
161
|
* LIN_ADVANCE: 8 bytes
|
162
|
|
- * 582 M900 K extruder_advance_k (float)
|
163
|
|
- * 586 M900 WHD advance_ed_ratio (float)
|
|
162
|
+ * 586 M900 K extruder_advance_k (float)
|
|
163
|
+ * 590 M900 WHD advance_ed_ratio (float)
|
164
|
164
|
*
|
165
|
165
|
* HAS_MOTOR_CURRENT_PWM:
|
166
|
|
- * 590 M907 X Stepper XY current (uint32_t)
|
167
|
|
- * 594 M907 Z Stepper Z current (uint32_t)
|
168
|
|
- * 598 M907 E Stepper E current (uint32_t)
|
|
166
|
+ * 594 M907 X Stepper XY current (uint32_t)
|
|
167
|
+ * 598 M907 Z Stepper Z current (uint32_t)
|
|
168
|
+ * 602 M907 E Stepper E current (uint32_t)
|
169
|
169
|
*
|
170
|
170
|
* CNC_COORDINATE_SYSTEMS 108 bytes
|
171
|
|
- * 602 G54-G59.3 coordinate_system (float x 27)
|
|
171
|
+ * 606 G54-G59.3 coordinate_system (float x 27)
|
172
|
172
|
*
|
173
|
173
|
* SKEW_CORRECTION: 12 bytes
|
174
|
|
- * 710 M852 I planner.xy_skew_factor (float)
|
175
|
|
- * 714 M852 J planner.xz_skew_factor (float)
|
176
|
|
- * 718 M852 K planner.yz_skew_factor (float)
|
|
174
|
+ * 714 M852 I planner.xy_skew_factor (float)
|
|
175
|
+ * 718 M852 J planner.xz_skew_factor (float)
|
|
176
|
+ * 722 M852 K planner.yz_skew_factor (float)
|
177
|
177
|
*
|
178
|
|
- * 722 Minimum end-point
|
179
|
|
- * 2251 (722 + 208 + 36 + 9 + 288 + 988) Maximum end-point
|
|
178
|
+ * 726 Minimum end-point
|
|
179
|
+ * 2255 (726 + 208 + 36 + 9 + 288 + 988) Maximum end-point
|
180
|
180
|
*
|
181
|
181
|
* ========================================================================
|
182
|
182
|
* meshes_begin (between max and min end-point, directly above)
|
|
@@ -290,7 +290,7 @@ void MarlinSettings::postprocess() {
|
290
|
290
|
bool MarlinSettings::eeprom_error;
|
291
|
291
|
|
292
|
292
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
293
|
|
- int MarlinSettings::meshes_begin;
|
|
293
|
+ int16_t MarlinSettings::meshes_begin;
|
294
|
294
|
#endif
|
295
|
295
|
|
296
|
296
|
/**
|
|
@@ -1256,7 +1256,7 @@ void MarlinSettings::postprocess() {
|
1256
|
1256
|
}
|
1257
|
1257
|
#endif
|
1258
|
1258
|
|
1259
|
|
- int MarlinSettings::calc_num_meshes() {
|
|
1259
|
+ uint16_t MarlinSettings::calc_num_meshes() {
|
1260
|
1260
|
//obviously this will get more sophisticated once we've added an actual MAT
|
1261
|
1261
|
|
1262
|
1262
|
if (meshes_begin <= 0) return 0;
|
|
@@ -1264,10 +1264,10 @@ void MarlinSettings::postprocess() {
|
1264
|
1264
|
return (meshes_end - meshes_begin) / sizeof(ubl.z_values);
|
1265
|
1265
|
}
|
1266
|
1266
|
|
1267
|
|
- void MarlinSettings::store_mesh(int8_t slot) {
|
|
1267
|
+ void MarlinSettings::store_mesh(const int8_t slot) {
|
1268
|
1268
|
|
1269
|
1269
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
1270
|
|
- const int a = calc_num_meshes();
|
|
1270
|
+ const int16_t a = calc_num_meshes();
|
1271
|
1271
|
if (!WITHIN(slot, 0, a - 1)) {
|
1272
|
1272
|
#if ENABLED(EEPROM_CHITCHAT)
|
1273
|
1273
|
ubl_invalid_slot(a);
|
|
@@ -1280,11 +1280,10 @@ void MarlinSettings::postprocess() {
|
1280
|
1280
|
}
|
1281
|
1281
|
|
1282
|
1282
|
uint16_t crc = 0;
|
1283
|
|
- bool status;
|
1284
|
1283
|
int pos = meshes_end - (slot + 1) * sizeof(ubl.z_values);
|
1285
|
1284
|
|
1286
|
1285
|
HAL::PersistentStore::access_start();
|
1287
|
|
- status = HAL::PersistentStore::write_data(pos, (uint8_t *)&ubl.z_values, sizeof(ubl.z_values), &crc);
|
|
1286
|
+ const bool status = HAL::PersistentStore::write_data(pos, (uint8_t *)&ubl.z_values, sizeof(ubl.z_values), &crc);
|
1288
|
1287
|
HAL::PersistentStore::access_finish();
|
1289
|
1288
|
|
1290
|
1289
|
if (status)
|
|
@@ -1304,7 +1303,7 @@ void MarlinSettings::postprocess() {
|
1304
|
1303
|
#endif
|
1305
|
1304
|
}
|
1306
|
1305
|
|
1307
|
|
- void MarlinSettings::load_mesh(int8_t slot, void *into /* = 0 */) {
|
|
1306
|
+ void MarlinSettings::load_mesh(const int8_t slot, void * const into/*=NULL*/) {
|
1308
|
1307
|
|
1309
|
1308
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
1310
|
1309
|
|
|
@@ -1320,10 +1319,9 @@ void MarlinSettings::postprocess() {
|
1320
|
1319
|
uint16_t crc = 0;
|
1321
|
1320
|
int pos = meshes_end - (slot + 1) * sizeof(ubl.z_values);
|
1322
|
1321
|
uint8_t * const dest = into ? (uint8_t*)into : (uint8_t*)&ubl.z_values;
|
1323
|
|
- uint16_t status;
|
1324
|
1322
|
|
1325
|
1323
|
HAL::PersistentStore::access_start();
|
1326
|
|
- status = HAL::PersistentStore::read_data(pos, dest, sizeof(ubl.z_values), &crc);
|
|
1324
|
+ const uint16_t status = HAL::PersistentStore::read_data(pos, dest, sizeof(ubl.z_values), &crc);
|
1327
|
1325
|
HAL::PersistentStore::access_finish();
|
1328
|
1326
|
|
1329
|
1327
|
if (status)
|
|
@@ -1373,17 +1371,13 @@ void MarlinSettings::reset() {
|
1373
|
1371
|
planner.retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
|
1374
|
1372
|
planner.travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
|
1375
|
1373
|
planner.min_feedrate_mm_s = DEFAULT_MINIMUMFEEDRATE;
|
1376
|
|
- planner.min_segment_time_us = DEFAULT_MINSEGMENTTIME;
|
1377
|
1374
|
planner.min_travel_feedrate_mm_s = DEFAULT_MINTRAVELFEEDRATE;
|
|
1375
|
+ planner.min_segment_time_us = DEFAULT_MINSEGMENTTIME;
|
1378
|
1376
|
planner.max_jerk[X_AXIS] = DEFAULT_XJERK;
|
1379
|
1377
|
planner.max_jerk[Y_AXIS] = DEFAULT_YJERK;
|
1380
|
1378
|
planner.max_jerk[Z_AXIS] = DEFAULT_ZJERK;
|
1381
|
1379
|
planner.max_jerk[E_AXIS] = DEFAULT_EJERK;
|
1382
|
1380
|
|
1383
|
|
- #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
1384
|
|
- new_z_fade_height = 0.0;
|
1385
|
|
- #endif
|
1386
|
|
-
|
1387
|
1381
|
#if HAS_HOME_OFFSET
|
1388
|
1382
|
ZERO(home_offset);
|
1389
|
1383
|
#endif
|
|
@@ -1405,7 +1399,14 @@ void MarlinSettings::reset() {
|
1405
|
1399
|
LOOP_XYZ(i) HOTEND_LOOP() hotend_offset[i][e] = tmp4[i][e];
|
1406
|
1400
|
#endif
|
1407
|
1401
|
|
1408
|
|
- // Applies to all MBL and ABL
|
|
1402
|
+ //
|
|
1403
|
+ // Global Leveling
|
|
1404
|
+ //
|
|
1405
|
+
|
|
1406
|
+ #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
|
1407
|
+ new_z_fade_height = 0.0;
|
|
1408
|
+ #endif
|
|
1409
|
+
|
1409
|
1410
|
#if HAS_LEVELING
|
1410
|
1411
|
reset_bed_level();
|
1411
|
1412
|
#endif
|
|
@@ -1466,10 +1467,6 @@ void MarlinSettings::reset() {
|
1466
|
1467
|
lcd_preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED;
|
1467
|
1468
|
#endif
|
1468
|
1469
|
|
1469
|
|
- #if HAS_LCD_CONTRAST
|
1470
|
|
- lcd_contrast = DEFAULT_LCD_CONTRAST;
|
1471
|
|
- #endif
|
1472
|
|
-
|
1473
|
1470
|
#if ENABLED(PIDTEMP)
|
1474
|
1471
|
#if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
|
1475
|
1472
|
HOTEND_LOOP()
|
|
@@ -1493,6 +1490,10 @@ void MarlinSettings::reset() {
|
1493
|
1490
|
thermalManager.bedKd = scalePID_d(DEFAULT_bedKd);
|
1494
|
1491
|
#endif
|
1495
|
1492
|
|
|
1493
|
+ #if HAS_LCD_CONTRAST
|
|
1494
|
+ lcd_contrast = DEFAULT_LCD_CONTRAST;
|
|
1495
|
+ #endif
|
|
1496
|
+
|
1496
|
1497
|
#if ENABLED(FWRETRACT)
|
1497
|
1498
|
fwretract.reset();
|
1498
|
1499
|
#endif
|
|
@@ -1579,10 +1580,6 @@ void MarlinSettings::reset() {
|
1579
|
1580
|
stepper.digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q]));
|
1580
|
1581
|
#endif
|
1581
|
1582
|
|
1582
|
|
- #if ENABLED(AUTO_BED_LEVELING_UBL)
|
1583
|
|
- ubl.reset();
|
1584
|
|
- #endif
|
1585
|
|
-
|
1586
|
1583
|
#if ENABLED(SKEW_CORRECTION_GCODE)
|
1587
|
1584
|
planner.xy_skew_factor = XY_SKEW_FACTOR;
|
1588
|
1585
|
#if ENABLED(SKEW_CORRECTION_FOR_Z)
|