Fix recent regressions, &c.

- fix broken `M421` due to less-than-careful optimization
- add HOME_AFTER_DEACTIVATE define to advanced config so not everyone has to rehome after steppers are deactivated
- misc. cleanups (remove unused label, unused variables)
master
Brian 8 years ago
parent aad1acc418
commit 43c24f0027

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -1856,9 +1856,15 @@ static void clean_up_after_endstop_or_probe_move() {
#if HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) || ENABLED(DELTA_AUTO_CALIBRATION) #if HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) || ENABLED(DELTA_AUTO_CALIBRATION)
bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) { bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) {
#if ENABLED(HOME_AFTER_DEACTIVATE)
const bool xx = x && !axis_known_position[X_AXIS], const bool xx = x && !axis_known_position[X_AXIS],
yy = y && !axis_known_position[Y_AXIS], yy = y && !axis_known_position[Y_AXIS],
zz = z && !axis_known_position[Z_AXIS]; zz = z && !axis_known_position[Z_AXIS];
#else
const bool xx = x && !axis_homed[X_AXIS],
yy = y && !axis_homed[Y_AXIS],
zz = z && !axis_homed[Z_AXIS];
#endif
if (xx || yy || zz) { if (xx || yy || zz) {
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_HOME " "); SERIAL_ECHOPGM(MSG_HOME " ");
@ -8550,12 +8556,12 @@ void quickstop_stepper() {
*/ */
inline void gcode_M421() { inline void gcode_M421() {
const bool hasX = code_seen('X'), hasI = code_seen('I'); const bool hasX = code_seen('X'), hasI = code_seen('I');
const int8_t ix = hasI ? code_value_byte() : hasX ? mbl.probe_index_x(RAW_X_POSITION(code_value_linear_units())) : -1; const int8_t ix = hasI ? code_value_int() : hasX ? mbl.probe_index_x(RAW_X_POSITION(code_value_linear_units())) : -1;
const bool hasY = code_seen('Y'), hasJ = code_seen('J'); const bool hasY = code_seen('Y'), hasJ = code_seen('J');
const int8_t iy = hasJ ? code_value_byte() : hasY ? mbl.probe_index_y(RAW_Y_POSITION(code_value_linear_units())) : -1; const int8_t iy = hasJ ? code_value_int() : hasY ? mbl.probe_index_y(RAW_Y_POSITION(code_value_linear_units())) : -1;
const bool hasZ = code_seen('Z'), hasQ = code_seen('Q'); const bool hasZ = code_seen('Z'), hasQ = !hasZ && code_seen('Q');
if (int(hasI && hasJ) + int(hasX && hasY) != 1 || hasZ == hasQ) { if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ)) {
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS);
} }
@ -8578,12 +8584,12 @@ void quickstop_stepper() {
*/ */
inline void gcode_M421() { inline void gcode_M421() {
const bool hasI = code_seen('I'); const bool hasI = code_seen('I');
const int8_t ix = hasI ? code_value_byte() : -1; const int8_t ix = hasI ? code_value_int() : -1;
const bool hasJ = code_seen('J'); const bool hasJ = code_seen('J');
const int8_t iy = hasJ ? code_value_byte() : -1; const int8_t iy = hasJ ? code_value_int() : -1;
const bool hasZ = code_seen('Z'), hasQ = code_seen('Q'); const bool hasZ = code_seen('Z'), hasQ = !hasZ && code_seen('Q');
if (!hasI || !hasJ || hasZ == hasQ) { if (!hasI || !hasJ || !(hasZ || hasQ)) {
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS);
} }
@ -8611,14 +8617,20 @@ void quickstop_stepper() {
* M421 C Q<offset> * M421 C Q<offset>
*/ */
inline void gcode_M421() { inline void gcode_M421() {
const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, current_position[X_AXIS], current_position[Y_AXIS], USE_NOZZLE_AS_REFERENCE, NULL, false); const bool hasC = code_seen('C');
const bool hasC = code_seen('C'), hasI = code_seen('I'); const bool hasI = code_seen('I');
const int8_t ix = hasI ? code_value_byte() : hasC ? location.x_index : -1; int8_t ix = hasI ? code_value_int() : -1;
const bool hasJ = code_seen('J'); const bool hasJ = code_seen('J');
const int8_t iy = hasJ ? code_value_byte() : hasC ? location.y_index : -1; int8_t iy = hasJ ? code_value_int() : -1;
const bool hasZ = code_seen('Z'), hasQ = code_seen('Q'); const bool hasZ = code_seen('Z'), hasQ = !hasZ && code_seen('Q');
if (hasC) {
const mesh_index_pair location = find_closest_mesh_point_of_type(REAL, current_position[X_AXIS], current_position[Y_AXIS], USE_NOZZLE_AS_REFERENCE, NULL, false);
ix = location.x_index;
iy = location.y_index;
}
if (int(hasC) + int(hasI && hasJ) != 1 || hasZ == hasQ) { if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ)) {
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS);
} }

@ -625,18 +625,18 @@ void MarlinSettings::postprocess() {
if (!eeprom_error) { if (!eeprom_error) {
const int eeprom_size = eeprom_index; const int eeprom_size = eeprom_index;
const uint16_t tcrc = working_crc; const uint16_t final_crc = working_crc;
// Write the EEPROM header // Write the EEPROM header
eeprom_index = EEPROM_OFFSET; eeprom_index = EEPROM_OFFSET;
EEPROM_WRITE(version); EEPROM_WRITE(version);
EEPROM_WRITE(tcrc); EEPROM_WRITE(final_crc);
// Report storage size // Report storage size
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOPAIR("Settings Stored (", eeprom_size - (EEPROM_OFFSET)); SERIAL_ECHOPAIR("Settings Stored (", eeprom_size - (EEPROM_OFFSET));
SERIAL_ECHOPAIR(" bytes; crc ", tcrc); SERIAL_ECHOPAIR(" bytes; crc ", final_crc);
SERIAL_ECHOLNPGM(")"); SERIAL_ECHOLNPGM(")");
} }
@ -1066,7 +1066,7 @@ void MarlinSettings::postprocess() {
// Write crc to MAT along with other data, or just tack on to the beginning or end // Write crc to MAT along with other data, or just tack on to the beginning or end
SERIAL_PROTOCOLPAIR("Mesh saved in slot ", slot); SERIAL_PROTOCOLLNPAIR("Mesh saved in slot ", slot);
#else #else
@ -1093,7 +1093,7 @@ void MarlinSettings::postprocess() {
// Compare crc with crc from MAT, or read from end // Compare crc with crc from MAT, or read from end
SERIAL_PROTOCOLPAIR("Mesh loaded from slot ", slot); SERIAL_PROTOCOLLNPAIR("Mesh loaded from slot ", slot);
#else #else

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -378,6 +378,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -370,6 +370,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -365,6 +365,8 @@
#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate #define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate
#define DEFAULT_MINTRAVELFEEDRATE 0.0 #define DEFAULT_MINTRAVELFEEDRATE 0.0
//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// @section lcd // @section lcd
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)

@ -307,7 +307,7 @@
static int g29_verbose_level, phase_value, repetition_cnt, static int g29_verbose_level, phase_value, repetition_cnt,
storage_slot = 0, map_type, grid_size; storage_slot = 0, map_type, grid_size;
static bool repeat_flag, c_flag, x_flag, y_flag; static bool repeat_flag, c_flag, x_flag, y_flag;
static float x_pos, y_pos, measured_z, card_thickness = 0.0, ubl_constant = 0.0; static float x_pos, y_pos, card_thickness = 0.0, ubl_constant = 0.0;
extern void lcd_setstatus(const char* message, const bool persist); extern void lcd_setstatus(const char* message, const bool persist);
extern void lcd_setstatuspgm(const char* message, const uint8_t level); extern void lcd_setstatuspgm(const char* message, const uint8_t level);
@ -1026,7 +1026,6 @@
if (do_ubl_mesh_map) ubl.display_map(map_type); if (do_ubl_mesh_map) ubl.display_map(map_type);
LEAVE:
ubl.restore_ubl_active_state_and_leave(); ubl.restore_ubl_active_state_and_leave();
KEEPALIVE_STATE(IN_HANDLER); KEEPALIVE_STATE(IN_HANDLER);
do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE); do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE);

@ -1858,7 +1858,6 @@ void kill_screen(const char* lcd_msg) {
* UBL Build Mesh submenu * UBL Build Mesh submenu
*/ */
void _lcd_ubl_build_mesh() { void _lcd_ubl_build_mesh() {
int GRID_NUM_POINTS = GRID_MAX_POINTS;
START_MENU(); START_MENU();
MENU_BACK(MSG_UBL_TOOLS); MENU_BACK(MSG_UBL_TOOLS);
#if (WATCH_THE_BED) #if (WATCH_THE_BED)

Loading…
Cancel
Save