Przeglądaj źródła

More EEPROM field debugging (#9123)

Scott Lahteine 7 lat temu
rodzic
commit
7e000e6af4
No account linked to committer's email address
1 zmienionych plików z 59 dodań i 18 usunięć
  1. 59
    18
      Marlin/src/module/configuration_store.cpp

+ 59
- 18
Marlin/src/module/configuration_store.cpp Wyświetl plik

@@ -37,7 +37,7 @@
37 37
  */
38 38
 
39 39
 // Change EEPROM version if the structure changes
40
-#define EEPROM_VERSION "V49"
40
+#define EEPROM_VERSION "V50"
41 41
 #define EEPROM_OFFSET 100
42 42
 
43 43
 // Check the integrity of data offsets.
@@ -165,9 +165,6 @@ typedef struct SettingsDataStruct {
165 165
     float x_endstop_adj,                                // M666 X
166 166
           y_endstop_adj,                                // M666 Y
167 167
           z_endstop_adj;                                // M666 Z
168
-    float xyz_dual_reserved[8];
169
-  #else
170
-    float xyz_dual_placeholder[11];
171 168
   #endif
172 169
 
173 170
   //
@@ -496,7 +493,9 @@ void MarlinSettings::postprocess() {
496 493
 
497 494
     // 11 floats for DELTA / [XYZ]_DUAL_ENDSTOPS
498 495
     #if ENABLED(DELTA)
496
+
499 497
       _FIELD_TEST(delta_height);
498
+
500 499
       EEPROM_WRITE(delta_height);              // 1 float
501 500
       EEPROM_WRITE(delta_endstop_adj);         // 3 floats
502 501
       EEPROM_WRITE(delta_radius);              // 1 float
@@ -506,7 +505,9 @@ void MarlinSettings::postprocess() {
506 505
       EEPROM_WRITE(delta_tower_angle_trim);    // 3 floats
507 506
 
508 507
     #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
508
+
509 509
       _FIELD_TEST(x_endstop_adj);
510
+
510 511
       // Write dual endstops in X, Y, Z order. Unused = 0.0
511 512
       dummy = 0.0f;
512 513
       #if ENABLED(X_DUAL_ENDSTOPS)
@@ -527,11 +528,6 @@ void MarlinSettings::postprocess() {
527 528
         EEPROM_WRITE(dummy);
528 529
       #endif
529 530
 
530
-      for (uint8_t q = 8; q--;) EEPROM_WRITE(dummy);
531
-
532
-    #else
533
-      dummy = 0.0f;
534
-      for (uint8_t q = 11; q--;) EEPROM_WRITE(dummy);
535 531
     #endif
536 532
 
537 533
     _FIELD_TEST(lcd_preheat_hotend_temp);
@@ -571,6 +567,8 @@ void MarlinSettings::postprocess() {
571 567
 
572 568
     } // Hotends Loop
573 569
 
570
+    _FIELD_TEST(lpq_len);
571
+
574 572
     #if DISABLED(PID_EXTRUSION_SCALING)
575 573
       int lpq_len = 20;
576 574
     #endif
@@ -612,7 +610,9 @@ void MarlinSettings::postprocess() {
612 610
     //
613 611
     // Volumetric & Filament Size
614 612
     //
613
+
615 614
     _FIELD_TEST(parser_volumetric_enabled);
615
+
616 616
     #if DISABLED(NO_VOLUMETRICS)
617 617
 
618 618
       EEPROM_WRITE(parser.volumetric_enabled);
@@ -635,7 +635,9 @@ void MarlinSettings::postprocess() {
635 635
     //
636 636
     // Save TMC2130 or TMC2208 Configuration, and placeholder values
637 637
     //
638
+
638 639
     _FIELD_TEST(tmc_stepper_current);
640
+
639 641
     uint16_t currents[11] = {
640 642
       #if HAS_TRINAMIC
641 643
         #if X_IS_TRINAMIC
@@ -724,7 +726,9 @@ void MarlinSettings::postprocess() {
724 726
     //
725 727
     // Linear Advance
726 728
     //
729
+
727 730
     _FIELD_TEST(planner_extruder_advance_k);
731
+
728 732
     #if ENABLED(LIN_ADVANCE)
729 733
       EEPROM_WRITE(planner.extruder_advance_k);
730 734
       EEPROM_WRITE(planner.advance_ed_ratio);
@@ -734,6 +738,8 @@ void MarlinSettings::postprocess() {
734 738
       EEPROM_WRITE(dummy);
735 739
     #endif
736 740
 
741
+    _FIELD_TEST(motor_current_setting);
742
+
737 743
     #if HAS_MOTOR_CURRENT_PWM
738 744
       for (uint8_t q = 3; q--;) EEPROM_WRITE(stepper.motor_current_setting[q]);
739 745
     #else
@@ -744,7 +750,9 @@ void MarlinSettings::postprocess() {
744 750
     //
745 751
     // CNC Coordinate Systems
746 752
     //
753
+
747 754
     _FIELD_TEST(coordinate_system);
755
+
748 756
     #if ENABLED(CNC_COORDINATE_SYSTEMS)
749 757
       EEPROM_WRITE(coordinate_system); // 27 floats
750 758
     #else
@@ -755,7 +763,9 @@ void MarlinSettings::postprocess() {
755 763
     //
756 764
     // Skew correction factors
757 765
     //
766
+
758 767
     _FIELD_TEST(planner_xy_skew_factor);
768
+
759 769
     #if ENABLED(SKEW_CORRECTION)
760 770
       EEPROM_WRITE(planner.xy_skew_factor);
761 771
       EEPROM_WRITE(planner.xz_skew_factor);
@@ -768,7 +778,9 @@ void MarlinSettings::postprocess() {
768 778
     //
769 779
     // Advanced Pause filament load & unload lengths
770 780
     //
781
+
771 782
     _FIELD_TEST(filament_change_unload_length);
783
+
772 784
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
773 785
       for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
774 786
         if (q < COUNT(filament_change_unload_length)) dummy = filament_change_unload_length[q];
@@ -856,6 +868,8 @@ void MarlinSettings::postprocess() {
856 868
 
857 869
       working_crc = 0;  // Init to 0. Accumulated by EEPROM_READ
858 870
 
871
+      _FIELD_TEST(esteppers);
872
+
859 873
       // Number of esteppers may change
860 874
       uint8_t esteppers;
861 875
       EEPROM_READ_ALWAYS(esteppers);
@@ -891,6 +905,8 @@ void MarlinSettings::postprocess() {
891 905
       // Home Offset (M206)
892 906
       //
893 907
 
908
+      _FIELD_TEST(home_offset);
909
+
894 910
       #if !HAS_HOME_OFFSET
895 911
         float home_offset[XYZ];
896 912
       #endif
@@ -941,6 +957,8 @@ void MarlinSettings::postprocess() {
941 957
         for (uint16_t q = mesh_num_x * mesh_num_y; q--;) EEPROM_READ(dummy);
942 958
       #endif // MESH_BED_LEVELING
943 959
 
960
+      _FIELD_TEST(zprobe_zoffset);
961
+
944 962
       #if !HAS_BED_PROBE
945 963
         float zprobe_zoffset;
946 964
       #endif
@@ -984,6 +1002,8 @@ void MarlinSettings::postprocess() {
984 1002
       // Unified Bed Leveling active state
985 1003
       //
986 1004
 
1005
+      _FIELD_TEST(planner_leveling_active);
1006
+
987 1007
       #if ENABLED(AUTO_BED_LEVELING_UBL)
988 1008
         EEPROM_READ(planner.leveling_active);
989 1009
         EEPROM_READ(ubl.storage_slot);
@@ -998,6 +1018,9 @@ void MarlinSettings::postprocess() {
998 1018
       //
999 1019
 
1000 1020
       #if ENABLED(DELTA)
1021
+
1022
+        _FIELD_TEST(delta_height);
1023
+
1001 1024
         EEPROM_READ(delta_height);              // 1 float
1002 1025
         EEPROM_READ(delta_endstop_adj);         // 3 floats
1003 1026
         EEPROM_READ(delta_radius);              // 1 float
@@ -1008,6 +1031,8 @@ void MarlinSettings::postprocess() {
1008 1031
 
1009 1032
       #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
1010 1033
 
1034
+        _FIELD_TEST(x_endstop_adj);
1035
+
1011 1036
         #if ENABLED(X_DUAL_ENDSTOPS)
1012 1037
           EEPROM_READ(endstops.x_endstop_adj);  // 1 float
1013 1038
         #else
@@ -1024,18 +1049,14 @@ void MarlinSettings::postprocess() {
1024 1049
           EEPROM_READ(dummy);
1025 1050
         #endif
1026 1051
 
1027
-        for (uint8_t q=8; q--;) EEPROM_READ(dummy);
1028
-
1029
-      #else
1030
-
1031
-        for (uint8_t q=11; q--;) EEPROM_READ(dummy);
1032
-
1033 1052
       #endif
1034 1053
 
1035 1054
       //
1036 1055
       // LCD Preheat settings
1037 1056
       //
1038 1057
 
1058
+      _FIELD_TEST(lcd_preheat_hotend_temp);
1059
+
1039 1060
       #if DISABLED(ULTIPANEL)
1040 1061
         int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
1041 1062
       #endif
@@ -1079,6 +1100,8 @@ void MarlinSettings::postprocess() {
1079 1100
       // PID Extrusion Scaling
1080 1101
       //
1081 1102
 
1103
+      _FIELD_TEST(lpq_len);
1104
+
1082 1105
       #if DISABLED(PID_EXTRUSION_SCALING)
1083 1106
         int lpq_len;
1084 1107
       #endif
@@ -1103,6 +1126,8 @@ void MarlinSettings::postprocess() {
1103 1126
       // LCD Contrast
1104 1127
       //
1105 1128
 
1129
+      _FIELD_TEST(lcd_contrast);
1130
+
1106 1131
       #if !HAS_LCD_CONTRAST
1107 1132
         uint16_t lcd_contrast;
1108 1133
       #endif
@@ -1130,6 +1155,9 @@ void MarlinSettings::postprocess() {
1130 1155
       //
1131 1156
       // Volumetric & Filament Size
1132 1157
       //
1158
+
1159
+      _FIELD_TEST(parser_volumetric_enabled);
1160
+
1133 1161
       #if DISABLED(NO_VOLUMETRICS)
1134 1162
 
1135 1163
         EEPROM_READ(parser.volumetric_enabled);
@@ -1150,10 +1178,13 @@ void MarlinSettings::postprocess() {
1150 1178
       //
1151 1179
       // TMC2130 Stepper Current
1152 1180
       //
1181
+
1182
+      _FIELD_TEST(tmc_stepper_current);
1183
+
1153 1184
       #if HAS_TRINAMIC
1154
-        #define SET_CURR(N,Q) stepper##Q.setCurrent(val[N] ? val[N] : Q##_CURRENT, R_SENSE, HOLD_MULTIPLIER)
1155
-        uint16_t val[11];
1156
-        EEPROM_READ(val);
1185
+        #define SET_CURR(N,Q) stepper##Q.setCurrent(currents[N] ? currents[N] : Q##_CURRENT, R_SENSE, HOLD_MULTIPLIER)
1186
+        uint16_t currents[11];
1187
+        EEPROM_READ(currents);
1157 1188
         if (!validating) {
1158 1189
           #if X_IS_TRINAMIC
1159 1190
             SET_CURR(0, X);
@@ -1227,6 +1258,8 @@ void MarlinSettings::postprocess() {
1227 1258
       // Linear Advance
1228 1259
       //
1229 1260
 
1261
+      _FIELD_TEST(planner_extruder_advance_k);
1262
+
1230 1263
       #if ENABLED(LIN_ADVANCE)
1231 1264
         EEPROM_READ(planner.extruder_advance_k);
1232 1265
         EEPROM_READ(planner.advance_ed_ratio);
@@ -1239,6 +1272,8 @@ void MarlinSettings::postprocess() {
1239 1272
       // Motor Current PWM
1240 1273
       //
1241 1274
 
1275
+      _FIELD_TEST(motor_current_setting);
1276
+
1242 1277
       #if HAS_MOTOR_CURRENT_PWM
1243 1278
         for (uint8_t q = 3; q--;) EEPROM_READ(stepper.motor_current_setting[q]);
1244 1279
       #else
@@ -1250,6 +1285,8 @@ void MarlinSettings::postprocess() {
1250 1285
       // CNC Coordinate System
1251 1286
       //
1252 1287
 
1288
+      _FIELD_TEST(coordinate_system);
1289
+
1253 1290
       #if ENABLED(CNC_COORDINATE_SYSTEMS)
1254 1291
         if (!validating) (void)gcode.select_coordinate_system(-1); // Go back to machine space
1255 1292
         EEPROM_READ(gcode.coordinate_system);                  // 27 floats
@@ -1261,6 +1298,8 @@ void MarlinSettings::postprocess() {
1261 1298
       // Skew correction factors
1262 1299
       //
1263 1300
 
1301
+      _FIELD_TEST(planner_xy_skew_factor);
1302
+
1264 1303
       #if ENABLED(SKEW_CORRECTION_GCODE)
1265 1304
         EEPROM_READ(planner.xy_skew_factor);
1266 1305
         #if ENABLED(SKEW_CORRECTION_FOR_Z)
@@ -1278,6 +1317,8 @@ void MarlinSettings::postprocess() {
1278 1317
       // Advanced Pause filament load & unload lengths
1279 1318
       //
1280 1319
 
1320
+      _FIELD_TEST(filament_change_unload_length);
1321
+
1281 1322
       #if ENABLED(ADVANCED_PAUSE_FEATURE)
1282 1323
         for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
1283 1324
           EEPROM_READ(dummy);

Ładowanie…
Anuluj
Zapisz