Handle CALIBRATION_STATUS_LIVE_ADJUST
This commit is contained in:
parent
16033b40b4
commit
17b10167a0
|
|
@ -3381,8 +3381,9 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
|||
else
|
||||
{
|
||||
// Reset the baby step value and the baby step applied flag.
|
||||
calibration_status_store(CALIBRATION_STATUS_XYZ_CALIBRATION);
|
||||
eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
|
||||
calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST);
|
||||
eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
|
||||
|
||||
// Complete XYZ calibration.
|
||||
uint8_t point_too_far_mask = 0;
|
||||
BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask);
|
||||
|
|
@ -5267,7 +5268,7 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
|
|||
(Prusa3D specific)
|
||||
*/
|
||||
case 86:
|
||||
calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
|
||||
calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST);
|
||||
break;
|
||||
|
||||
|
||||
|
|
@ -5278,7 +5279,7 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
|
|||
(Prusa3D specific)
|
||||
*/
|
||||
case 87:
|
||||
calibration_status_store(CALIBRATION_STATUS_CALIBRATED);
|
||||
calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST);
|
||||
break;
|
||||
|
||||
/*!
|
||||
|
|
@ -5682,9 +5683,9 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
|
|||
*/
|
||||
case 44: // M44: Prusa3D: Reset the bed skew and offset calibration.
|
||||
|
||||
// Reset the baby step value and the baby step applied flag.
|
||||
calibration_status_store(CALIBRATION_STATUS_ASSEMBLED);
|
||||
eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
|
||||
// Reset the baby step value and the baby step applied flag.
|
||||
calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST);
|
||||
eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
|
||||
|
||||
// Reset the skew and offset in both RAM and EEPROM.
|
||||
reset_bed_offset_and_skew();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "Configuration.h"
|
||||
#include "ConfigurationStore.h"
|
||||
#include "util.h"
|
||||
#include "language.h"
|
||||
#include "mesh_bed_calibration.h"
|
||||
#include "mesh_bed_leveling.h"
|
||||
|
|
@ -3044,7 +3045,7 @@ void babystep_load()
|
|||
{
|
||||
babystepLoadZ = 0;
|
||||
// Apply Z height correction aka baby stepping before mesh bed leveling gets activated.
|
||||
if (calibration_status() < CALIBRATION_STATUS_LIVE_ADJUST)
|
||||
if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST))
|
||||
{
|
||||
check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0
|
||||
|
||||
|
|
|
|||
|
|
@ -2726,7 +2726,7 @@ static void lcd_babystep_z()
|
|||
}
|
||||
|
||||
// same logic as in babystep_load
|
||||
if (calibration_status() >= CALIBRATION_STATUS_LIVE_ADJUST)
|
||||
if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST))
|
||||
_md->babystepMemZ = 0;
|
||||
|
||||
_md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_unit[Z_AXIS];
|
||||
|
|
@ -2768,7 +2768,7 @@ static void lcd_babystep_z()
|
|||
#ifdef PINDA_THERMISTOR
|
||||
eeprom_update_byte(&(EEPROM_Sheets_base->s[active_sheet].pinda_temp),current_temperature_pinda);
|
||||
#endif //PINDA_THERMISTOR
|
||||
calibration_status_store(CALIBRATION_STATUS_CALIBRATED);
|
||||
calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST);
|
||||
}
|
||||
if (LCD_CLICKED) menu_back();
|
||||
}
|
||||
|
|
@ -3889,7 +3889,7 @@ void lcd_first_layer_calibration_reset()
|
|||
MenuData* menuData = (MenuData*)&(menu_data[0]);
|
||||
|
||||
if(LCD_CLICKED || !eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) ||
|
||||
(calibration_status() >= CALIBRATION_STATUS_LIVE_ADJUST) ||
|
||||
(!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) ||
|
||||
(0 == static_cast<int16_t>(eeprom_read_word(reinterpret_cast<uint16_t*>
|
||||
(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)))))
|
||||
{
|
||||
|
|
@ -5518,10 +5518,8 @@ static void lcd_reset_sheet()
|
|||
if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))
|
||||
{
|
||||
eeprom_switch_to_next_sheet();
|
||||
if((-1 == eeprom_next_initialized_sheet(0)) && (CALIBRATION_STATUS_CALIBRATED == calibration_status()))
|
||||
{
|
||||
calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
|
||||
}
|
||||
if (-1 == eeprom_next_initialized_sheet(0))
|
||||
calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST);
|
||||
}
|
||||
|
||||
menu_back();
|
||||
|
|
|
|||
Loading…
Reference in New Issue