Fix ExtUI invalid speed, timer (#15031)

2.0.x
InsanityAutomation 5 years ago committed by Scott Lahteine
parent 155765646e
commit f218405c36

@ -37,7 +37,7 @@ Babystep babystep;
volatile int16_t Babystep::todo[BS_TODO_AXIS(Z_AXIS) + 1];
#if HAS_LCD_MENU
#if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
int16_t Babystep::accum;
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
int16_t Babystep::axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];
@ -75,7 +75,7 @@ void Babystep::add_steps(const AxisEnum axis, const int16_t distance) {
if (!CAN_BABYSTEP(axis)) return;
#if HAS_LCD_MENU
#if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
accum += distance; // Count up babysteps for the UI
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
axis_total[BS_TOTAL_AXIS(axis)] += distance;

@ -30,7 +30,7 @@
#define BS_TODO_AXIS(A) 0
#endif
#if HAS_LCD_MENU && ENABLED(BABYSTEP_DISPLAY_TOTAL)
#if (HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)) && ENABLED(BABYSTEP_DISPLAY_TOTAL)
#if ENABLED(BABYSTEP_XY)
#define BS_TOTAL_AXIS(A) A
#else
@ -41,7 +41,7 @@
class Babystep {
public:
static volatile int16_t todo[BS_TODO_AXIS(Z_AXIS) + 1];
#if HAS_LCD_MENU
#if HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)
static int16_t accum; // Total babysteps in current edit
#if ENABLED(BABYSTEP_DISPLAY_TOTAL)
static int16_t axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]; // Total babysteps since G28

@ -188,7 +188,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
host_action_prompt_show();
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("Load Filament"));
ExtUI::onUserConfirmRequired(PSTR("Load Filament"));
#endif
while (wait_for_user) {
#if HAS_BUZZER
@ -243,7 +243,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Continuous Purge Running..."), PSTR("Continue"));
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("Continuous Purge Running..."));
ExtUI::onUserConfirmRequired(PSTR("Continuous Purge Running..."));
#endif
for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
@ -524,7 +524,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), PSTR("Continue"));
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("Nozzle Parked"));
ExtUI::onUserConfirmRequired(PSTR("Nozzle Parked"));
#endif
while (wait_for_user) {
#if HAS_BUZZER
@ -548,7 +548,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("HeaterTimeout"));
ExtUI::onUserConfirmRequired(PSTR("HeaterTimeout"));
#endif
// Wait for LCD click or M108

@ -716,7 +716,7 @@ void MMU2::filament_runout() {
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), PSTR("Continue"));
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("MMU2 Eject Recover"));
ExtUI::onUserConfirmRequired(PSTR("MMU2 Eject Recover"));
#endif
while (wait_for_user) idle();
BUZZ(200, 404);

@ -334,7 +334,7 @@ void GcodeSuite::M43() {
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M43 Wait Called"), PSTR("Continue"));
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("M43 Wait Called"));
ExtUI::onUserConfirmRequired(PSTR("M43 Wait Called"));
#endif
#endif

@ -98,7 +98,7 @@ void GcodeSuite::M0_M1() {
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), PSTR("Continue"));
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("M0/1 Break Called"));
ExtUI::onUserConfirmRequired(PSTR("M0/1 Break Called"));
#endif
if (ms > 0) {
@ -108,10 +108,6 @@ void GcodeSuite::M0_M1() {
else
while (wait_for_user) idle();
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onUserConfirmRequired(nullptr);
#endif
#if HAS_LEDS_OFF_FLAG
printerEventLEDs.onResumeAfterWait();
#endif

@ -33,9 +33,6 @@
*/
void GcodeSuite::M75() {
print_job_timer.start();
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onPrintTimerStarted();
#endif
}
/**

@ -320,7 +320,7 @@ namespace ExtUI {
#endif
constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
setFeedrate_mm_s(max_manual_feedrate[axis]);
setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[axis]));
if (!flags.manual_motion) set_destination_from_current();
destination[axis] = clamp(position, min, max);
@ -331,7 +331,7 @@ namespace ExtUI {
setActiveTool(extruder, true);
constexpr float max_manual_feedrate[XYZE] = MANUAL_FEEDRATE;
setFeedrate_mm_s(max_manual_feedrate[E_AXIS]);
setFeedrate_mm_s(MMM_MMS(max_manual_feedrate[E_AXIS]));
if (!flags.manual_motion) set_destination_from_current();
destination[E_AXIS] = position;
flags.manual_motion = true;
@ -714,17 +714,26 @@ namespace ExtUI {
}
#endif
#if HAS_BED_PROBE
float getZOffset_mm() {
float getZOffset_mm() {
#if HAS_BED_PROBE
return zprobe_zoffset;
}
#elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
return babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];
#else
return 0.0;
#endif
}
void setZOffset_mm(const float value) {
if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
void setZOffset_mm(const float value) {
#if HAS_BED_PROBE
if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
zprobe_zoffset = value;
}
}
#endif // HAS_BED_PROBE
#elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
babystep.add_mm(Z_AXIS, (value - babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]));
#else
UNUSED(value);
#endif
}
#if HAS_HOTEND_OFFSET

@ -198,10 +198,8 @@ namespace ExtUI {
void normalizeNozzleOffset(const axis_t axis);
#endif
#if HAS_BED_PROBE
float getZOffset_mm();
void setZOffset_mm(const float);
#endif
float getZOffset_mm();
void setZOffset_mm(const float);
#if ENABLED(BACKLASH_GCODE)
float getAxisBacklash_mm(const axis_t);

@ -60,7 +60,7 @@ void _man_probe_pt(const float &rx, const float &ry) {
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), PSTR("Continue"));
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("Delta Calibration in progress"));
ExtUI::onUserConfirmRequired(PSTR("Delta Calibration in progress"));
#endif
while (wait_for_user) idle();
ui.goto_previous_screen_no_defer();

@ -60,6 +60,10 @@ bool Stopwatch::start() {
Stopwatch::debug(PSTR("start"));
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onPrintTimerStarted();
#endif
if (!isRunning()) {
if (isPaused()) accumulator = duration();
else reset();

@ -378,7 +378,7 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), PSTR("Continue"));
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onStatusChanged(PSTR("Stow Probe"));
ExtUI::onUserConfirmRequired(PSTR("Stow Probe"));
#endif
while (wait_for_user) idle();
ui.reset_status();

Loading…
Cancel
Save