Parity with 2.0.x in ubl and EEPROM (#9817)

This commit is contained in:
Scott Lahteine 2018-02-25 21:17:36 -06:00 committed by GitHub
parent 1617798287
commit aa380aeb4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 21 deletions

View File

@ -568,9 +568,9 @@ void MarlinSettings::postprocess() {
_FIELD_TEST(lcd_preheat_hotend_temp); _FIELD_TEST(lcd_preheat_hotend_temp);
#if DISABLED(ULTIPANEL) #if DISABLED(ULTIPANEL)
constexpr int lcd_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND }, constexpr int16_t lcd_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND },
lcd_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED }, lcd_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED },
lcd_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED }; lcd_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED };
#endif #endif
EEPROM_WRITE(lcd_preheat_hotend_temp); EEPROM_WRITE(lcd_preheat_hotend_temp);
@ -778,9 +778,9 @@ void MarlinSettings::postprocess() {
_FIELD_TEST(motor_current_setting); _FIELD_TEST(motor_current_setting);
#if HAS_MOTOR_CURRENT_PWM #if HAS_MOTOR_CURRENT_PWM
for (uint8_t q = 3; q--;) EEPROM_WRITE(stepper.motor_current_setting[q]); for (uint8_t q = XYZ; q--;) EEPROM_WRITE(stepper.motor_current_setting[q]);
#else #else
const uint32_t dummyui32[3] = { 0 }; const uint32_t dummyui32[XYZ] = { 0 };
EEPROM_WRITE(dummyui32); EEPROM_WRITE(dummyui32);
#endif #endif
@ -1094,7 +1094,7 @@ void MarlinSettings::postprocess() {
_FIELD_TEST(lcd_preheat_hotend_temp); _FIELD_TEST(lcd_preheat_hotend_temp);
#if DISABLED(ULTIPANEL) #if DISABLED(ULTIPANEL)
int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2]; int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
#endif #endif
EEPROM_READ(lcd_preheat_hotend_temp); // 2 floats EEPROM_READ(lcd_preheat_hotend_temp); // 2 floats
EEPROM_READ(lcd_preheat_bed_temp); // 2 floats EEPROM_READ(lcd_preheat_bed_temp); // 2 floats
@ -1317,9 +1317,9 @@ void MarlinSettings::postprocess() {
_FIELD_TEST(motor_current_setting); _FIELD_TEST(motor_current_setting);
#if HAS_MOTOR_CURRENT_PWM #if HAS_MOTOR_CURRENT_PWM
for (uint8_t q = 3; q--;) EEPROM_READ(stepper.motor_current_setting[q]); for (uint8_t q = XYZ; q--;) EEPROM_READ(stepper.motor_current_setting[q]);
#else #else
uint32_t dummyui32[3]; uint32_t dummyui32[XYZ];
EEPROM_READ(dummyui32); EEPROM_READ(dummyui32);
#endif #endif
@ -1822,11 +1822,7 @@ void MarlinSettings::reset() {
#if DISABLED(DISABLE_M503) #if DISABLED(DISABLE_M503)
#if ADD_PORT_ARG #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START(); }while(0)
#define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START_P(port); }while(0)
#else
#define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START(); }while(0)
#endif
/** /**
* M503 - Report current settings in RAM * M503 - Report current settings in RAM

View File

@ -90,11 +90,11 @@ class unified_bed_leveling {
static void move_z_with_encoder(const float &multiplier); static void move_z_with_encoder(const float &multiplier);
static float measure_point_with_encoder(); static float measure_point_with_encoder();
static float measure_business_card_thickness(float in_height); static float measure_business_card_thickness(float in_height);
static void manually_probe_remaining_mesh(const float&, const float&, const float&, const float&, const bool) _O0; static void manually_probe_remaining_mesh(const float&, const float&, const float&, const float&, const bool);
static void fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) _O0; static void fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map);
#endif #endif
static bool g29_parameter_parsing() _O0; static bool g29_parameter_parsing();
static void find_mean_mesh_height(); static void find_mean_mesh_height();
static void shift_mesh_height(); static void shift_mesh_height();
static void probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, bool do_furthest) _O0; static void probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, bool do_furthest) _O0;
@ -112,7 +112,7 @@ class unified_bed_leveling {
static void report_state(); static void report_state();
static void save_ubl_active_state_and_disable(); static void save_ubl_active_state_and_disable();
static void restore_ubl_active_state_and_leave(); static void restore_ubl_active_state_and_leave();
static void display_map(const int) _O0; static void display_map(const int);
static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const float&, const float&, const bool, uint16_t[16]) _O0; static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const float&, const float&, const bool, uint16_t[16]) _O0;
static mesh_index_pair find_furthest_invalid_mesh_point() _O0; static mesh_index_pair find_furthest_invalid_mesh_point() _O0;
static void reset(); static void reset();
@ -120,8 +120,9 @@ class unified_bed_leveling {
static void set_all_mesh_points_to_value(const float); static void set_all_mesh_points_to_value(const float);
static bool sanity_check(); static bool sanity_check();
static void G29() _O0; // O0 for no optimization static void G29() _O0; // O0 for no optimization
static void smart_fill_wlsf(const float &); // O2 gives smaller code than Os on A2560 static void smart_fill_wlsf(const float &) _O2; // O2 gives smaller code than Os on A2560
static int8_t storage_slot; static int8_t storage_slot;
static float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; static float z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y];
@ -220,6 +221,7 @@ class unified_bed_leveling {
SERIAL_EOL(); SERIAL_EOL();
} }
#endif #endif
// The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN. // The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN.
return ( return (
#ifdef UBL_Z_RAISE_WHEN_OFF_MESH #ifdef UBL_Z_RAISE_WHEN_OFF_MESH
@ -253,7 +255,8 @@ class unified_bed_leveling {
SERIAL_EOL(); SERIAL_EOL();
} }
#endif #endif
// The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN.
// The requested location is off the mesh. Return UBL_Z_RAISE_WHEN_OFF_MESH or NAN.
return ( return (
#ifdef UBL_Z_RAISE_WHEN_OFF_MESH #ifdef UBL_Z_RAISE_WHEN_OFF_MESH
UBL_Z_RAISE_WHEN_OFF_MESH UBL_Z_RAISE_WHEN_OFF_MESH
@ -281,7 +284,7 @@ class unified_bed_leveling {
const int8_t cx = get_cell_index_x(rx0), const int8_t cx = get_cell_index_x(rx0),
cy = get_cell_index_y(ry0); // return values are clamped cy = get_cell_index_y(ry0); // return values are clamped
/** /**
* Check if the requested location is off the mesh. If so, and * Check if the requested location is off the mesh. If so, and
* UBL_Z_RAISE_WHEN_OFF_MESH is specified, that value is returned. * UBL_Z_RAISE_WHEN_OFF_MESH is specified, that value is returned.
*/ */
@ -365,6 +368,7 @@ class unified_bed_leveling {
|| isnan(z_values[0][0]) || isnan(z_values[0][0])
); );
} }
}; // class unified_bed_leveling }; // class unified_bed_leveling
extern unified_bed_leveling ubl; extern unified_bed_leveling ubl;