浏览代码

Drop extra initializers for vars initialized by EEPROM code

Scott Lahteine 8 年前
父节点
当前提交
b0173ccdb9
共有 7 个文件被更改,包括 23 次插入44 次删除
  1. 7
    20
      Marlin/Marlin_main.cpp
  2. 1
    8
      Marlin/endstops.cpp
  3. 5
    3
      Marlin/planner.cpp
  4. 1
    1
      Marlin/stepper.cpp
  5. 7
    11
      Marlin/temperature.cpp
  6. 1
    0
      Marlin/ultralcd.cpp
  7. 1
    1
      Marlin/ultralcd_impl_DOGM.h

+ 7
- 20
Marlin/Marlin_main.cpp 查看文件

427
 int16_t feedrate_percentage = 100, saved_feedrate_percentage,
427
 int16_t feedrate_percentage = 100, saved_feedrate_percentage,
428
     flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100);
428
     flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100);
429
 
429
 
430
+// Initialized by settings.load()
430
 bool axis_relative_modes[] = AXIS_RELATIVE_MODES,
431
 bool axis_relative_modes[] = AXIS_RELATIVE_MODES,
431
-     volumetric_enabled =
432
-        #if ENABLED(VOLUMETRIC_DEFAULT_ON)
433
-          true
434
-        #else
435
-          false
436
-        #endif
437
-      ;
438
-float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DIA),
439
-      volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0);
432
+     volumetric_enabled;
433
+float filament_size[EXTRUDERS], volumetric_multiplier[EXTRUDERS];
440
 
434
 
441
 #if HAS_WORKSPACE_OFFSET
435
 #if HAS_WORKSPACE_OFFSET
442
   #if HAS_POSITION_SHIFT
436
   #if HAS_POSITION_SHIFT
513
 static uint8_t target_extruder;
507
 static uint8_t target_extruder;
514
 
508
 
515
 #if HAS_BED_PROBE
509
 #if HAS_BED_PROBE
516
-  float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
510
+  float zprobe_zoffset; // Initialized by settings.load()
517
 #endif
511
 #endif
518
 
512
 
519
 #if HAS_ABL
513
 #if HAS_ABL
542
 #endif
536
 #endif
543
 
537
 
544
 #if ENABLED(Z_DUAL_ENDSTOPS)
538
 #if ENABLED(Z_DUAL_ENDSTOPS)
545
-  float z_endstop_adj =
546
-    #ifdef Z_DUAL_ENDSTOPS_ADJUSTMENT
547
-      Z_DUAL_ENDSTOPS_ADJUSTMENT
548
-    #else
549
-      0
550
-    #endif
551
-  ;
539
+  float z_endstop_adj;
552
 #endif
540
 #endif
553
 
541
 
554
 // Extruder offsets
542
 // Extruder offsets
555
 #if HOTENDS > 1
543
 #if HOTENDS > 1
556
-  float hotend_offset[XYZ][HOTENDS];
544
+  float hotend_offset[XYZ][HOTENDS]; // Initialized by settings.load()
557
 #endif
545
 #endif
558
 
546
 
559
 #if HAS_Z_SERVO_ENDSTOP
547
 #if HAS_Z_SERVO_ENDSTOP
596
   float delta[ABC],
584
   float delta[ABC],
597
         endstop_adj[ABC] = { 0 };
585
         endstop_adj[ABC] = { 0 };
598
 
586
 
599
-  // These values are loaded or reset at boot time when setup() calls
600
-  // settings.load(), which calls recalc_delta_settings().
587
+  // Initialized by settings.load()
601
   float delta_radius,
588
   float delta_radius,
602
         delta_tower_angle_trim[2],
589
         delta_tower_angle_trim[2],
603
         delta_tower[ABC][2],
590
         delta_tower[ABC][2],

+ 1
- 8
Marlin/endstops.cpp 查看文件

38
 
38
 
39
 // public:
39
 // public:
40
 
40
 
41
-bool  Endstops::enabled = true,
42
-      Endstops::enabled_globally =
43
-        #if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
44
-          (true)
45
-        #else
46
-          (false)
47
-        #endif
48
-      ;
41
+bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load()
49
 volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
42
 volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
50
 
43
 
51
 #if ENABLED(Z_DUAL_ENDSTOPS)
44
 #if ENABLED(Z_DUAL_ENDSTOPS)

+ 5
- 3
Marlin/planner.cpp 查看文件

95
          Planner::max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software
95
          Planner::max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software
96
 
96
 
97
 millis_t Planner::min_segment_time;
97
 millis_t Planner::min_segment_time;
98
+
99
+// Initialized by settings.load()
98
 float Planner::min_feedrate_mm_s,
100
 float Planner::min_feedrate_mm_s,
99
       Planner::acceleration,         // Normal acceleration mm/s^2  DEFAULT ACCELERATION for all printing moves. M204 SXXXX
101
       Planner::acceleration,         // Normal acceleration mm/s^2  DEFAULT ACCELERATION for all printing moves. M204 SXXXX
100
       Planner::retract_acceleration, // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
102
       Planner::retract_acceleration, // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
111
 #endif
113
 #endif
112
 
114
 
113
 #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
115
 #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
114
-  float Planner::z_fade_height,
116
+  float Planner::z_fade_height, // Initialized by settings.load()
115
         Planner::inverse_z_fade_height;
117
         Planner::inverse_z_fade_height;
116
 #endif
118
 #endif
117
 
119
 
143
 #endif
145
 #endif
144
 
146
 
145
 #if ENABLED(LIN_ADVANCE)
147
 #if ENABLED(LIN_ADVANCE)
146
-  float Planner::extruder_advance_k = LIN_ADVANCE_K,
147
-        Planner::advance_ed_ratio = LIN_ADVANCE_E_D_RATIO,
148
+  float Planner::extruder_advance_k, // Initialized by settings.load()
149
+        Planner::advance_ed_ratio,   // Initialized by settings.load()
148
         Planner::position_float[NUM_AXIS] = { 0 };
150
         Planner::position_float[NUM_AXIS] = { 0 };
149
 #endif
151
 #endif
150
 
152
 

+ 1
- 1
Marlin/stepper.cpp 查看文件

77
 #endif
77
 #endif
78
 
78
 
79
 #if HAS_MOTOR_CURRENT_PWM
79
 #if HAS_MOTOR_CURRENT_PWM
80
-  uint32_t Stepper::motor_current_setting[3] = PWM_MOTOR_CURRENT;
80
+  uint32_t Stepper::motor_current_setting[3]; // Initialized by settings.load()
81
 #endif
81
 #endif
82
 
82
 
83
 // private:
83
 // private:

+ 7
- 11
Marlin/temperature.cpp 查看文件

73
   int16_t Temperature::target_temperature_bed = 0;
73
   int16_t Temperature::target_temperature_bed = 0;
74
 #endif
74
 #endif
75
 
75
 
76
+// Initialized by settings.load()
76
 #if ENABLED(PIDTEMP)
77
 #if ENABLED(PIDTEMP)
77
   #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
78
   #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
78
-    float Temperature::Kp[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kp),
79
-          Temperature::Ki[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Ki) * (PID_dT)),
80
-          Temperature::Kd[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Kd) / (PID_dT));
79
+    float Temperature::Kp[HOTENDS], Temperature::Ki[HOTENDS], Temperature::Kd[HOTENDS];
81
     #if ENABLED(PID_EXTRUSION_SCALING)
80
     #if ENABLED(PID_EXTRUSION_SCALING)
82
-      float Temperature::Kc[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kc);
81
+      float Temperature::Kc[HOTENDS];
83
     #endif
82
     #endif
84
   #else
83
   #else
85
-    float Temperature::Kp = DEFAULT_Kp,
86
-          Temperature::Ki = (DEFAULT_Ki) * (PID_dT),
87
-          Temperature::Kd = (DEFAULT_Kd) / (PID_dT);
84
+    float Temperature::Kp, Temperature::Ki, Temperature::Kd;
88
     #if ENABLED(PID_EXTRUSION_SCALING)
85
     #if ENABLED(PID_EXTRUSION_SCALING)
89
-      float Temperature::Kc = DEFAULT_Kc;
86
+      float Temperature::Kc;
90
     #endif
87
     #endif
91
   #endif
88
   #endif
92
 #endif
89
 #endif
93
 
90
 
91
+// Initialized by settings.load()
94
 #if ENABLED(PIDTEMPBED)
92
 #if ENABLED(PIDTEMPBED)
95
-  float Temperature::bedKp = DEFAULT_bedKp,
96
-        Temperature::bedKi = ((DEFAULT_bedKi) * PID_dT),
97
-        Temperature::bedKd = ((DEFAULT_bedKd) / PID_dT);
93
+  float Temperature::bedKp, Temperature::bedKi, Temperature::bedKd;
98
 #endif
94
 #endif
99
 
95
 
100
 #if ENABLED(BABYSTEPPING)
96
 #if ENABLED(BABYSTEPPING)

+ 1
- 0
Marlin/ultralcd.cpp 查看文件

49
   bool ubl_lcd_map_control = false;
49
   bool ubl_lcd_map_control = false;
50
 #endif
50
 #endif
51
 
51
 
52
+// Initialized by settings.load()
52
 int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
53
 int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
53
 
54
 
54
 #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
55
 #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)

+ 1
- 1
Marlin/ultralcd_impl_DOGM.h 查看文件

202
 
202
 
203
 #include "utf_mapper.h"
203
 #include "utf_mapper.h"
204
 
204
 
205
-uint16_t lcd_contrast;
205
+uint16_t lcd_contrast; // Initialized by settings.load()
206
 static char currentfont = 0;
206
 static char currentfont = 0;
207
 
207
 
208
 // The current graphical page being rendered
208
 // The current graphical page being rendered

正在加载...
取消
保存