🐛 Followup to JyersUI
This commit is contained in:
		@@ -23,10 +23,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "inc/MarlinConfig.h"
 | 
					#include "inc/MarlinConfig.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef DEBUG_GCODE_PARSER
 | 
					 | 
				
			||||||
  #include "gcode/parser.h"
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include <math.h>
 | 
					#include <math.h>
 | 
				
			||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,10 +21,6 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * gcode.h - Temporary container for all gcode handlers
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * -----------------
 | 
					 * -----------------
 | 
				
			||||||
 * G-Codes in Marlin
 | 
					 * G-Codes in Marlin
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -145,7 +145,9 @@ ENCODER_DiffState Encoder_ReceiveAnalyze() {
 | 
				
			|||||||
          const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
 | 
					          const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
 | 
				
			||||||
               if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
 | 
					               if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
 | 
				
			||||||
          else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)  encoderMultiplier = 10;
 | 
					          else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)  encoderMultiplier = 10;
 | 
				
			||||||
 | 
					          #if ENCODER_5X_STEPS_PER_SEC
 | 
				
			||||||
            else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
 | 
					            else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
 | 
				
			||||||
 | 
					          #endif
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        EncoderRate.lastEncoderTime = ms;
 | 
					        EncoderRate.lastEncoderTime = ms;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -145,7 +145,9 @@ ENCODER_DiffState Encoder_ReceiveAnalyze() {
 | 
				
			|||||||
          const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
 | 
					          const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
 | 
				
			||||||
               if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
 | 
					               if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
 | 
				
			||||||
          else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)  encoderMultiplier = 10;
 | 
					          else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)  encoderMultiplier = 10;
 | 
				
			||||||
 | 
					          #if ENCODER_5X_STEPS_PER_SEC
 | 
				
			||||||
            else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
 | 
					            else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
 | 
				
			||||||
 | 
					          #endif
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        EncoderRate.lastEncoderTime = ms;
 | 
					        EncoderRate.lastEncoderTime = ms;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,6 +33,7 @@
 | 
				
			|||||||
#include "../../marlinui.h"
 | 
					#include "../../marlinui.h"
 | 
				
			||||||
#include "../../../MarlinCore.h"
 | 
					#include "../../../MarlinCore.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "../../../gcode/gcode.h"
 | 
				
			||||||
#include "../../../module/temperature.h"
 | 
					#include "../../../module/temperature.h"
 | 
				
			||||||
#include "../../../module/planner.h"
 | 
					#include "../../../module/planner.h"
 | 
				
			||||||
#include "../../../module/settings.h"
 | 
					#include "../../../module/settings.h"
 | 
				
			||||||
@@ -180,6 +181,7 @@ bool probe_deployed = false;
 | 
				
			|||||||
CrealityDWINClass CrealityDWIN;
 | 
					CrealityDWINClass CrealityDWIN;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if HAS_MESH
 | 
					#if HAS_MESH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  struct Mesh_Settings {
 | 
					  struct Mesh_Settings {
 | 
				
			||||||
    bool viewer_asymmetric_range = false;
 | 
					    bool viewer_asymmetric_range = false;
 | 
				
			||||||
    bool viewer_print_value = false;
 | 
					    bool viewer_print_value = false;
 | 
				
			||||||
@@ -362,7 +364,7 @@ CrealityDWINClass CrealityDWIN;
 | 
				
			|||||||
      if (v_min > 3e+10F) v_min = 0.0000001;
 | 
					      if (v_min > 3e+10F) v_min = 0.0000001;
 | 
				
			||||||
      if (v_max > 3e+10F) v_max = 0.0000001;
 | 
					      if (v_max > 3e+10F) v_max = 0.0000001;
 | 
				
			||||||
      if (range > 3e+10F) range = 0.0000001;
 | 
					      if (range > 3e+10F) range = 0.0000001;
 | 
				
			||||||
      char msg[32];
 | 
					      char msg[46];
 | 
				
			||||||
      if (viewer_asymmetric_range) {
 | 
					      if (viewer_asymmetric_range) {
 | 
				
			||||||
        dtostrf(-v_min, 1, 3, str_1);
 | 
					        dtostrf(-v_min, 1, 3, str_1);
 | 
				
			||||||
        dtostrf( v_max, 1, 3, str_2);
 | 
					        dtostrf( v_max, 1, 3, str_2);
 | 
				
			||||||
@@ -378,7 +380,8 @@ CrealityDWINClass CrealityDWIN;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
  Mesh_Settings mesh_conf;
 | 
					  Mesh_Settings mesh_conf;
 | 
				
			||||||
#endif
 | 
					
 | 
				
			||||||
 | 
					#endif // HAS_MESH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* General Display Functions */
 | 
					/* General Display Functions */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -4754,11 +4757,13 @@ void CrealityDWINClass::Start_Print(bool sd) {
 | 
				
			|||||||
    printing = true;
 | 
					    printing = true;
 | 
				
			||||||
    statusmsg[0] = '\0';
 | 
					    statusmsg[0] = '\0';
 | 
				
			||||||
    if (sd) {
 | 
					    if (sd) {
 | 
				
			||||||
 | 
					      #if ENABLED(POWER_LOSS_RECOVERY)
 | 
				
			||||||
        if (recovery.valid()) {
 | 
					        if (recovery.valid()) {
 | 
				
			||||||
          SdFile *diveDir = nullptr;
 | 
					          SdFile *diveDir = nullptr;
 | 
				
			||||||
          const char * const fname = card.diveToFile(true, diveDir, recovery.info.sd_filename);
 | 
					          const char * const fname = card.diveToFile(true, diveDir, recovery.info.sd_filename);
 | 
				
			||||||
          card.selectFileByName(fname);
 | 
					          card.selectFileByName(fname);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					      #endif
 | 
				
			||||||
      strcpy_P(filename, card.longest_filename());
 | 
					      strcpy_P(filename, card.longest_filename());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
@@ -4798,7 +4803,7 @@ void MarlinUI::update() { CrealityDWIN.Update(); }
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void CrealityDWINClass::State_Update() {
 | 
					void CrealityDWINClass::State_Update() {
 | 
				
			||||||
  if ((print_job_timer.isRunning() || print_job_timer.isPaused()) != printing) {
 | 
					  if ((print_job_timer.isRunning() || print_job_timer.isPaused()) != printing) {
 | 
				
			||||||
    if (!printing) Start_Print((card.isFileOpen() || recovery.valid()));
 | 
					    if (!printing) Start_Print(card.isFileOpen() || TERN0(POWER_LOSS_RECOVERY, recovery.valid()));
 | 
				
			||||||
    else Stop_Print();
 | 
					    else Stop_Print();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  if (print_job_timer.isPaused() != paused) {
 | 
					  if (print_job_timer.isPaused() != paused) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -145,7 +145,9 @@ ENCODER_DiffState Encoder_ReceiveAnalyze() {
 | 
				
			|||||||
          const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
 | 
					          const float encoderStepRate = encoderMovementSteps / float(ms - EncoderRate.lastEncoderTime) * 1000;
 | 
				
			||||||
               if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
 | 
					               if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
 | 
				
			||||||
          else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)  encoderMultiplier = 10;
 | 
					          else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)  encoderMultiplier = 10;
 | 
				
			||||||
 | 
					          #if ENCODER_5X_STEPS_PER_SEC
 | 
				
			||||||
            else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
 | 
					            else if (encoderStepRate >= ENCODER_5X_STEPS_PER_SEC) encoderMultiplier = 5;
 | 
				
			||||||
 | 
					          #endif
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        EncoderRate.lastEncoderTime = ms;
 | 
					        EncoderRate.lastEncoderTime = ms;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -596,7 +596,7 @@ public:
 | 
				
			|||||||
    static inline bool use_click() { return false; }
 | 
					    static inline bool use_click() { return false; }
 | 
				
			||||||
  #endif
 | 
					  #endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_LCD_MENU, EXTENSIBLE_UI, HAS_DWIN_E3V2)
 | 
					  #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_LCD_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI)
 | 
				
			||||||
    static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder);
 | 
					    static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder);
 | 
				
			||||||
  #else
 | 
					  #else
 | 
				
			||||||
    static inline void _pause_show_message() {}
 | 
					    static inline void _pause_show_message() {}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user