Browse Source

Overridable Options - Part 11 (PR#2563)

Apply `ENABLED` / `DISABLED` macros to EEPROM-related files.
Scott Lahteine 9 years ago
parent
commit
5e834352a9
2 changed files with 55 additions and 55 deletions
  1. 53
    53
      Marlin/configuration_store.cpp
  2. 2
    2
      Marlin/configuration_store.h

+ 53
- 53
Marlin/configuration_store.cpp View File

95
 #include "ultralcd.h"
95
 #include "ultralcd.h"
96
 #include "configuration_store.h"
96
 #include "configuration_store.h"
97
 
97
 
98
-#ifdef MESH_BED_LEVELING
98
+#if ENABLED(MESH_BED_LEVELING)
99
   #include "mesh_bed_leveling.h"
99
   #include "mesh_bed_leveling.h"
100
 #endif
100
 #endif
101
 
101
 
130
 
130
 
131
 #define EEPROM_OFFSET 100
131
 #define EEPROM_OFFSET 100
132
 
132
 
133
-#ifdef EEPROM_SETTINGS
133
+#if ENABLED(EEPROM_SETTINGS)
134
 
134
 
135
 void Config_StoreSettings()  {
135
 void Config_StoreSettings()  {
136
   float dummy = 0.0f;
136
   float dummy = 0.0f;
153
 
153
 
154
   uint8_t mesh_num_x = 3;
154
   uint8_t mesh_num_x = 3;
155
   uint8_t mesh_num_y = 3;
155
   uint8_t mesh_num_y = 3;
156
-  #ifdef MESH_BED_LEVELING
156
+  #if ENABLED(MESH_BED_LEVELING)
157
     // Compile time test that sizeof(mbl.z_values) is as expected
157
     // Compile time test that sizeof(mbl.z_values) is as expected
158
     typedef char c_assert[(sizeof(mbl.z_values) == MESH_NUM_X_POINTS*MESH_NUM_Y_POINTS*sizeof(dummy)) ? 1 : -1];
158
     typedef char c_assert[(sizeof(mbl.z_values) == MESH_NUM_X_POINTS*MESH_NUM_Y_POINTS*sizeof(dummy)) ? 1 : -1];
159
     mesh_num_x = MESH_NUM_X_POINTS;
159
     mesh_num_x = MESH_NUM_X_POINTS;
171
     for (int q=0; q<mesh_num_x*mesh_num_y; q++) EEPROM_WRITE_VAR(i, dummy);
171
     for (int q=0; q<mesh_num_x*mesh_num_y; q++) EEPROM_WRITE_VAR(i, dummy);
172
   #endif // MESH_BED_LEVELING
172
   #endif // MESH_BED_LEVELING
173
 
173
 
174
-  #ifndef ENABLE_AUTO_BED_LEVELING
174
+  #if DISABLED(ENABLE_AUTO_BED_LEVELING)
175
     float zprobe_zoffset = 0;
175
     float zprobe_zoffset = 0;
176
   #endif
176
   #endif
177
   EEPROM_WRITE_VAR(i, zprobe_zoffset);
177
   EEPROM_WRITE_VAR(i, zprobe_zoffset);
178
 
178
 
179
-  #ifdef DELTA
179
+  #if ENABLED(DELTA)
180
     EEPROM_WRITE_VAR(i, endstop_adj);               // 3 floats
180
     EEPROM_WRITE_VAR(i, endstop_adj);               // 3 floats
181
     EEPROM_WRITE_VAR(i, delta_radius);              // 1 float
181
     EEPROM_WRITE_VAR(i, delta_radius);              // 1 float
182
     EEPROM_WRITE_VAR(i, delta_diagonal_rod);        // 1 float
182
     EEPROM_WRITE_VAR(i, delta_diagonal_rod);        // 1 float
183
     EEPROM_WRITE_VAR(i, delta_segments_per_second); // 1 float
183
     EEPROM_WRITE_VAR(i, delta_segments_per_second); // 1 float
184
-  #elif defined(Z_DUAL_ENDSTOPS)
184
+  #elif ENABLED(Z_DUAL_ENDSTOPS)
185
     EEPROM_WRITE_VAR(i, z_endstop_adj);            // 1 floats
185
     EEPROM_WRITE_VAR(i, z_endstop_adj);            // 1 floats
186
     dummy = 0.0f;
186
     dummy = 0.0f;
187
     for (int q=5; q--;) EEPROM_WRITE_VAR(i, dummy);
187
     for (int q=5; q--;) EEPROM_WRITE_VAR(i, dummy);
190
     for (int q=6; q--;) EEPROM_WRITE_VAR(i, dummy);
190
     for (int q=6; q--;) EEPROM_WRITE_VAR(i, dummy);
191
   #endif
191
   #endif
192
 
192
 
193
-  #ifndef ULTIPANEL
193
+  #if DISABLED(ULTIPANEL)
194
     int plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP, plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP, plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED,
194
     int plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP, plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP, plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED,
195
         absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP, absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP, absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
195
         absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP, absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP, absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
196
   #endif // !ULTIPANEL
196
   #endif // !ULTIPANEL
204
 
204
 
205
   for (int e = 0; e < 4; e++) {
205
   for (int e = 0; e < 4; e++) {
206
 
206
 
207
-    #ifdef PIDTEMP
207
+    #if ENABLED(PIDTEMP)
208
       if (e < EXTRUDERS) {
208
       if (e < EXTRUDERS) {
209
         EEPROM_WRITE_VAR(i, PID_PARAM(Kp, e));
209
         EEPROM_WRITE_VAR(i, PID_PARAM(Kp, e));
210
         EEPROM_WRITE_VAR(i, PID_PARAM(Ki, e));
210
         EEPROM_WRITE_VAR(i, PID_PARAM(Ki, e));
211
         EEPROM_WRITE_VAR(i, PID_PARAM(Kd, e));
211
         EEPROM_WRITE_VAR(i, PID_PARAM(Kd, e));
212
-        #ifdef PID_ADD_EXTRUSION_RATE
212
+        #if ENABLED(PID_ADD_EXTRUSION_RATE)
213
           EEPROM_WRITE_VAR(i, PID_PARAM(Kc, e));
213
           EEPROM_WRITE_VAR(i, PID_PARAM(Kc, e));
214
         #else
214
         #else
215
           dummy = 1.0f; // 1.0 = default kc
215
           dummy = 1.0f; // 1.0 = default kc
227
 
227
 
228
   } // Extruders Loop
228
   } // Extruders Loop
229
 
229
 
230
-  #ifndef PIDTEMPBED
230
+  #if DISABLED(PIDTEMPBED)
231
     float bedKp = DUMMY_PID_VALUE, bedKi = DUMMY_PID_VALUE, bedKd = DUMMY_PID_VALUE;
231
     float bedKp = DUMMY_PID_VALUE, bedKi = DUMMY_PID_VALUE, bedKd = DUMMY_PID_VALUE;
232
   #endif
232
   #endif
233
 
233
 
235
   EEPROM_WRITE_VAR(i, bedKi);
235
   EEPROM_WRITE_VAR(i, bedKi);
236
   EEPROM_WRITE_VAR(i, bedKd);
236
   EEPROM_WRITE_VAR(i, bedKd);
237
 
237
 
238
-  #ifndef HAS_LCD_CONTRAST
239
-    int lcd_contrast = 32;
238
+  #if DISABLED(HAS_LCD_CONTRAST)
239
+    const int lcd_contrast = 32;
240
   #endif
240
   #endif
241
   EEPROM_WRITE_VAR(i, lcd_contrast);
241
   EEPROM_WRITE_VAR(i, lcd_contrast);
242
 
242
 
243
-  #ifdef SCARA
243
+  #if ENABLED(SCARA)
244
     EEPROM_WRITE_VAR(i, axis_scaling); // 3 floats
244
     EEPROM_WRITE_VAR(i, axis_scaling); // 3 floats
245
   #else
245
   #else
246
     dummy = 1.0f;
246
     dummy = 1.0f;
247
     EEPROM_WRITE_VAR(i, dummy);
247
     EEPROM_WRITE_VAR(i, dummy);
248
   #endif
248
   #endif
249
 
249
 
250
-  #ifdef FWRETRACT
250
+  #if ENABLED(FWRETRACT)
251
     EEPROM_WRITE_VAR(i, autoretract_enabled);
251
     EEPROM_WRITE_VAR(i, autoretract_enabled);
252
     EEPROM_WRITE_VAR(i, retract_length);
252
     EEPROM_WRITE_VAR(i, retract_length);
253
     #if EXTRUDERS > 1
253
     #if EXTRUDERS > 1
327
     EEPROM_READ_VAR(i, dummy_uint8);
327
     EEPROM_READ_VAR(i, dummy_uint8);
328
     EEPROM_READ_VAR(i, mesh_num_x);
328
     EEPROM_READ_VAR(i, mesh_num_x);
329
     EEPROM_READ_VAR(i, mesh_num_y);
329
     EEPROM_READ_VAR(i, mesh_num_y);
330
-    #ifdef MESH_BED_LEVELING
330
+    #if ENABLED(MESH_BED_LEVELING)
331
       mbl.active = dummy_uint8;
331
       mbl.active = dummy_uint8;
332
       if (mesh_num_x == MESH_NUM_X_POINTS && mesh_num_y == MESH_NUM_Y_POINTS) {
332
       if (mesh_num_x == MESH_NUM_X_POINTS && mesh_num_y == MESH_NUM_Y_POINTS) {
333
         EEPROM_READ_VAR(i, mbl.z_values);
333
         EEPROM_READ_VAR(i, mbl.z_values);
339
       for (int q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy);
339
       for (int q = 0; q < mesh_num_x * mesh_num_y; q++) EEPROM_READ_VAR(i, dummy);
340
     #endif // MESH_BED_LEVELING
340
     #endif // MESH_BED_LEVELING
341
 
341
 
342
-    #ifndef ENABLE_AUTO_BED_LEVELING
342
+    #if DISABLED(ENABLE_AUTO_BED_LEVELING)
343
       float zprobe_zoffset = 0;
343
       float zprobe_zoffset = 0;
344
     #endif
344
     #endif
345
     EEPROM_READ_VAR(i, zprobe_zoffset);
345
     EEPROM_READ_VAR(i, zprobe_zoffset);
346
 
346
 
347
-    #ifdef DELTA
347
+    #if ENABLED(DELTA)
348
       EEPROM_READ_VAR(i, endstop_adj);                // 3 floats
348
       EEPROM_READ_VAR(i, endstop_adj);                // 3 floats
349
       EEPROM_READ_VAR(i, delta_radius);               // 1 float
349
       EEPROM_READ_VAR(i, delta_radius);               // 1 float
350
       EEPROM_READ_VAR(i, delta_diagonal_rod);         // 1 float
350
       EEPROM_READ_VAR(i, delta_diagonal_rod);         // 1 float
351
       EEPROM_READ_VAR(i, delta_segments_per_second);  // 1 float
351
       EEPROM_READ_VAR(i, delta_segments_per_second);  // 1 float
352
-    #elif defined(Z_DUAL_ENDSTOPS)
352
+    #elif ENABLED(Z_DUAL_ENDSTOPS)
353
       EEPROM_READ_VAR(i, z_endstop_adj);
353
       EEPROM_READ_VAR(i, z_endstop_adj);
354
       dummy = 0.0f;
354
       dummy = 0.0f;
355
       for (int q=5; q--;) EEPROM_READ_VAR(i, dummy);
355
       for (int q=5; q--;) EEPROM_READ_VAR(i, dummy);
358
       for (int q=6; q--;) EEPROM_READ_VAR(i, dummy);
358
       for (int q=6; q--;) EEPROM_READ_VAR(i, dummy);
359
     #endif
359
     #endif
360
 
360
 
361
-    #ifndef ULTIPANEL
361
+    #if DISABLED(ULTIPANEL)
362
       int plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed,
362
       int plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed,
363
           absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed;
363
           absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed;
364
     #endif
364
     #endif
370
     EEPROM_READ_VAR(i, absPreheatHPBTemp);
370
     EEPROM_READ_VAR(i, absPreheatHPBTemp);
371
     EEPROM_READ_VAR(i, absPreheatFanSpeed);
371
     EEPROM_READ_VAR(i, absPreheatFanSpeed);
372
 
372
 
373
-    #ifdef PIDTEMP
373
+    #if ENABLED(PIDTEMP)
374
       for (int e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin
374
       for (int e = 0; e < 4; e++) { // 4 = max extruders currently supported by Marlin
375
         EEPROM_READ_VAR(i, dummy); // Kp
375
         EEPROM_READ_VAR(i, dummy); // Kp
376
         if (e < EXTRUDERS && dummy != DUMMY_PID_VALUE) {
376
         if (e < EXTRUDERS && dummy != DUMMY_PID_VALUE) {
378
           PID_PARAM(Kp, e) = dummy;
378
           PID_PARAM(Kp, e) = dummy;
379
           EEPROM_READ_VAR(i, PID_PARAM(Ki, e));
379
           EEPROM_READ_VAR(i, PID_PARAM(Ki, e));
380
           EEPROM_READ_VAR(i, PID_PARAM(Kd, e));
380
           EEPROM_READ_VAR(i, PID_PARAM(Kd, e));
381
-          #ifdef PID_ADD_EXTRUSION_RATE
381
+          #if ENABLED(PID_ADD_EXTRUSION_RATE)
382
             EEPROM_READ_VAR(i, PID_PARAM(Kc, e));
382
             EEPROM_READ_VAR(i, PID_PARAM(Kc, e));
383
           #else
383
           #else
384
             EEPROM_READ_VAR(i, dummy);
384
             EEPROM_READ_VAR(i, dummy);
393
       for (int q=16; q--;) EEPROM_READ_VAR(i, dummy);  // 4x Kp, Ki, Kd, Kc
393
       for (int q=16; q--;) EEPROM_READ_VAR(i, dummy);  // 4x Kp, Ki, Kd, Kc
394
     #endif // !PIDTEMP
394
     #endif // !PIDTEMP
395
 
395
 
396
-    #ifndef PIDTEMPBED
396
+    #if DISABLED(PIDTEMPBED)
397
       float bedKp, bedKi, bedKd;
397
       float bedKp, bedKi, bedKd;
398
     #endif
398
     #endif
399
 
399
 
407
       for (int q=2; q--;) EEPROM_READ_VAR(i, dummy); // bedKi, bedKd
407
       for (int q=2; q--;) EEPROM_READ_VAR(i, dummy); // bedKi, bedKd
408
     }
408
     }
409
 
409
 
410
-    #ifndef HAS_LCD_CONTRAST
410
+    #if DISABLED(HAS_LCD_CONTRAST)
411
       int lcd_contrast;
411
       int lcd_contrast;
412
     #endif
412
     #endif
413
     EEPROM_READ_VAR(i, lcd_contrast);
413
     EEPROM_READ_VAR(i, lcd_contrast);
414
 
414
 
415
-    #ifdef SCARA
415
+    #if ENABLED(SCARA)
416
       EEPROM_READ_VAR(i, axis_scaling);  // 3 floats
416
       EEPROM_READ_VAR(i, axis_scaling);  // 3 floats
417
     #else
417
     #else
418
       EEPROM_READ_VAR(i, dummy);
418
       EEPROM_READ_VAR(i, dummy);
419
     #endif
419
     #endif
420
 
420
 
421
-    #ifdef FWRETRACT
421
+    #if ENABLED(FWRETRACT)
422
       EEPROM_READ_VAR(i, autoretract_enabled);
422
       EEPROM_READ_VAR(i, autoretract_enabled);
423
       EEPROM_READ_VAR(i, retract_length);
423
       EEPROM_READ_VAR(i, retract_length);
424
       #if EXTRUDERS > 1
424
       #if EXTRUDERS > 1
455
     SERIAL_ECHOLNPGM(" bytes)");
455
     SERIAL_ECHOLNPGM(" bytes)");
456
   }
456
   }
457
 
457
 
458
-  #ifdef EEPROM_CHITCHAT
458
+  #if ENABLED(EEPROM_CHITCHAT)
459
     Config_PrintSettings();
459
     Config_PrintSettings();
460
   #endif
460
   #endif
461
 }
461
 }
474
     axis_steps_per_unit[i] = tmp1[i];
474
     axis_steps_per_unit[i] = tmp1[i];
475
     max_feedrate[i] = tmp2[i];
475
     max_feedrate[i] = tmp2[i];
476
     max_acceleration_units_per_sq_second[i] = tmp3[i];
476
     max_acceleration_units_per_sq_second[i] = tmp3[i];
477
-    #ifdef SCARA
477
+    #if ENABLED(SCARA)
478
       if (i < COUNT(axis_scaling))
478
       if (i < COUNT(axis_scaling))
479
         axis_scaling[i] = 1;
479
         axis_scaling[i] = 1;
480
     #endif
480
     #endif
494
   max_e_jerk = DEFAULT_EJERK;
494
   max_e_jerk = DEFAULT_EJERK;
495
   home_offset[X_AXIS] = home_offset[Y_AXIS] = home_offset[Z_AXIS] = 0;
495
   home_offset[X_AXIS] = home_offset[Y_AXIS] = home_offset[Z_AXIS] = 0;
496
 
496
 
497
-  #ifdef MESH_BED_LEVELING
497
+  #if ENABLED(MESH_BED_LEVELING)
498
     mbl.active = 0;
498
     mbl.active = 0;
499
   #endif
499
   #endif
500
 
500
 
501
-  #ifdef ENABLE_AUTO_BED_LEVELING
501
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
502
     zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
502
     zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
503
   #endif
503
   #endif
504
 
504
 
505
-  #ifdef DELTA
505
+  #if ENABLED(DELTA)
506
     endstop_adj[X_AXIS] = endstop_adj[Y_AXIS] = endstop_adj[Z_AXIS] = 0;
506
     endstop_adj[X_AXIS] = endstop_adj[Y_AXIS] = endstop_adj[Z_AXIS] = 0;
507
     delta_radius =  DELTA_RADIUS;
507
     delta_radius =  DELTA_RADIUS;
508
     delta_diagonal_rod =  DELTA_DIAGONAL_ROD;
508
     delta_diagonal_rod =  DELTA_DIAGONAL_ROD;
509
     delta_segments_per_second =  DELTA_SEGMENTS_PER_SECOND;
509
     delta_segments_per_second =  DELTA_SEGMENTS_PER_SECOND;
510
     recalc_delta_settings(delta_radius, delta_diagonal_rod);
510
     recalc_delta_settings(delta_radius, delta_diagonal_rod);
511
-  #elif defined(Z_DUAL_ENDSTOPS)
511
+  #elif ENABLED(Z_DUAL_ENDSTOPS)
512
     z_endstop_adj = 0;
512
     z_endstop_adj = 0;
513
   #endif
513
   #endif
514
 
514
 
515
-  #ifdef ULTIPANEL
515
+  #if ENABLED(ULTIPANEL)
516
     plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP;
516
     plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP;
517
     plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP;
517
     plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP;
518
     plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED;
518
     plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED;
521
     absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
521
     absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
522
   #endif
522
   #endif
523
 
523
 
524
-  #ifdef HAS_LCD_CONTRAST
524
+  #if ENABLED(HAS_LCD_CONTRAST)
525
     lcd_contrast = DEFAULT_LCD_CONTRAST;
525
     lcd_contrast = DEFAULT_LCD_CONTRAST;
526
   #endif
526
   #endif
527
 
527
 
528
-  #ifdef PIDTEMP
529
-    #ifdef PID_PARAMS_PER_EXTRUDER
528
+  #if ENABLED(PIDTEMP)
529
+    #if ENABLED(PID_PARAMS_PER_EXTRUDER)
530
       for (int e = 0; e < EXTRUDERS; e++)
530
       for (int e = 0; e < EXTRUDERS; e++)
531
     #else
531
     #else
532
       int e = 0; // only need to write once
532
       int e = 0; // only need to write once
535
       PID_PARAM(Kp, e) = DEFAULT_Kp;
535
       PID_PARAM(Kp, e) = DEFAULT_Kp;
536
       PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki);
536
       PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki);
537
       PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd);
537
       PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd);
538
-      #ifdef PID_ADD_EXTRUSION_RATE
538
+      #if ENABLED(PID_ADD_EXTRUSION_RATE)
539
         PID_PARAM(Kc, e) = DEFAULT_Kc;
539
         PID_PARAM(Kc, e) = DEFAULT_Kc;
540
       #endif
540
       #endif
541
     }
541
     }
543
     updatePID();
543
     updatePID();
544
   #endif // PIDTEMP
544
   #endif // PIDTEMP
545
 
545
 
546
-  #ifdef PIDTEMPBED
546
+  #if ENABLED(PIDTEMPBED)
547
     bedKp = DEFAULT_bedKp;
547
     bedKp = DEFAULT_bedKp;
548
     bedKi = scalePID_i(DEFAULT_bedKi);
548
     bedKi = scalePID_i(DEFAULT_bedKi);
549
     bedKd = scalePID_d(DEFAULT_bedKd);
549
     bedKd = scalePID_d(DEFAULT_bedKd);
550
   #endif
550
   #endif
551
 
551
 
552
-  #ifdef FWRETRACT
552
+  #if ENABLED(FWRETRACT)
553
     autoretract_enabled = false;
553
     autoretract_enabled = false;
554
     retract_length = RETRACT_LENGTH;
554
     retract_length = RETRACT_LENGTH;
555
     #if EXTRUDERS > 1
555
     #if EXTRUDERS > 1
573
   SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded");
573
   SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded");
574
 }
574
 }
575
 
575
 
576
-#ifndef DISABLE_M503
576
+#if DISABLED(DISABLE_M503)
577
 
577
 
578
 /**
578
 /**
579
  * Print Configuration Settings - M503
579
  * Print Configuration Settings - M503
598
 
598
 
599
   CONFIG_ECHO_START;
599
   CONFIG_ECHO_START;
600
 
600
 
601
-  #ifdef SCARA
601
+  #if ENABLED(SCARA)
602
     if (!forReplay) {
602
     if (!forReplay) {
603
       SERIAL_ECHOLNPGM("Scaling factors:");
603
       SERIAL_ECHOLNPGM("Scaling factors:");
604
       CONFIG_ECHO_START;
604
       CONFIG_ECHO_START;
663
   SERIAL_ECHOPAIR(" Z", home_offset[Z_AXIS]);
663
   SERIAL_ECHOPAIR(" Z", home_offset[Z_AXIS]);
664
   SERIAL_EOL;
664
   SERIAL_EOL;
665
 
665
 
666
-  #ifdef MESH_BED_LEVELING
666
+  #if ENABLED(MESH_BED_LEVELING)
667
     if (!forReplay) {
667
     if (!forReplay) {
668
       SERIAL_ECHOLNPGM("Mesh bed leveling:");
668
       SERIAL_ECHOLNPGM("Mesh bed leveling:");
669
       CONFIG_ECHO_START;
669
       CONFIG_ECHO_START;
683
     }
683
     }
684
   #endif
684
   #endif
685
 
685
 
686
-  #ifdef DELTA
686
+  #if ENABLED(DELTA)
687
     CONFIG_ECHO_START;
687
     CONFIG_ECHO_START;
688
     if (!forReplay) {
688
     if (!forReplay) {
689
       SERIAL_ECHOLNPGM("Endstop adjustment (mm):");
689
       SERIAL_ECHOLNPGM("Endstop adjustment (mm):");
700
     SERIAL_ECHOPAIR(" R", delta_radius);
700
     SERIAL_ECHOPAIR(" R", delta_radius);
701
     SERIAL_ECHOPAIR(" S", delta_segments_per_second);
701
     SERIAL_ECHOPAIR(" S", delta_segments_per_second);
702
     SERIAL_EOL;
702
     SERIAL_EOL;
703
-  #elif defined(Z_DUAL_ENDSTOPS)
703
+  #elif ENABLED(Z_DUAL_ENDSTOPS)
704
     CONFIG_ECHO_START;
704
     CONFIG_ECHO_START;
705
     if (!forReplay) {
705
     if (!forReplay) {
706
       SERIAL_ECHOLNPGM("Z2 Endstop adjustment (mm):");
706
       SERIAL_ECHOLNPGM("Z2 Endstop adjustment (mm):");
710
     SERIAL_EOL;  
710
     SERIAL_EOL;  
711
   #endif // DELTA
711
   #endif // DELTA
712
 
712
 
713
-  #ifdef ULTIPANEL
713
+  #if ENABLED(ULTIPANEL)
714
     CONFIG_ECHO_START;
714
     CONFIG_ECHO_START;
715
     if (!forReplay) {
715
     if (!forReplay) {
716
       SERIAL_ECHOLNPGM("Material heatup parameters:");
716
       SERIAL_ECHOLNPGM("Material heatup parameters:");
727
     SERIAL_EOL;
727
     SERIAL_EOL;
728
   #endif // ULTIPANEL
728
   #endif // ULTIPANEL
729
 
729
 
730
-  #if defined(PIDTEMP) || defined(PIDTEMPBED)
730
+  #if ENABLED(PIDTEMP) || ENABLED(PIDTEMPBED)
731
 
731
 
732
     CONFIG_ECHO_START;
732
     CONFIG_ECHO_START;
733
     if (!forReplay) {
733
     if (!forReplay) {
734
       SERIAL_ECHOLNPGM("PID settings:");
734
       SERIAL_ECHOLNPGM("PID settings:");
735
     }
735
     }
736
-    #ifdef PIDTEMP
736
+    #if ENABLED(PIDTEMP)
737
       #if EXTRUDERS > 1
737
       #if EXTRUDERS > 1
738
         if (forReplay) {
738
         if (forReplay) {
739
           for (uint8_t i = 0; i < EXTRUDERS; i++) {
739
           for (uint8_t i = 0; i < EXTRUDERS; i++) {
742
             SERIAL_ECHOPAIR(" P", PID_PARAM(Kp, i));
742
             SERIAL_ECHOPAIR(" P", PID_PARAM(Kp, i));
743
             SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, i)));
743
             SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, i)));
744
             SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, i)));
744
             SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, i)));
745
-            #ifdef PID_ADD_EXTRUSION_RATE
745
+            #if ENABLED(PID_ADD_EXTRUSION_RATE)
746
               SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, i));
746
               SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, i));
747
             #endif      
747
             #endif      
748
             SERIAL_EOL;
748
             SERIAL_EOL;
756
         SERIAL_ECHOPAIR("  M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echo values for E0
756
         SERIAL_ECHOPAIR("  M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echo values for E0
757
         SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0)));
757
         SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0)));
758
         SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0)));
758
         SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0)));
759
-        #ifdef PID_ADD_EXTRUSION_RATE
759
+        #if ENABLED(PID_ADD_EXTRUSION_RATE)
760
           SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, 0));
760
           SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, 0));
761
         #endif      
761
         #endif      
762
         SERIAL_EOL;
762
         SERIAL_EOL;
763
       }
763
       }
764
     #endif // PIDTEMP
764
     #endif // PIDTEMP
765
 
765
 
766
-    #ifdef PIDTEMPBED
766
+    #if ENABLED(PIDTEMPBED)
767
       CONFIG_ECHO_START;
767
       CONFIG_ECHO_START;
768
       SERIAL_ECHOPAIR("  M304 P", bedKp);
768
       SERIAL_ECHOPAIR("  M304 P", bedKp);
769
       SERIAL_ECHOPAIR(" I", unscalePID_i(bedKi));
769
       SERIAL_ECHOPAIR(" I", unscalePID_i(bedKi));
773
 
773
 
774
   #endif // PIDTEMP || PIDTEMPBED
774
   #endif // PIDTEMP || PIDTEMPBED
775
 
775
 
776
-  #ifdef HAS_LCD_CONTRAST
776
+  #if ENABLED(HAS_LCD_CONTRAST)
777
     CONFIG_ECHO_START;
777
     CONFIG_ECHO_START;
778
     if (!forReplay) {
778
     if (!forReplay) {
779
       SERIAL_ECHOLNPGM("LCD Contrast:");
779
       SERIAL_ECHOLNPGM("LCD Contrast:");
783
     SERIAL_EOL;
783
     SERIAL_EOL;
784
   #endif
784
   #endif
785
 
785
 
786
-  #ifdef FWRETRACT
786
+  #if ENABLED(FWRETRACT)
787
 
787
 
788
     CONFIG_ECHO_START;
788
     CONFIG_ECHO_START;
789
     if (!forReplay) {
789
     if (!forReplay) {
857
   /**
857
   /**
858
    * Auto Bed Leveling
858
    * Auto Bed Leveling
859
    */
859
    */
860
-  #ifdef ENABLE_AUTO_BED_LEVELING
861
-    #ifdef CUSTOM_M_CODES
860
+  #if ENABLED(ENABLE_AUTO_BED_LEVELING)
861
+    #if ENABLED(CUSTOM_M_CODES)
862
       if (!forReplay) {
862
       if (!forReplay) {
863
         CONFIG_ECHO_START;
863
         CONFIG_ECHO_START;
864
         SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");
864
         SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");

+ 2
- 2
Marlin/configuration_store.h View File

5
 
5
 
6
 void Config_ResetDefault();
6
 void Config_ResetDefault();
7
 
7
 
8
-#ifndef DISABLE_M503
8
+#if DISABLED(DISABLE_M503)
9
   void Config_PrintSettings(bool forReplay=false);
9
   void Config_PrintSettings(bool forReplay=false);
10
 #else
10
 #else
11
   FORCE_INLINE void Config_PrintSettings(bool forReplay=false) {}
11
   FORCE_INLINE void Config_PrintSettings(bool forReplay=false) {}
12
 #endif
12
 #endif
13
 
13
 
14
-#ifdef EEPROM_SETTINGS
14
+#if ENABLED(EEPROM_SETTINGS)
15
   void Config_StoreSettings();
15
   void Config_StoreSettings();
16
   void Config_RetrieveSettings();
16
   void Config_RetrieveSettings();
17
 #else
17
 #else

Loading…
Cancel
Save