Drop extra initializers for vars initialized by EEPROM code

This commit is contained in:
Scott Lahteine 2017-07-18 03:17:50 -05:00
parent 7afafb05b8
commit b0173ccdb9
7 changed files with 23 additions and 44 deletions

View file

@ -427,16 +427,10 @@ static float saved_feedrate_mm_s;
int16_t feedrate_percentage = 100, saved_feedrate_percentage,
flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100);
// Initialized by settings.load()
bool axis_relative_modes[] = AXIS_RELATIVE_MODES,
volumetric_enabled =
#if ENABLED(VOLUMETRIC_DEFAULT_ON)
true
#else
false
#endif
;
float filament_size[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(DEFAULT_NOMINAL_FILAMENT_DIA),
volumetric_multiplier[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(1.0);
volumetric_enabled;
float filament_size[EXTRUDERS], volumetric_multiplier[EXTRUDERS];
#if HAS_WORKSPACE_OFFSET
#if HAS_POSITION_SHIFT
@ -513,7 +507,7 @@ static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL
static uint8_t target_extruder;
#if HAS_BED_PROBE
float zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER;
float zprobe_zoffset; // Initialized by settings.load()
#endif
#if HAS_ABL
@ -542,18 +536,12 @@ static uint8_t target_extruder;
#endif
#if ENABLED(Z_DUAL_ENDSTOPS)
float z_endstop_adj =
#ifdef Z_DUAL_ENDSTOPS_ADJUSTMENT
Z_DUAL_ENDSTOPS_ADJUSTMENT
#else
0
#endif
;
float z_endstop_adj;
#endif
// Extruder offsets
#if HOTENDS > 1
float hotend_offset[XYZ][HOTENDS];
float hotend_offset[XYZ][HOTENDS]; // Initialized by settings.load()
#endif
#if HAS_Z_SERVO_ENDSTOP
@ -596,8 +584,7 @@ static uint8_t target_extruder;
float delta[ABC],
endstop_adj[ABC] = { 0 };
// These values are loaded or reset at boot time when setup() calls
// settings.load(), which calls recalc_delta_settings().
// Initialized by settings.load()
float delta_radius,
delta_tower_angle_trim[2],
delta_tower[ABC][2],

View file

@ -38,14 +38,7 @@ Endstops endstops;
// public:
bool Endstops::enabled = true,
Endstops::enabled_globally =
#if ENABLED(ENDSTOPS_ALWAYS_ON_DEFAULT)
(true)
#else
(false)
#endif
;
bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load()
volatile char Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
#if ENABLED(Z_DUAL_ENDSTOPS)

View file

@ -95,6 +95,8 @@ uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],
Planner::max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software
millis_t Planner::min_segment_time;
// Initialized by settings.load()
float Planner::min_feedrate_mm_s,
Planner::acceleration, // Normal acceleration mm/s^2 DEFAULT ACCELERATION for all printing moves. M204 SXXXX
Planner::retract_acceleration, // Retract acceleration mm/s^2 filament pull-back and push-forward while standing still in the other axes M204 TXXXX
@ -111,7 +113,7 @@ float Planner::min_feedrate_mm_s,
#endif
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
float Planner::z_fade_height,
float Planner::z_fade_height, // Initialized by settings.load()
Planner::inverse_z_fade_height;
#endif
@ -143,8 +145,8 @@ float Planner::previous_speed[NUM_AXIS],
#endif
#if ENABLED(LIN_ADVANCE)
float Planner::extruder_advance_k = LIN_ADVANCE_K,
Planner::advance_ed_ratio = LIN_ADVANCE_E_D_RATIO,
float Planner::extruder_advance_k, // Initialized by settings.load()
Planner::advance_ed_ratio, // Initialized by settings.load()
Planner::position_float[NUM_AXIS] = { 0 };
#endif

View file

@ -77,7 +77,7 @@ block_t* Stepper::current_block = NULL; // A pointer to the block currently bei
#endif
#if HAS_MOTOR_CURRENT_PWM
uint32_t Stepper::motor_current_setting[3] = PWM_MOTOR_CURRENT;
uint32_t Stepper::motor_current_setting[3]; // Initialized by settings.load()
#endif
// private:

View file

@ -73,28 +73,24 @@ int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 },
int16_t Temperature::target_temperature_bed = 0;
#endif
// Initialized by settings.load()
#if ENABLED(PIDTEMP)
#if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
float Temperature::Kp[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kp),
Temperature::Ki[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Ki) * (PID_dT)),
Temperature::Kd[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Kd) / (PID_dT));
float Temperature::Kp[HOTENDS], Temperature::Ki[HOTENDS], Temperature::Kd[HOTENDS];
#if ENABLED(PID_EXTRUSION_SCALING)
float Temperature::Kc[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kc);
float Temperature::Kc[HOTENDS];
#endif
#else
float Temperature::Kp = DEFAULT_Kp,
Temperature::Ki = (DEFAULT_Ki) * (PID_dT),
Temperature::Kd = (DEFAULT_Kd) / (PID_dT);
float Temperature::Kp, Temperature::Ki, Temperature::Kd;
#if ENABLED(PID_EXTRUSION_SCALING)
float Temperature::Kc = DEFAULT_Kc;
float Temperature::Kc;
#endif
#endif
#endif
// Initialized by settings.load()
#if ENABLED(PIDTEMPBED)
float Temperature::bedKp = DEFAULT_bedKp,
Temperature::bedKi = ((DEFAULT_bedKi) * PID_dT),
Temperature::bedKd = ((DEFAULT_bedKd) / PID_dT);
float Temperature::bedKp, Temperature::bedKi, Temperature::bedKd;
#endif
#if ENABLED(BABYSTEPPING)

View file

@ -49,6 +49,7 @@
bool ubl_lcd_map_control = false;
#endif
// Initialized by settings.load()
int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)

View file

@ -202,7 +202,7 @@
#include "utf_mapper.h"
uint16_t lcd_contrast;
uint16_t lcd_contrast; // Initialized by settings.load()
static char currentfont = 0;
// The current graphical page being rendered