🎨 Fewer serial macros
This commit is contained in:
		
				
					committed by
					
						
						Scott Lahteine
					
				
			
			
				
	
			
			
			
						parent
						
							6d96c221bd
						
					
				
				
					commit
					b661795ae5
				
			@@ -1923,7 +1923,7 @@ void HMI_SDCardUpdate() {
 | 
			
		||||
  if (HMI_flag.home_flag) return;
 | 
			
		||||
  if (DWIN_lcd_sd_status != card.isMounted()) {
 | 
			
		||||
    DWIN_lcd_sd_status = card.isMounted();
 | 
			
		||||
    //SERIAL_ECHOLNPAIR("HMI_SDCardUpdate: ", DWIN_lcd_sd_status);
 | 
			
		||||
    //SERIAL_ECHOLNPGM("HMI_SDCardUpdate: ", DWIN_lcd_sd_status);
 | 
			
		||||
    if (DWIN_lcd_sd_status) {
 | 
			
		||||
      if (checkkey == SelectFile)
 | 
			
		||||
        Redraw_SD_List();
 | 
			
		||||
 
 | 
			
		||||
@@ -979,7 +979,7 @@ void HMI_SDCardUpdate() {
 | 
			
		||||
  if (HMI_flag.home_flag) return;
 | 
			
		||||
  if (DWIN_lcd_sd_status != card.isMounted()) {
 | 
			
		||||
    DWIN_lcd_sd_status = card.isMounted();
 | 
			
		||||
    //SERIAL_ECHOLNPAIR("HMI_SDCardUpdate: ", DWIN_lcd_sd_status);
 | 
			
		||||
    //SERIAL_ECHOLNPGM("HMI_SDCardUpdate: ", DWIN_lcd_sd_status);
 | 
			
		||||
    if (DWIN_lcd_sd_status) {
 | 
			
		||||
      if (checkkey == SelectFile)
 | 
			
		||||
        Redraw_SD_List();
 | 
			
		||||
 
 | 
			
		||||
@@ -86,7 +86,7 @@ void FileNavigator::refresh() { filelist.refresh(); }
 | 
			
		||||
 | 
			
		||||
void FileNavigator::changeDIR(const char *folder) {
 | 
			
		||||
  if (currentfolderdepth >= MAX_FOLDER_DEPTH) return; // limit the folder depth
 | 
			
		||||
  DEBUG_ECHOLNPAIR("FD:" , folderdepth, " FP:",currentindex, " currentfolder:", currentfoldername, " enter:", folder);
 | 
			
		||||
  DEBUG_ECHOLNPGM("FD:" , folderdepth, " FP:",currentindex, " currentfolder:", currentfoldername, " enter:", folder);
 | 
			
		||||
  currentfolderindex[currentfolderdepth] = currentindex;
 | 
			
		||||
  strcat(currentfoldername, folder);
 | 
			
		||||
  strcat(currentfoldername, "/");
 | 
			
		||||
@@ -96,7 +96,7 @@ void FileNavigator::changeDIR(const char *folder) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void FileNavigator::upDIR() {
 | 
			
		||||
  DEBUG_ECHOLNPAIR("upDIR() from D:", currentfolderdepth, " N:", currentfoldername);
 | 
			
		||||
  DEBUG_ECHOLNPGM("upDIR() from D:", currentfolderdepth, " N:", currentfoldername);
 | 
			
		||||
  if (!filelist.isAtRootDir()) {
 | 
			
		||||
    filelist.upDir();
 | 
			
		||||
    currentfolderdepth--;
 | 
			
		||||
@@ -117,7 +117,7 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
 | 
			
		||||
  if (skip == 0) return;
 | 
			
		||||
  while (skip > 0) {
 | 
			
		||||
    if (filelist.seek(currentindex)) {
 | 
			
		||||
      DEBUG_ECHOLNPAIR("CI:", currentindex, " FD:", currentfolderdepth, " N:", skip, " ", filelist.longFilename());
 | 
			
		||||
      DEBUG_ECHOLNPGM("CI:", currentindex, " FD:", currentfolderdepth, " N:", skip, " ", filelist.longFilename());
 | 
			
		||||
      if (!filelist.isDir()) {
 | 
			
		||||
        skip--;
 | 
			
		||||
        currentindex++;
 | 
			
		||||
@@ -151,7 +151,7 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
 | 
			
		||||
    }
 | 
			
		||||
    lastpanelindex = index;
 | 
			
		||||
 | 
			
		||||
    DEBUG_ECHOLNPAIR("index=", index, " currentindex=", currentindex);
 | 
			
		||||
    DEBUG_ECHOLNPGM("index=", index, " currentindex=", currentindex);
 | 
			
		||||
 | 
			
		||||
    if (currentindex == 0 && currentfolderdepth > 0) { // Add a link to go up a folder
 | 
			
		||||
      // The new panel ignores entries that don't end in .GCO or .gcode so add and pad them.
 | 
			
		||||
@@ -169,7 +169,7 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
 | 
			
		||||
    for (uint16_t seek = currentindex; seek < currentindex + filesneeded; seek++) {
 | 
			
		||||
      if (filelist.seek(seek)) {
 | 
			
		||||
        sendFile(paneltype);
 | 
			
		||||
        DEBUG_ECHOLNPAIR("-", seek, " '", filelist.longFilename(), "' '", currentfoldername, "", filelist.shortFilename(), "'");
 | 
			
		||||
        DEBUG_ECHOLNPGM("-", seek, " '", filelist.longFilename(), "' '", currentfoldername, "", filelist.shortFilename(), "'");
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
@@ -212,7 +212,7 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
 | 
			
		||||
#else // Flat file list
 | 
			
		||||
 | 
			
		||||
  void FileNavigator::getFiles(uint16_t index, panel_type_t paneltype, uint8_t filesneeded) {
 | 
			
		||||
    DEBUG_ECHOLNPAIR("getFiles() I:", index," L:", lastpanelindex);
 | 
			
		||||
    DEBUG_ECHOLNPGM("getFiles() I:", index," L:", lastpanelindex);
 | 
			
		||||
    // if we're searching backwards, jump back to start and search forward
 | 
			
		||||
    if (index < lastpanelindex) {
 | 
			
		||||
      reset();
 | 
			
		||||
@@ -248,7 +248,7 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
 | 
			
		||||
    TFTSer.println(filelist.shortFilename());
 | 
			
		||||
    if (currentfolderdepth > 0) TFTSer.print(currentfoldername);
 | 
			
		||||
    TFTSer.println(filelist.longFilename());
 | 
			
		||||
    DEBUG_ECHOLNPAIR("/", currentfoldername, "", filelist.shortFilename(), " ", filelist.longFilename());
 | 
			
		||||
    DEBUG_ECHOLNPGM("/", currentfoldername, "", filelist.shortFilename(), " ", filelist.longFilename());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
#endif // Flat file list
 | 
			
		||||
 
 | 
			
		||||
@@ -107,12 +107,12 @@ namespace ExtUI {
 | 
			
		||||
 | 
			
		||||
    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
 | 
			
		||||
      // Called when any mesh points are updated
 | 
			
		||||
      //SERIAL_ECHOLNPAIR("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval);
 | 
			
		||||
      //SERIAL_ECHOLNPGM("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const probe_state_t state) {
 | 
			
		||||
      // Called to indicate a special condition
 | 
			
		||||
      //SERIAL_ECHOLNPAIR("onMeshUpdate() x:", xpos, " y:", ypos, " state:", state);
 | 
			
		||||
      //SERIAL_ECHOLNPGM("onMeshUpdate() x:", xpos, " y:", ypos, " state:", state);
 | 
			
		||||
    }
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -104,7 +104,7 @@ void ChironTFT::Startup() {
 | 
			
		||||
  PlayTune(BEEPER_PIN, TERN(AC_DEFAULT_STARTUP_TUNE, Anycubic_PowerOn, GB_PowerOn), 1);
 | 
			
		||||
 | 
			
		||||
  #if ACDEBUGLEVEL
 | 
			
		||||
    SERIAL_ECHOLNPAIR("AC Debug Level ", ACDEBUGLEVEL);
 | 
			
		||||
    SERIAL_ECHOLNPGM("AC Debug Level ", ACDEBUGLEVEL);
 | 
			
		||||
  #endif
 | 
			
		||||
  SendtoTFTLN(AC_msg_ready);
 | 
			
		||||
}
 | 
			
		||||
@@ -128,13 +128,13 @@ void ChironTFT::IdleLoop()  {
 | 
			
		||||
void ChironTFT::PrinterKilled(PGM_P error,PGM_P component)  {
 | 
			
		||||
  SendtoTFTLN(AC_msg_kill_lcd);
 | 
			
		||||
  #if ACDEBUG(AC_MARLIN)
 | 
			
		||||
    SERIAL_ECHOLNPAIR("PrinterKilled()\nerror: ", error , "\ncomponent: ", component);
 | 
			
		||||
    SERIAL_ECHOLNPGM("PrinterKilled()\nerror: ", error , "\ncomponent: ", component);
 | 
			
		||||
  #endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ChironTFT::MediaEvent(media_event_t event)  {
 | 
			
		||||
  #if ACDEBUG(AC_MARLIN)
 | 
			
		||||
    SERIAL_ECHOLNPAIR("ProcessMediaStatus() ", event);
 | 
			
		||||
    SERIAL_ECHOLNPGM("ProcessMediaStatus() ", event);
 | 
			
		||||
  #endif
 | 
			
		||||
  switch (event) {
 | 
			
		||||
    case AC_media_inserted:
 | 
			
		||||
@@ -154,8 +154,8 @@ void ChironTFT::MediaEvent(media_event_t event)  {
 | 
			
		||||
 | 
			
		||||
void ChironTFT::TimerEvent(timer_event_t event)  {
 | 
			
		||||
  #if ACDEBUG(AC_MARLIN)
 | 
			
		||||
    SERIAL_ECHOLNPAIR("TimerEvent() ", event);
 | 
			
		||||
    SERIAL_ECHOLNPAIR("Printer State: ", printer_state);
 | 
			
		||||
    SERIAL_ECHOLNPGM("TimerEvent() ", event);
 | 
			
		||||
    SERIAL_ECHOLNPGM("Printer State: ", printer_state);
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  switch (event) {
 | 
			
		||||
@@ -184,7 +184,7 @@ void ChironTFT::TimerEvent(timer_event_t event)  {
 | 
			
		||||
 | 
			
		||||
void ChironTFT::FilamentRunout()  {
 | 
			
		||||
  #if ACDEBUG(AC_MARLIN)
 | 
			
		||||
    SERIAL_ECHOLNPAIR("FilamentRunout() printer_state ", printer_state);
 | 
			
		||||
    SERIAL_ECHOLNPGM("FilamentRunout() printer_state ", printer_state);
 | 
			
		||||
  #endif
 | 
			
		||||
  // 1 Signal filament out
 | 
			
		||||
  last_error = AC_error_filament_runout;
 | 
			
		||||
@@ -195,7 +195,7 @@ void ChironTFT::FilamentRunout()  {
 | 
			
		||||
void ChironTFT::ConfirmationRequest(const char * const msg)  {
 | 
			
		||||
  // M108 continue
 | 
			
		||||
  #if ACDEBUG(AC_MARLIN)
 | 
			
		||||
    SERIAL_ECHOLNPAIR("ConfirmationRequest() ", msg, " printer_state:", printer_state);
 | 
			
		||||
    SERIAL_ECHOLNPGM("ConfirmationRequest() ", msg, " printer_state:", printer_state);
 | 
			
		||||
  #endif
 | 
			
		||||
  switch (printer_state) {
 | 
			
		||||
    case AC_printer_pausing: {
 | 
			
		||||
@@ -232,8 +232,8 @@ void ChironTFT::ConfirmationRequest(const char * const msg)  {
 | 
			
		||||
 | 
			
		||||
void ChironTFT::StatusChange(const char * const msg)  {
 | 
			
		||||
  #if ACDEBUG(AC_MARLIN)
 | 
			
		||||
    SERIAL_ECHOLNPAIR("StatusChange() ", msg);
 | 
			
		||||
    SERIAL_ECHOLNPAIR("printer_state:", printer_state);
 | 
			
		||||
    SERIAL_ECHOLNPGM("StatusChange() ", msg);
 | 
			
		||||
    SERIAL_ECHOLNPGM("printer_state:", printer_state);
 | 
			
		||||
  #endif
 | 
			
		||||
  bool msg_matched = false;
 | 
			
		||||
  // The only way to get printer status is to parse messages
 | 
			
		||||
@@ -348,7 +348,7 @@ bool ChironTFT::ReadTFTCommand() {
 | 
			
		||||
  if (command_ready || command_len == MAX_CMND_LEN) {
 | 
			
		||||
    panel_command[command_len] = '\0';
 | 
			
		||||
    #if ACDEBUG(AC_ALL)
 | 
			
		||||
      SERIAL_ECHOLNPAIR("len(",command_len,") < ", panel_command);
 | 
			
		||||
      SERIAL_ECHOLNPGM("len(",command_len,") < ", panel_command);
 | 
			
		||||
    #endif
 | 
			
		||||
    command_ready = true;
 | 
			
		||||
  }
 | 
			
		||||
@@ -360,13 +360,13 @@ int8_t ChironTFT::FindToken(char c) {
 | 
			
		||||
  do {
 | 
			
		||||
    if (panel_command[pos] == c) {
 | 
			
		||||
      #if ACDEBUG(AC_INFO)
 | 
			
		||||
        SERIAL_ECHOLNPAIR("Tpos:", pos, " ", c);
 | 
			
		||||
        SERIAL_ECHOLNPGM("Tpos:", pos, " ", c);
 | 
			
		||||
      #endif
 | 
			
		||||
      return pos;
 | 
			
		||||
    }
 | 
			
		||||
  } while(++pos < command_len);
 | 
			
		||||
  #if ACDEBUG(AC_INFO)
 | 
			
		||||
    SERIAL_ECHOLNPAIR("Not found: ", c);
 | 
			
		||||
    SERIAL_ECHOLNPGM("Not found: ", c);
 | 
			
		||||
  #endif
 | 
			
		||||
  return -1;
 | 
			
		||||
}
 | 
			
		||||
@@ -381,7 +381,7 @@ void ChironTFT::CheckHeaters() {
 | 
			
		||||
    if (faultDuration >= AC_HEATER_FAULT_VALIDATION_TIME) {
 | 
			
		||||
      SendtoTFTLN(AC_msg_nozzle_temp_abnormal);
 | 
			
		||||
      last_error = AC_error_abnormal_temp_t0;
 | 
			
		||||
      SERIAL_ECHOLNPAIR("Extruder temp abnormal! : ", temp);
 | 
			
		||||
      SERIAL_ECHOLNPGM("Extruder temp abnormal! : ", temp);
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
    delay_ms(500);
 | 
			
		||||
@@ -396,7 +396,7 @@ void ChironTFT::CheckHeaters() {
 | 
			
		||||
    if (faultDuration >= AC_HEATER_FAULT_VALIDATION_TIME) {
 | 
			
		||||
      SendtoTFTLN(AC_msg_nozzle_temp_abnormal);
 | 
			
		||||
      last_error = AC_error_abnormal_temp_bed;
 | 
			
		||||
      SERIAL_ECHOLNPAIR("Bed temp abnormal! : ", temp);
 | 
			
		||||
      SERIAL_ECHOLNPGM("Bed temp abnormal! : ", temp);
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
    delay_ms(500);
 | 
			
		||||
@@ -423,7 +423,7 @@ void ChironTFT::CheckHeaters() {
 | 
			
		||||
void ChironTFT::SendFileList(int8_t startindex) {
 | 
			
		||||
  // Respond to panel request for 4 files starting at index
 | 
			
		||||
  #if ACDEBUG(AC_INFO)
 | 
			
		||||
    SERIAL_ECHOLNPAIR("## SendFileList ## ", startindex);
 | 
			
		||||
    SERIAL_ECHOLNPGM("## SendFileList ## ", startindex);
 | 
			
		||||
  #endif
 | 
			
		||||
  SendtoTFTLN(PSTR("FN "));
 | 
			
		||||
  filenavigator.getFiles(startindex, panel_type, 4);
 | 
			
		||||
@@ -440,7 +440,7 @@ void ChironTFT::SelectFile() {
 | 
			
		||||
    selectedfile[command_len - 5] = '\0';
 | 
			
		||||
  }
 | 
			
		||||
  #if ACDEBUG(AC_FILE)
 | 
			
		||||
    SERIAL_ECHOLNPAIR(" Selected File: ",selectedfile);
 | 
			
		||||
    SERIAL_ECHOLNPGM(" Selected File: ",selectedfile);
 | 
			
		||||
  #endif
 | 
			
		||||
  switch (selectedfile[0]) {
 | 
			
		||||
    case '/':   // Valid file selected
 | 
			
		||||
@@ -561,7 +561,7 @@ void ChironTFT::PanelInfo(uint8_t req) {
 | 
			
		||||
      TFTSer.print(ui8tostr2(time % 60));
 | 
			
		||||
      SendtoTFT(PSTR(" M"));
 | 
			
		||||
      #if ACDEBUG(AC_ALL)
 | 
			
		||||
        SERIAL_ECHOLNPAIR("Print time ", ui8tostr2(time / 60), ":", ui8tostr2(time % 60));
 | 
			
		||||
        SERIAL_ECHOLNPGM("Print time ", ui8tostr2(time / 60), ":", ui8tostr2(time % 60));
 | 
			
		||||
      #endif
 | 
			
		||||
    } break;
 | 
			
		||||
 | 
			
		||||
@@ -702,7 +702,7 @@ void ChironTFT::PanelAction(uint8_t req) {
 | 
			
		||||
        char MoveCmnd[30];
 | 
			
		||||
        sprintf_P(MoveCmnd, PSTR("G91\nG0%s\nG90"), panel_command + 3);
 | 
			
		||||
        #if ACDEBUG(AC_ACTION)
 | 
			
		||||
          SERIAL_ECHOLNPAIR("Move: ", MoveCmnd);
 | 
			
		||||
          SERIAL_ECHOLNPGM("Move: ", MoveCmnd);
 | 
			
		||||
        #endif
 | 
			
		||||
        setSoftEndstopState(true);  // enable endstops
 | 
			
		||||
        injectCommands(MoveCmnd);
 | 
			
		||||
@@ -781,7 +781,7 @@ void ChironTFT::PanelProcess(uint8_t req) {
 | 
			
		||||
 | 
			
		||||
          if (isPositionKnown()) {
 | 
			
		||||
            #if ACDEBUG(AC_INFO)
 | 
			
		||||
              SERIAL_ECHOLNPAIR("Moving to mesh point at x: ", pos.x, " y: ", pos.y, " z: ", pos_z);
 | 
			
		||||
              SERIAL_ECHOLNPGM("Moving to mesh point at x: ", pos.x, " y: ", pos.y, " z: ", pos_z);
 | 
			
		||||
            #endif
 | 
			
		||||
            // Go up before moving
 | 
			
		||||
            setAxisPosition_mm(3.0,Z);
 | 
			
		||||
@@ -790,7 +790,7 @@ void ChironTFT::PanelProcess(uint8_t req) {
 | 
			
		||||
            setAxisPosition_mm(20 + (93 * pos.y), Y);
 | 
			
		||||
            setAxisPosition_mm(0.0, Z);
 | 
			
		||||
            #if ACDEBUG(AC_INFO)
 | 
			
		||||
              SERIAL_ECHOLNPAIR("Current Z: ", getAxisPosition_mm(Z));
 | 
			
		||||
              SERIAL_ECHOLNPGM("Current Z: ", getAxisPosition_mm(Z));
 | 
			
		||||
            #endif
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
@@ -858,17 +858,17 @@ void ChironTFT::PanelProcess(uint8_t req) {
 | 
			
		||||
          // From the leveling panel use the all points UI to adjust the print pos.
 | 
			
		||||
          if (isPrinting()) {
 | 
			
		||||
            #if ACDEBUG(AC_INFO)
 | 
			
		||||
              SERIAL_ECHOLNPAIR("Change Zoffset from:", live_Zoffset, " to ", live_Zoffset + Zshift);
 | 
			
		||||
              SERIAL_ECHOLNPGM("Change Zoffset from:", live_Zoffset, " to ", live_Zoffset + Zshift);
 | 
			
		||||
            #endif
 | 
			
		||||
            if (isAxisPositionKnown(Z)) {
 | 
			
		||||
              #if ACDEBUG(AC_INFO)
 | 
			
		||||
                const float currZpos = getAxisPosition_mm(Z);
 | 
			
		||||
                SERIAL_ECHOLNPAIR("Nudge Z pos from ", currZpos, " to ", currZpos + constrain(Zshift, -0.05, 0.05));
 | 
			
		||||
                SERIAL_ECHOLNPGM("Nudge Z pos from ", currZpos, " to ", currZpos + constrain(Zshift, -0.05, 0.05));
 | 
			
		||||
              #endif
 | 
			
		||||
              // Use babystepping to adjust the head position
 | 
			
		||||
              int16_t steps = mmToWholeSteps(constrain(Zshift,-0.05,0.05), Z);
 | 
			
		||||
              #if ACDEBUG(AC_INFO)
 | 
			
		||||
                SERIAL_ECHOLNPAIR("Steps to move Z: ", steps);
 | 
			
		||||
                SERIAL_ECHOLNPGM("Steps to move Z: ", steps);
 | 
			
		||||
              #endif
 | 
			
		||||
              babystepAxis_steps(steps, Z);
 | 
			
		||||
              live_Zoffset += Zshift;
 | 
			
		||||
@@ -882,12 +882,12 @@ void ChironTFT::PanelProcess(uint8_t req) {
 | 
			
		||||
              const float currval = getMeshPoint(pos);
 | 
			
		||||
              setMeshPoint(pos, constrain(currval + Zshift, AC_LOWEST_MESHPOINT_VAL, 2));
 | 
			
		||||
              #if ACDEBUG(AC_INFO)
 | 
			
		||||
                SERIAL_ECHOLNPAIR("Change mesh point X", x," Y",y ," from ", currval, " to ", getMeshPoint(pos) );
 | 
			
		||||
                SERIAL_ECHOLNPGM("Change mesh point X", x," Y",y ," from ", currval, " to ", getMeshPoint(pos) );
 | 
			
		||||
              #endif
 | 
			
		||||
            }
 | 
			
		||||
            const float currZOffset = getZOffset_mm();
 | 
			
		||||
            #if ACDEBUG(AC_INFO)
 | 
			
		||||
              SERIAL_ECHOLNPAIR("Change probe offset from ", currZOffset, " to  ", currZOffset + Zshift);
 | 
			
		||||
              SERIAL_ECHOLNPGM("Change probe offset from ", currZOffset, " to  ", currZOffset + Zshift);
 | 
			
		||||
            #endif
 | 
			
		||||
 | 
			
		||||
            setZOffset_mm(currZOffset + Zshift);
 | 
			
		||||
@@ -898,7 +898,7 @@ void ChironTFT::PanelProcess(uint8_t req) {
 | 
			
		||||
              // Move Z axis
 | 
			
		||||
              const float currZpos = getAxisPosition_mm(Z);
 | 
			
		||||
              #if ACDEBUG(AC_INFO)
 | 
			
		||||
                SERIAL_ECHOLNPAIR("Move Z pos from ", currZpos, " to ", currZpos + constrain(Zshift, -0.05, 0.05));
 | 
			
		||||
                SERIAL_ECHOLNPGM("Move Z pos from ", currZpos, " to ", currZpos + constrain(Zshift, -0.05, 0.05));
 | 
			
		||||
              #endif
 | 
			
		||||
              setAxisPosition_mm(currZpos+constrain(Zshift,-0.05,0.05),Z);
 | 
			
		||||
            }
 | 
			
		||||
@@ -930,8 +930,8 @@ void ChironTFT::PanelProcess(uint8_t req) {
 | 
			
		||||
        float currmesh = getMeshPoint(pos);
 | 
			
		||||
        float newval   = atof(&panel_command[11])/100;
 | 
			
		||||
        #if ACDEBUG(AC_INFO)
 | 
			
		||||
          SERIAL_ECHOLNPAIR("Change mesh point x:", pos.x, " y:", pos.y);
 | 
			
		||||
          SERIAL_ECHOLNPAIR("from ", currmesh, " to ", newval);
 | 
			
		||||
          SERIAL_ECHOLNPGM("Change mesh point x:", pos.x, " y:", pos.y);
 | 
			
		||||
          SERIAL_ECHOLNPGM("from ", currmesh, " to ", newval);
 | 
			
		||||
        #endif
 | 
			
		||||
        // Update Meshpoint
 | 
			
		||||
        setMeshPoint(pos,newval);
 | 
			
		||||
@@ -942,7 +942,7 @@ void ChironTFT::PanelProcess(uint8_t req) {
 | 
			
		||||
            setSoftEndstopState(false);
 | 
			
		||||
            float currZpos = getAxisPosition_mm(Z);
 | 
			
		||||
            #if ACDEBUG(AC_INFO)
 | 
			
		||||
              SERIAL_ECHOLNPAIR("Move Z pos from ", currZpos, " to ", currZpos + constrain(newval - currmesh, -0.05, 0.05));
 | 
			
		||||
              SERIAL_ECHOLNPGM("Move Z pos from ", currZpos, " to ", currZpos + constrain(newval - currmesh, -0.05, 0.05));
 | 
			
		||||
            #endif
 | 
			
		||||
            setAxisPosition_mm(currZpos + constrain(newval - currmesh, -0.05, 0.05), Z);
 | 
			
		||||
          }
 | 
			
		||||
 
 | 
			
		||||
@@ -143,7 +143,7 @@ void AnycubicTFTClass::OnKillTFT() {
 | 
			
		||||
 | 
			
		||||
void AnycubicTFTClass::OnSDCardStateChange(bool isInserted) {
 | 
			
		||||
  #if ENABLED(ANYCUBIC_LCD_DEBUG)
 | 
			
		||||
    SERIAL_ECHOLNPAIR("TFT Serial Debug: OnSDCardStateChange event triggered...", isInserted);
 | 
			
		||||
    SERIAL_ECHOLNPGM("TFT Serial Debug: OnSDCardStateChange event triggered...", isInserted);
 | 
			
		||||
  #endif
 | 
			
		||||
  DoSDCardStateCheck();
 | 
			
		||||
}
 | 
			
		||||
@@ -164,7 +164,7 @@ void AnycubicTFTClass::OnFilamentRunout() {
 | 
			
		||||
 | 
			
		||||
void AnycubicTFTClass::OnUserConfirmRequired(const char * const msg) {
 | 
			
		||||
  #if ENABLED(ANYCUBIC_LCD_DEBUG)
 | 
			
		||||
    SERIAL_ECHOLNPAIR("TFT Serial Debug: OnUserConfirmRequired triggered... ", msg);
 | 
			
		||||
    SERIAL_ECHOLNPGM("TFT Serial Debug: OnUserConfirmRequired triggered... ", msg);
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  #if ENABLED(SDSUPPORT)
 | 
			
		||||
@@ -557,7 +557,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
 | 
			
		||||
 | 
			
		||||
        #if ENABLED(ANYCUBIC_LCD_DEBUG)
 | 
			
		||||
          if ((a_command > 7) && (a_command != 20))   // No debugging of status polls, please!
 | 
			
		||||
            SERIAL_ECHOLNPAIR("TFT Serial Command: ", TFTcmdbuffer[TFTbufindw]);
 | 
			
		||||
            SERIAL_ECHOLNPGM("TFT Serial Command: ", TFTcmdbuffer[TFTbufindw]);
 | 
			
		||||
        #endif
 | 
			
		||||
 | 
			
		||||
        switch (a_command) {
 | 
			
		||||
 
 | 
			
		||||
@@ -154,19 +154,19 @@ void DGUSDisplay::ProcessRx() {
 | 
			
		||||
 | 
			
		||||
      case DGUS_IDLE: // Waiting for the first header byte
 | 
			
		||||
        receivedbyte = LCD_SERIAL.read();
 | 
			
		||||
        //DEBUG_ECHOPAIR("< ",x);
 | 
			
		||||
        //DEBUG_ECHOPGM("< ",x);
 | 
			
		||||
        if (DGUS_HEADER1 == receivedbyte) rx_datagram_state = DGUS_HEADER1_SEEN;
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
      case DGUS_HEADER1_SEEN: // Waiting for the second header byte
 | 
			
		||||
        receivedbyte = LCD_SERIAL.read();
 | 
			
		||||
        //DEBUG_ECHOPAIR(" ",x);
 | 
			
		||||
        //DEBUG_ECHOPGM(" ",x);
 | 
			
		||||
        rx_datagram_state = (DGUS_HEADER2 == receivedbyte) ? DGUS_HEADER2_SEEN : DGUS_IDLE;
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
      case DGUS_HEADER2_SEEN: // Waiting for the length byte
 | 
			
		||||
        rx_datagram_len = LCD_SERIAL.read();
 | 
			
		||||
        DEBUG_ECHOPAIR(" (", rx_datagram_len, ") ");
 | 
			
		||||
        DEBUG_ECHOPGM(" (", rx_datagram_len, ") ");
 | 
			
		||||
 | 
			
		||||
        // Telegram min len is 3 (command and one word of payload)
 | 
			
		||||
        rx_datagram_state = WITHIN(rx_datagram_len, 3, DGUS_RX_BUFFER_SIZE) ? DGUS_WAIT_TELEGRAM : DGUS_IDLE;
 | 
			
		||||
@@ -178,14 +178,14 @@ void DGUSDisplay::ProcessRx() {
 | 
			
		||||
        Initialized = true; // We've talked to it, so we defined it as initialized.
 | 
			
		||||
        uint8_t command = LCD_SERIAL.read();
 | 
			
		||||
 | 
			
		||||
        DEBUG_ECHOPAIR("# ", command);
 | 
			
		||||
        DEBUG_ECHOPGM("# ", command);
 | 
			
		||||
 | 
			
		||||
        uint8_t readlen = rx_datagram_len - 1;  // command is part of len.
 | 
			
		||||
        unsigned char tmp[rx_datagram_len - 1];
 | 
			
		||||
        unsigned char *ptmp = tmp;
 | 
			
		||||
        while (readlen--) {
 | 
			
		||||
          receivedbyte = LCD_SERIAL.read();
 | 
			
		||||
          DEBUG_ECHOPAIR(" ", receivedbyte);
 | 
			
		||||
          DEBUG_ECHOPGM(" ", receivedbyte);
 | 
			
		||||
          *ptmp++ = receivedbyte;
 | 
			
		||||
        }
 | 
			
		||||
        DEBUG_ECHOPGM(" # ");
 | 
			
		||||
@@ -206,7 +206,7 @@ void DGUSDisplay::ProcessRx() {
 | 
			
		||||
        if (command == DGUS_CMD_READVAR) {
 | 
			
		||||
          const uint16_t vp = tmp[0] << 8 | tmp[1];
 | 
			
		||||
          //const uint8_t dlen = tmp[2] << 1;  // Convert to Bytes. (Display works with words)
 | 
			
		||||
          //DEBUG_ECHOPAIR(" vp=", vp, " dlen=", dlen);
 | 
			
		||||
          //DEBUG_ECHOPGM(" vp=", vp, " dlen=", dlen);
 | 
			
		||||
          DGUS_VP_Variable ramcopy;
 | 
			
		||||
          if (populate_VPVar(vp, &ramcopy)) {
 | 
			
		||||
            if (ramcopy.set_by_display_handler)
 | 
			
		||||
@@ -215,7 +215,7 @@ void DGUSDisplay::ProcessRx() {
 | 
			
		||||
              DEBUG_ECHOLNPGM(" VPVar found, no handler.");
 | 
			
		||||
          }
 | 
			
		||||
          else
 | 
			
		||||
            DEBUG_ECHOLNPAIR(" VPVar not found:", vp);
 | 
			
		||||
            DEBUG_ECHOLNPGM(" VPVar not found:", vp);
 | 
			
		||||
 | 
			
		||||
          rx_datagram_state = DGUS_IDLE;
 | 
			
		||||
          break;
 | 
			
		||||
@@ -260,9 +260,9 @@ bool DGUSDisplay::no_reentrance = false;
 | 
			
		||||
#define sw_barrier() asm volatile("": : :"memory");
 | 
			
		||||
 | 
			
		||||
bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy) {
 | 
			
		||||
  // DEBUG_ECHOPAIR("populate_VPVar ", VP);
 | 
			
		||||
  // DEBUG_ECHOPGM("populate_VPVar ", VP);
 | 
			
		||||
  const DGUS_VP_Variable *pvp = DGUSLCD_FindVPVar(VP);
 | 
			
		||||
  // DEBUG_ECHOLNPAIR(" pvp ", (uint16_t )pvp);
 | 
			
		||||
  // DEBUG_ECHOLNPGM(" pvp ", (uint16_t )pvp);
 | 
			
		||||
  if (!pvp) return false;
 | 
			
		||||
  memcpy_P(ramcopy, pvp, sizeof(DGUS_VP_Variable));
 | 
			
		||||
  return true;
 | 
			
		||||
 
 | 
			
		||||
@@ -110,8 +110,8 @@ void DGUSScreenHandler::setstatusmessagePGM(PGM_P const msg) {
 | 
			
		||||
// Send an 8 bit or 16 bit value to the display.
 | 
			
		||||
void DGUSScreenHandler::DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var) {
 | 
			
		||||
  if (var.memadr) {
 | 
			
		||||
    //DEBUG_ECHOPAIR(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
 | 
			
		||||
    //DEBUG_ECHOLNPAIR(" data ", *(uint16_t *)var.memadr);
 | 
			
		||||
    //DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
 | 
			
		||||
    if (var.size > 1)
 | 
			
		||||
      dgusdisplay.WriteVariable(var.VP, *(int16_t*)var.memadr);
 | 
			
		||||
    else
 | 
			
		||||
@@ -122,8 +122,8 @@ void DGUSScreenHandler::DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var) {
 | 
			
		||||
// Send an uint8_t between 0 and 255 to the display, but scale to a percentage (0..100)
 | 
			
		||||
void DGUSScreenHandler::DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var) {
 | 
			
		||||
  if (var.memadr) {
 | 
			
		||||
    //DEBUG_ECHOPAIR(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
 | 
			
		||||
    //DEBUG_ECHOLNPAIR(" data ", *(uint16_t *)var.memadr);
 | 
			
		||||
    //DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
 | 
			
		||||
    uint16_t tmp = *(uint8_t *) var.memadr + 1; // +1 -> avoid rounding issues for the display.
 | 
			
		||||
    tmp = map(tmp, 0, 255, 0, 100);
 | 
			
		||||
    dgusdisplay.WriteVariable(var.VP, tmp);
 | 
			
		||||
@@ -132,9 +132,9 @@ void DGUSScreenHandler::DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var) {
 | 
			
		||||
 | 
			
		||||
// Send the current print progress to the display.
 | 
			
		||||
void DGUSScreenHandler::DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var) {
 | 
			
		||||
  //DEBUG_ECHOPAIR(" DGUSLCD_SendPrintProgressToDisplay ", var.VP);
 | 
			
		||||
  //DEBUG_ECHOPGM(" DGUSLCD_SendPrintProgressToDisplay ", var.VP);
 | 
			
		||||
  uint16_t tmp = ExtUI::getProgress_percent();
 | 
			
		||||
  //DEBUG_ECHOLNPAIR(" data ", tmp);
 | 
			
		||||
  //DEBUG_ECHOLNPGM(" data ", tmp);
 | 
			
		||||
  dgusdisplay.WriteVariable(var.VP, tmp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -151,9 +151,9 @@ void DGUSScreenHandler::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var) {
 | 
			
		||||
void DGUSScreenHandler::DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  if (var.memadr) {
 | 
			
		||||
    uint16_t value = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
    DEBUG_ECHOLNPAIR("FAN value get:", value);
 | 
			
		||||
    DEBUG_ECHOLNPGM("FAN value get:", value);
 | 
			
		||||
    *(uint8_t*)var.memadr = map(constrain(value, 0, 100), 0, 100, 0, 255);
 | 
			
		||||
    DEBUG_ECHOLNPAIR("FAN value change:", *(uint8_t*)var.memadr);
 | 
			
		||||
    DEBUG_ECHOLNPGM("FAN value change:", *(uint8_t*)var.memadr);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -234,8 +234,8 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) {
 | 
			
		||||
 | 
			
		||||
  void DGUSScreenHandler::DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var) {
 | 
			
		||||
    if (var.memadr) {
 | 
			
		||||
      DEBUG_ECHOPAIR(" DGUSLCD_SendFanStatusToDisplay ", var.VP);
 | 
			
		||||
      DEBUG_ECHOLNPAIR(" data ", *(uint8_t *)var.memadr);
 | 
			
		||||
      DEBUG_ECHOPGM(" DGUSLCD_SendFanStatusToDisplay ", var.VP);
 | 
			
		||||
      DEBUG_ECHOLNPGM(" data ", *(uint8_t *)var.memadr);
 | 
			
		||||
      uint16_t data_to_send = 0;
 | 
			
		||||
      if (*(uint8_t *) var.memadr) data_to_send = 1;
 | 
			
		||||
      dgusdisplay.WriteVariable(var.VP, data_to_send);
 | 
			
		||||
@@ -247,8 +247,8 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) {
 | 
			
		||||
// Send heater status value to the display.
 | 
			
		||||
void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) {
 | 
			
		||||
  if (var.memadr) {
 | 
			
		||||
    DEBUG_ECHOPAIR(" DGUSLCD_SendHeaterStatusToDisplay ", var.VP);
 | 
			
		||||
    DEBUG_ECHOLNPAIR(" data ", *(int16_t *)var.memadr);
 | 
			
		||||
    DEBUG_ECHOPGM(" DGUSLCD_SendHeaterStatusToDisplay ", var.VP);
 | 
			
		||||
    DEBUG_ECHOLNPGM(" data ", *(int16_t *)var.memadr);
 | 
			
		||||
    uint16_t data_to_send = 0;
 | 
			
		||||
    if (*(int16_t *) var.memadr) data_to_send = 1;
 | 
			
		||||
    dgusdisplay.WriteVariable(var.VP, data_to_send);
 | 
			
		||||
@@ -261,11 +261,11 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var)
 | 
			
		||||
    // In FYSETC UI design there are 10 statuses to loop
 | 
			
		||||
    static uint16_t period = 0;
 | 
			
		||||
    static uint16_t index = 0;
 | 
			
		||||
    //DEBUG_ECHOPAIR(" DGUSLCD_SendWaitingStatusToDisplay ", var.VP);
 | 
			
		||||
    //DEBUG_ECHOLNPAIR(" data ", swap16(index));
 | 
			
		||||
    //DEBUG_ECHOPGM(" DGUSLCD_SendWaitingStatusToDisplay ", var.VP);
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" data ", swap16(index));
 | 
			
		||||
    if (period++ > DGUS_UI_WAITING_STATUS_PERIOD) {
 | 
			
		||||
      dgusdisplay.WriteVariable(var.VP, index);
 | 
			
		||||
      //DEBUG_ECHOLNPAIR(" data ", swap16(index));
 | 
			
		||||
      //DEBUG_ECHOLNPGM(" data ", swap16(index));
 | 
			
		||||
      if (++index >= DGUS_UI_WAITING_STATUS) index = 0;
 | 
			
		||||
      period = 0;
 | 
			
		||||
    }
 | 
			
		||||
@@ -307,7 +307,7 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var)
 | 
			
		||||
    const int16_t scroll = (int16_t)swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
    if (scroll) {
 | 
			
		||||
      top_file += scroll;
 | 
			
		||||
      DEBUG_ECHOPAIR("new topfile calculated:", top_file);
 | 
			
		||||
      DEBUG_ECHOPGM("new topfile calculated:", top_file);
 | 
			
		||||
      if (top_file < 0) {
 | 
			
		||||
        top_file = 0;
 | 
			
		||||
        DEBUG_ECHOLNPGM("Top of filelist reached");
 | 
			
		||||
@@ -317,7 +317,7 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var)
 | 
			
		||||
        NOLESS(max_top, 0);
 | 
			
		||||
        NOMORE(top_file, max_top);
 | 
			
		||||
      }
 | 
			
		||||
      DEBUG_ECHOPAIR("new topfile adjusted:", top_file);
 | 
			
		||||
      DEBUG_ECHOPGM("new topfile adjusted:", top_file);
 | 
			
		||||
    }
 | 
			
		||||
    else if (!filelist.isAtRootDir()) {
 | 
			
		||||
      IF_DISABLED(DGUS_LCD_UI_MKS, filelist.upDir());
 | 
			
		||||
@@ -371,7 +371,7 @@ const DGUS_VP_Variable* DGUSLCD_FindVPVar(const uint16_t vp) {
 | 
			
		||||
    ++ret;
 | 
			
		||||
  } while (1);
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("FindVPVar NOT FOUND ", vp);
 | 
			
		||||
  DEBUG_ECHOLNPGM("FindVPVar NOT FOUND ", vp);
 | 
			
		||||
  return nullptr;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -476,7 +476,7 @@ void DGUSScreenHandler::HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_p
 | 
			
		||||
  const int16_t lock = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
  strcpy_P(buf, lock ? PSTR("M18") : PSTR("M17"));
 | 
			
		||||
 | 
			
		||||
  //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
  //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
  queue.enqueue_one_now(buf);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -499,7 +499,7 @@ void DGUSScreenHandler::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_
 | 
			
		||||
  DEBUG_ECHOLNPGM("HandleStepPerMMChanged");
 | 
			
		||||
 | 
			
		||||
  uint16_t value_raw = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPGM("value_raw:", value_raw);
 | 
			
		||||
  float value = (float)value_raw / 10;
 | 
			
		||||
  ExtUI::axis_t axis;
 | 
			
		||||
  switch (var.VP) {
 | 
			
		||||
@@ -519,7 +519,7 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo
 | 
			
		||||
  DEBUG_ECHOLNPGM("HandleStepPerMMExtruderChanged");
 | 
			
		||||
 | 
			
		||||
  uint16_t value_raw = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPGM("value_raw:", value_raw);
 | 
			
		||||
  float value = (float)value_raw / 10;
 | 
			
		||||
  ExtUI::extruder_t extruder;
 | 
			
		||||
  switch (var.VP) {
 | 
			
		||||
@@ -696,7 +696,7 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void DGUSScreenHandler::UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup) {
 | 
			
		||||
  DEBUG_ECHOLNPAIR("SetNewScreen: ", newscreen);
 | 
			
		||||
  DEBUG_ECHOLNPGM("SetNewScreen: ", newscreen);
 | 
			
		||||
  if (!popup) {
 | 
			
		||||
    memmove(&past_screens[1], &past_screens[0], sizeof(past_screens) - 1);
 | 
			
		||||
    past_screens[0] = current_screen;
 | 
			
		||||
@@ -707,18 +707,18 @@ void DGUSScreenHandler::UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DGUSScreenHandler::PopToOldScreen() {
 | 
			
		||||
  DEBUG_ECHOLNPAIR("PopToOldScreen s=", past_screens[0]);
 | 
			
		||||
  DEBUG_ECHOLNPGM("PopToOldScreen s=", past_screens[0]);
 | 
			
		||||
  GotoScreen(past_screens[0], true);
 | 
			
		||||
  memmove(&past_screens[0], &past_screens[1], sizeof(past_screens) - 1);
 | 
			
		||||
  past_screens[sizeof(past_screens) - 1] = DGUSLCD_SCREEN_MAIN;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DGUSScreenHandler::UpdateScreenVPData() {
 | 
			
		||||
  DEBUG_ECHOPAIR(" UpdateScreenVPData Screen: ", current_screen);
 | 
			
		||||
  DEBUG_ECHOPGM(" UpdateScreenVPData Screen: ", current_screen);
 | 
			
		||||
 | 
			
		||||
  const uint16_t *VPList = DGUSLCD_FindScreenVPMapList(current_screen);
 | 
			
		||||
  if (!VPList) {
 | 
			
		||||
    DEBUG_ECHOLNPAIR(" NO SCREEN FOR: ", current_screen);
 | 
			
		||||
    DEBUG_ECHOLNPGM(" NO SCREEN FOR: ", current_screen);
 | 
			
		||||
    ScreenComplete = true;
 | 
			
		||||
    return; // nothing to do, likely a bug or boring screen.
 | 
			
		||||
  }
 | 
			
		||||
@@ -729,7 +729,7 @@ void DGUSScreenHandler::UpdateScreenVPData() {
 | 
			
		||||
  bool sent_one = false;
 | 
			
		||||
  do {
 | 
			
		||||
    uint16_t VP = pgm_read_word(VPList);
 | 
			
		||||
    DEBUG_ECHOPAIR(" VP: ", VP);
 | 
			
		||||
    DEBUG_ECHOPGM(" VP: ", VP);
 | 
			
		||||
    if (!VP) {
 | 
			
		||||
      update_ptr = 0;
 | 
			
		||||
      DEBUG_ECHOLNPGM(" UpdateScreenVPData done");
 | 
			
		||||
@@ -745,14 +745,14 @@ void DGUSScreenHandler::UpdateScreenVPData() {
 | 
			
		||||
      // Send the VP to the display, but try to avoid overrunning the Tx Buffer.
 | 
			
		||||
      // But send at least one VP, to avoid getting stalled.
 | 
			
		||||
      if (rcpy.send_to_display_handler && (!sent_one || expected_tx <= dgusdisplay.GetFreeTxBuffer())) {
 | 
			
		||||
        //DEBUG_ECHOPAIR(" calling handler for ", rcpy.VP);
 | 
			
		||||
        //DEBUG_ECHOPGM(" calling handler for ", rcpy.VP);
 | 
			
		||||
        sent_one = true;
 | 
			
		||||
        rcpy.send_to_display_handler(rcpy);
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
        // auto x=dgusdisplay.GetFreeTxBuffer();
 | 
			
		||||
        //DEBUG_ECHOLNPAIR(" tx almost full: ", x);
 | 
			
		||||
        //DEBUG_ECHOPAIR(" update_ptr ", update_ptr);
 | 
			
		||||
        //DEBUG_ECHOLNPGM(" tx almost full: ", x);
 | 
			
		||||
        //DEBUG_ECHOPGM(" update_ptr ", update_ptr);
 | 
			
		||||
        ScreenComplete = false;
 | 
			
		||||
        return; // please call again!
 | 
			
		||||
      }
 | 
			
		||||
@@ -767,7 +767,7 @@ void DGUSScreenHandler::GotoScreen(DGUSLCD_Screens screen, bool ispopup) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DGUSDisplay::RequestScreen(DGUSLCD_Screens screen) {
 | 
			
		||||
  DEBUG_ECHOLNPAIR("GotoScreen ", screen);
 | 
			
		||||
  DEBUG_ECHOLNPGM("GotoScreen ", screen);
 | 
			
		||||
  const unsigned char gotoscreen[] = { 0x5A, 0x01, (unsigned char) (screen >> 8U), (unsigned char) (screen & 0xFFU) };
 | 
			
		||||
  WriteVariable(0x84, gotoscreen, sizeof(gotoscreen));
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -134,7 +134,7 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  // meaning "return to previous screen"
 | 
			
		||||
  DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("\n DEBUG target", target);
 | 
			
		||||
  DEBUG_ECHOLNPGM("\n DEBUG target", target);
 | 
			
		||||
 | 
			
		||||
  if (target == DGUSLCD_SCREEN_POPUP) {
 | 
			
		||||
    // Special handling for popup is to return to previous menu
 | 
			
		||||
@@ -146,7 +146,7 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  UpdateNewScreen(target);
 | 
			
		||||
 | 
			
		||||
  #ifdef DEBUG_DGUSLCD
 | 
			
		||||
    if (!DGUSLCD_FindScreenVPMapList(target)) DEBUG_ECHOLNPAIR("WARNING: No screen Mapping found for ", target);
 | 
			
		||||
    if (!DGUSLCD_FindScreenVPMapList(target)) DEBUG_ECHOLNPGM("WARNING: No screen Mapping found for ", target);
 | 
			
		||||
  #endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -190,10 +190,10 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
 | 
			
		||||
  if (!movevalue) {
 | 
			
		||||
    // homing
 | 
			
		||||
    DEBUG_ECHOPAIR(" homing ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
 | 
			
		||||
    char buf[6] = "G28 X";
 | 
			
		||||
    buf[4] = axiscode;
 | 
			
		||||
    //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
    //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
    queue.enqueue_one_now(buf);
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" ✓");
 | 
			
		||||
    ForceCompleteUpdate();
 | 
			
		||||
@@ -201,7 +201,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    // movement
 | 
			
		||||
    DEBUG_ECHOPAIR(" move ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
 | 
			
		||||
    bool old_relative_mode = relative_mode;
 | 
			
		||||
    if (!relative_mode) {
 | 
			
		||||
      //DEBUG_ECHOPGM(" G91");
 | 
			
		||||
@@ -215,13 +215,13 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
    if (movevalue < 0) { value = -value; sign[0] = '-'; }
 | 
			
		||||
    int16_t fraction = ABS(movevalue) % 100;
 | 
			
		||||
    snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
 | 
			
		||||
    //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
    //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
    queue.enqueue_one_now(buf);
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" ✓ ");
 | 
			
		||||
    if (backup_speed != speed) {
 | 
			
		||||
      snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
 | 
			
		||||
      queue.enqueue_one_now(buf);
 | 
			
		||||
      //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
      //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
    }
 | 
			
		||||
    // while (!enqueue_and_echo_command(buf)) idle();
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" ✓ ");
 | 
			
		||||
@@ -237,16 +237,16 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  return;
 | 
			
		||||
 | 
			
		||||
  cannotmove:
 | 
			
		||||
    DEBUG_ECHOLNPAIR(" cannot move ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
 | 
			
		||||
    return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if HAS_PID_HEATING
 | 
			
		||||
  void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
    uint16_t rawvalue = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
    DEBUG_ECHOLNPAIR("V1:", rawvalue);
 | 
			
		||||
    DEBUG_ECHOLNPGM("V1:", rawvalue);
 | 
			
		||||
    float value = (float)rawvalue / 10;
 | 
			
		||||
    DEBUG_ECHOLNPAIR("V2:", value);
 | 
			
		||||
    DEBUG_ECHOLNPGM("V2:", value);
 | 
			
		||||
    float newvalue = 0;
 | 
			
		||||
 | 
			
		||||
    switch (var.VP) {
 | 
			
		||||
 
 | 
			
		||||
@@ -134,7 +134,7 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  // meaning "return to previous screen"
 | 
			
		||||
  DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("\n DEBUG target", target);
 | 
			
		||||
  DEBUG_ECHOLNPGM("\n DEBUG target", target);
 | 
			
		||||
 | 
			
		||||
  if (target == DGUSLCD_SCREEN_POPUP) {
 | 
			
		||||
    // Special handling for popup is to return to previous menu
 | 
			
		||||
@@ -146,7 +146,7 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  UpdateNewScreen(target);
 | 
			
		||||
 | 
			
		||||
  #ifdef DEBUG_DGUSLCD
 | 
			
		||||
    if (!DGUSLCD_FindScreenVPMapList(target)) DEBUG_ECHOLNPAIR("WARNING: No screen Mapping found for ", target);
 | 
			
		||||
    if (!DGUSLCD_FindScreenVPMapList(target)) DEBUG_ECHOLNPGM("WARNING: No screen Mapping found for ", target);
 | 
			
		||||
  #endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -190,10 +190,10 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
 | 
			
		||||
  if (!movevalue) {
 | 
			
		||||
    // homing
 | 
			
		||||
    DEBUG_ECHOPAIR(" homing ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
 | 
			
		||||
    char buf[6] = "G28 X";
 | 
			
		||||
    buf[4] = axiscode;
 | 
			
		||||
    //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
    //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
    queue.enqueue_one_now(buf);
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" ✓");
 | 
			
		||||
    ForceCompleteUpdate();
 | 
			
		||||
@@ -201,7 +201,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    // movement
 | 
			
		||||
    DEBUG_ECHOPAIR(" move ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
 | 
			
		||||
    bool old_relative_mode = relative_mode;
 | 
			
		||||
    if (!relative_mode) {
 | 
			
		||||
      //DEBUG_ECHOPGM(" G91");
 | 
			
		||||
@@ -215,13 +215,13 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
    if (movevalue < 0) { value = -value; sign[0] = '-'; }
 | 
			
		||||
    int16_t fraction = ABS(movevalue) % 100;
 | 
			
		||||
    snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
 | 
			
		||||
    //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
    //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
    queue.enqueue_one_now(buf);
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" ✓ ");
 | 
			
		||||
    if (backup_speed != speed) {
 | 
			
		||||
      snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
 | 
			
		||||
      queue.enqueue_one_now(buf);
 | 
			
		||||
      //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
      //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
    }
 | 
			
		||||
    // while (!enqueue_and_echo_command(buf)) idle();
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" ✓ ");
 | 
			
		||||
@@ -237,16 +237,16 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  return;
 | 
			
		||||
 | 
			
		||||
  cannotmove:
 | 
			
		||||
    DEBUG_ECHOLNPAIR(" cannot move ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
 | 
			
		||||
    return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if HAS_PID_HEATING
 | 
			
		||||
  void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
    uint16_t rawvalue = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
    DEBUG_ECHOLNPAIR("V1:", rawvalue);
 | 
			
		||||
    DEBUG_ECHOLNPGM("V1:", rawvalue);
 | 
			
		||||
    float value = (float)rawvalue / 10;
 | 
			
		||||
    DEBUG_ECHOLNPAIR("V2:", value);
 | 
			
		||||
    DEBUG_ECHOLNPGM("V2:", value);
 | 
			
		||||
    float newvalue = 0;
 | 
			
		||||
 | 
			
		||||
    switch (var.VP) {
 | 
			
		||||
 
 | 
			
		||||
@@ -83,8 +83,8 @@ void DGUSScreenHandler::sendinfoscreen_mks(const void *line1, const void *line2,
 | 
			
		||||
 | 
			
		||||
void DGUSScreenHandler::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) {
 | 
			
		||||
  if (var.memadr) {
 | 
			
		||||
    //DEBUG_ECHOPAIR(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
 | 
			
		||||
    //DEBUG_ECHOLNPAIR(" data ", *(uint16_t *)var.memadr);
 | 
			
		||||
    //DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
 | 
			
		||||
    uint16_t tmp = *(uint8_t *) var.memadr; // +1 -> avoid rounding issues for the display.
 | 
			
		||||
    // tmp = map(tmp, 0, 255, 0, 100);
 | 
			
		||||
    dgusdisplay.WriteVariable(var.VP, tmp);
 | 
			
		||||
@@ -109,14 +109,14 @@ void DGUSScreenHandler::DGUSLCD_SendPrintTimeToDisplay_MKS(DGUS_VP_Variable &var
 | 
			
		||||
void DGUSScreenHandler::DGUSLCD_SetUint8(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  if (var.memadr) {
 | 
			
		||||
    const uint16_t value = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
    DEBUG_ECHOLNPAIR("FAN value get:", value);
 | 
			
		||||
    DEBUG_ECHOLNPGM("FAN value get:", value);
 | 
			
		||||
    *(uint8_t*)var.memadr = map(constrain(value, 0, 255), 0, 255, 0, 255);
 | 
			
		||||
    DEBUG_ECHOLNPAIR("FAN value change:", *(uint8_t*)var.memadr);
 | 
			
		||||
    DEBUG_ECHOLNPGM("FAN value change:", *(uint8_t*)var.memadr);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DGUSScreenHandler::DGUSLCD_SendGbkToDisplay(DGUS_VP_Variable &var) {
 | 
			
		||||
  DEBUG_ECHOLNPAIR(" data ", *(uint16_t *)var.memadr);
 | 
			
		||||
  DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
 | 
			
		||||
  uint16_t *tmp = (uint16_t*) var.memadr;
 | 
			
		||||
  dgusdisplay.WriteVariable(var.VP, tmp, var.size, true);
 | 
			
		||||
}
 | 
			
		||||
@@ -282,7 +282,7 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  // meaning "return to previous screen"
 | 
			
		||||
  DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("\n DEBUG target", target);
 | 
			
		||||
  DEBUG_ECHOLNPGM("\n DEBUG target", target);
 | 
			
		||||
 | 
			
		||||
  // when the dgus had reboot, it will enter the DGUSLCD_SCREEN_MAIN page,
 | 
			
		||||
  // so user can change any page to use this function, an it will check
 | 
			
		||||
@@ -311,13 +311,13 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  UpdateNewScreen(target);
 | 
			
		||||
 | 
			
		||||
  #ifdef DEBUG_DGUSLCD
 | 
			
		||||
    if (!DGUSLCD_FindScreenVPMapList(target)) DEBUG_ECHOLNPAIR("WARNING: No screen Mapping found for ", target);
 | 
			
		||||
    if (!DGUSLCD_FindScreenVPMapList(target)) DEBUG_ECHOLNPGM("WARNING: No screen Mapping found for ", target);
 | 
			
		||||
  #endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DGUSScreenHandler::ScreenBackChange(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  const uint16_t target = swap16(*(uint16_t *)val_ptr);
 | 
			
		||||
  DEBUG_ECHOLNPAIR(" back = 0x%x", target);
 | 
			
		||||
  DEBUG_ECHOLNPGM(" back = 0x%x", target);
 | 
			
		||||
  switch (target) {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@@ -756,7 +756,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  else if (manualMoveStep == 0x02) manualMoveStep =  100;
 | 
			
		||||
  else if (manualMoveStep == 0x03) manualMoveStep = 1000;
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("QUEUE LEN:", queue.length);
 | 
			
		||||
  DEBUG_ECHOLNPGM("QUEUE LEN:", queue.length);
 | 
			
		||||
 | 
			
		||||
  if (!print_job_timer.isPaused() && !queue.ring_buffer.empty())
 | 
			
		||||
    return;
 | 
			
		||||
@@ -818,7 +818,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
      break;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOPAIR("movevalue = ", movevalue);
 | 
			
		||||
  DEBUG_ECHOPGM("movevalue = ", movevalue);
 | 
			
		||||
  if (movevalue != 0 && movevalue != 5) { // get move distance
 | 
			
		||||
    switch (movevalue) {
 | 
			
		||||
      case 0x0001: movevalue =  manualMoveStep; break;
 | 
			
		||||
@@ -829,20 +829,20 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
 | 
			
		||||
  if (!movevalue) {
 | 
			
		||||
    // homing
 | 
			
		||||
    DEBUG_ECHOPAIR(" homing ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
 | 
			
		||||
    // char buf[6] = "G28 X";
 | 
			
		||||
    // buf[4] = axiscode;
 | 
			
		||||
 | 
			
		||||
    char buf[6];
 | 
			
		||||
    sprintf(buf, "G28 %c", axiscode);
 | 
			
		||||
    //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
    //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
    queue.enqueue_one_now(buf);
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" ✓");
 | 
			
		||||
    ForceCompleteUpdate();
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
  else if (movevalue == 5) {
 | 
			
		||||
    DEBUG_ECHOPAIR("send M84");
 | 
			
		||||
    DEBUG_ECHOPGM("send M84");
 | 
			
		||||
    char buf[6];
 | 
			
		||||
    snprintf_P(buf,6,PSTR("M84 %c"), axiscode);
 | 
			
		||||
    queue.enqueue_one_now(buf);
 | 
			
		||||
@@ -851,7 +851,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    // movement
 | 
			
		||||
    DEBUG_ECHOPAIR(" move ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
 | 
			
		||||
    bool old_relative_mode = relative_mode;
 | 
			
		||||
 | 
			
		||||
    if (!relative_mode) {
 | 
			
		||||
@@ -871,7 +871,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
    //if (backup_speed != speed) {
 | 
			
		||||
    //  snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
 | 
			
		||||
    //  queue.enqueue_one_now(buf);
 | 
			
		||||
    //  //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
    //  //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
    //}
 | 
			
		||||
 | 
			
		||||
    //while (!enqueue_and_echo_command(buf)) idle();
 | 
			
		||||
@@ -889,7 +889,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  return;
 | 
			
		||||
 | 
			
		||||
  cannotmove:
 | 
			
		||||
    DEBUG_ECHOLNPAIR(" cannot move ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
 | 
			
		||||
    return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -923,7 +923,7 @@ void DGUSScreenHandler::HandleStepPerMMChanged_MKS(DGUS_VP_Variable &var, void *
 | 
			
		||||
  const uint16_t value_raw = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
  const float value = (float)value_raw;
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPGM("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPAIR_F("value:", value);
 | 
			
		||||
 | 
			
		||||
  ExtUI::axis_t axis;
 | 
			
		||||
@@ -945,7 +945,7 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged_MKS(DGUS_VP_Variable &var
 | 
			
		||||
  const uint16_t value_raw = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
  const float value = (float)value_raw;
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPGM("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPAIR_F("value:", value);
 | 
			
		||||
 | 
			
		||||
  ExtUI::extruder_t extruder;
 | 
			
		||||
@@ -970,7 +970,7 @@ void DGUSScreenHandler::HandleMaxSpeedChange_MKS(DGUS_VP_Variable &var, void *va
 | 
			
		||||
  const uint16_t value_raw = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
  const float value = (float)value_raw;
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPGM("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPAIR_F("value:", value);
 | 
			
		||||
 | 
			
		||||
  ExtUI::axis_t axis;
 | 
			
		||||
@@ -992,7 +992,7 @@ void DGUSScreenHandler::HandleExtruderMaxSpeedChange_MKS(DGUS_VP_Variable &var,
 | 
			
		||||
  const uint16_t value_raw = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
  const float value = (float)value_raw;
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPGM("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPAIR_F("value:", value);
 | 
			
		||||
 | 
			
		||||
  ExtUI::extruder_t extruder;
 | 
			
		||||
@@ -1017,7 +1017,7 @@ void DGUSScreenHandler::HandleMaxAccChange_MKS(DGUS_VP_Variable &var, void *val_
 | 
			
		||||
  const uint16_t value_raw = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
  const float value = (float)value_raw;
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPGM("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPAIR_F("value:", value);
 | 
			
		||||
 | 
			
		||||
  ExtUI::axis_t axis;
 | 
			
		||||
@@ -1037,7 +1037,7 @@ void DGUSScreenHandler::HandleExtruderAccChange_MKS(DGUS_VP_Variable &var, void
 | 
			
		||||
  DEBUG_ECHOLNPGM("HandleExtruderAccChange_MKS");
 | 
			
		||||
 | 
			
		||||
  uint16_t value_raw = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("value_raw:", value_raw);
 | 
			
		||||
  DEBUG_ECHOLNPGM("value_raw:", value_raw);
 | 
			
		||||
  float value = (float)value_raw;
 | 
			
		||||
  ExtUI::extruder_t extruder;
 | 
			
		||||
  switch (var.VP) {
 | 
			
		||||
@@ -1091,9 +1091,9 @@ void DGUSScreenHandler::HandleAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr
 | 
			
		||||
#if HAS_PID_HEATING
 | 
			
		||||
  void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
    const uint16_t rawvalue = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
    DEBUG_ECHOLNPAIR("V1:", rawvalue);
 | 
			
		||||
    DEBUG_ECHOLNPGM("V1:", rawvalue);
 | 
			
		||||
    const float value = 1.0f * rawvalue;
 | 
			
		||||
    DEBUG_ECHOLNPAIR("V2:", value);
 | 
			
		||||
    DEBUG_ECHOLNPGM("V2:", value);
 | 
			
		||||
    float newvalue = 0;
 | 
			
		||||
 | 
			
		||||
    switch (var.VP) {
 | 
			
		||||
 
 | 
			
		||||
@@ -134,7 +134,7 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  // meaning "return to previous screen"
 | 
			
		||||
  DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("\n DEBUG target", target);
 | 
			
		||||
  DEBUG_ECHOLNPGM("\n DEBUG target", target);
 | 
			
		||||
 | 
			
		||||
  if (target == DGUSLCD_SCREEN_POPUP) {
 | 
			
		||||
    // Special handling for popup is to return to previous menu
 | 
			
		||||
@@ -146,7 +146,7 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  UpdateNewScreen(target);
 | 
			
		||||
 | 
			
		||||
  #ifdef DEBUG_DGUSLCD
 | 
			
		||||
    if (!DGUSLCD_FindScreenVPMapList(target)) DEBUG_ECHOLNPAIR("WARNING: No screen Mapping found for ", target);
 | 
			
		||||
    if (!DGUSLCD_FindScreenVPMapList(target)) DEBUG_ECHOLNPGM("WARNING: No screen Mapping found for ", target);
 | 
			
		||||
  #endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -190,10 +190,10 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
 | 
			
		||||
  if (!movevalue) {
 | 
			
		||||
    // homing
 | 
			
		||||
    DEBUG_ECHOPAIR(" homing ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
 | 
			
		||||
    char buf[6] = "G28 X";
 | 
			
		||||
    buf[4] = axiscode;
 | 
			
		||||
    //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
    //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
    queue.enqueue_one_now(buf);
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" ✓");
 | 
			
		||||
    ForceCompleteUpdate();
 | 
			
		||||
@@ -201,7 +201,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    // movement
 | 
			
		||||
    DEBUG_ECHOPAIR(" move ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
 | 
			
		||||
    bool old_relative_mode = relative_mode;
 | 
			
		||||
    if (!relative_mode) {
 | 
			
		||||
      //DEBUG_ECHOPGM(" G91");
 | 
			
		||||
@@ -215,13 +215,13 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
    if (movevalue < 0) { value = -value; sign[0] = '-'; }
 | 
			
		||||
    int16_t fraction = ABS(movevalue) % 100;
 | 
			
		||||
    snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
 | 
			
		||||
    //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
    //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
    queue.enqueue_one_now(buf);
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" ✓ ");
 | 
			
		||||
    if (backup_speed != speed) {
 | 
			
		||||
      snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
 | 
			
		||||
      queue.enqueue_one_now(buf);
 | 
			
		||||
      //DEBUG_ECHOPAIR(" ", buf);
 | 
			
		||||
      //DEBUG_ECHOPGM(" ", buf);
 | 
			
		||||
    }
 | 
			
		||||
    // while (!enqueue_and_echo_command(buf)) idle();
 | 
			
		||||
    //DEBUG_ECHOLNPGM(" ✓ ");
 | 
			
		||||
@@ -237,16 +237,16 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
  return;
 | 
			
		||||
 | 
			
		||||
  cannotmove:
 | 
			
		||||
    DEBUG_ECHOLNPAIR(" cannot move ", AS_CHAR(axiscode));
 | 
			
		||||
    DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
 | 
			
		||||
    return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if HAS_PID_HEATING
 | 
			
		||||
  void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
 | 
			
		||||
    uint16_t rawvalue = swap16(*(uint16_t*)val_ptr);
 | 
			
		||||
    DEBUG_ECHOLNPAIR("V1:", rawvalue);
 | 
			
		||||
    DEBUG_ECHOLNPGM("V1:", rawvalue);
 | 
			
		||||
    float value = (float)rawvalue / 10;
 | 
			
		||||
    DEBUG_ECHOLNPAIR("V2:", value);
 | 
			
		||||
    DEBUG_ECHOLNPGM("V2:", value);
 | 
			
		||||
    float newvalue = 0;
 | 
			
		||||
 | 
			
		||||
    switch (var.VP) {
 | 
			
		||||
 
 | 
			
		||||
@@ -159,7 +159,7 @@ void DGUSDisplay::WriteStringPGM(uint16_t addr, const void* data_ptr, uint8_t si
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DGUSDisplay::SwitchScreen(DGUS_Screen screen) {
 | 
			
		||||
  DEBUG_ECHOLNPAIR("SwitchScreen ", (uint8_t)screen);
 | 
			
		||||
  DEBUG_ECHOLNPGM("SwitchScreen ", (uint8_t)screen);
 | 
			
		||||
  const uint8_t command[] = { 0x5A, 0x01, 0x00, (uint8_t)screen };
 | 
			
		||||
  Write(0x84, command, sizeof(command));
 | 
			
		||||
}
 | 
			
		||||
@@ -167,13 +167,13 @@ void DGUSDisplay::SwitchScreen(DGUS_Screen screen) {
 | 
			
		||||
void DGUSDisplay::PlaySound(uint8_t start, uint8_t len, uint8_t volume) {
 | 
			
		||||
  if (volume == 0) volume = DGUSDisplay::volume;
 | 
			
		||||
  if (volume == 0) return;
 | 
			
		||||
  DEBUG_ECHOLNPAIR("PlaySound ", start, ":", len, "\nVolume ", volume);
 | 
			
		||||
  DEBUG_ECHOLNPGM("PlaySound ", start, ":", len, "\nVolume ", volume);
 | 
			
		||||
  const uint8_t command[] = { start, len, volume, 0x00 };
 | 
			
		||||
  Write(0xA0, command, sizeof(command));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DGUSDisplay::EnableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_Control control) {
 | 
			
		||||
  DEBUG_ECHOLNPAIR("EnableControl ", (uint8_t)control, "\nScreen ", (uint8_t)screen, "\nType ", (uint8_t)type);
 | 
			
		||||
  DEBUG_ECHOLNPGM("EnableControl ", (uint8_t)control, "\nScreen ", (uint8_t)screen, "\nType ", (uint8_t)type);
 | 
			
		||||
 | 
			
		||||
  const uint8_t command[] = { 0x5A, 0xA5, 0x00, (uint8_t)screen, (uint8_t)control, type, 0x00, 0x01 };
 | 
			
		||||
  Write(0xB0, command, sizeof(command));
 | 
			
		||||
@@ -183,7 +183,7 @@ void DGUSDisplay::EnableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DGUSDisplay::DisableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_Control control) {
 | 
			
		||||
  DEBUG_ECHOLNPAIR("DisableControl ", (uint8_t)control, "\nScreen ", (uint8_t)screen, "\nType ", (uint8_t)type);
 | 
			
		||||
  DEBUG_ECHOLNPGM("DisableControl ", (uint8_t)control, "\nScreen ", (uint8_t)screen, "\nType ", (uint8_t)type);
 | 
			
		||||
 | 
			
		||||
  const uint8_t command[] = { 0x5A, 0xA5, 0x00, (uint8_t)screen, (uint8_t)control, type, 0x00, 0x00 };
 | 
			
		||||
  Write(0xB0, command, sizeof(command));
 | 
			
		||||
@@ -203,14 +203,14 @@ uint8_t DGUSDisplay::GetVolume() {
 | 
			
		||||
void DGUSDisplay::SetBrightness(uint8_t new_brightness) {
 | 
			
		||||
  brightness = constrain(new_brightness, 0, 100);
 | 
			
		||||
  new_brightness = map_precise(brightness, 0, 100, 5, 100);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("SetBrightness ", new_brightness);
 | 
			
		||||
  DEBUG_ECHOLNPGM("SetBrightness ", new_brightness);
 | 
			
		||||
  const uint8_t command[] = { new_brightness, new_brightness };
 | 
			
		||||
  Write(0x82, command, sizeof(command));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DGUSDisplay::SetVolume(uint8_t new_volume) {
 | 
			
		||||
  volume = map_precise(constrain(new_volume, 0, 100), 0, 100, 0, 255);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("SetVolume ", volume);
 | 
			
		||||
  DEBUG_ECHOLNPGM("SetVolume ", volume);
 | 
			
		||||
  const uint8_t command[] = { volume, 0x00 };
 | 
			
		||||
  Write(0xA1, command, sizeof(command));
 | 
			
		||||
}
 | 
			
		||||
@@ -234,19 +234,19 @@ void DGUSDisplay::ProcessRx() {
 | 
			
		||||
 | 
			
		||||
      case DGUS_IDLE: // Waiting for the first header byte
 | 
			
		||||
        receivedbyte = LCD_SERIAL.read();
 | 
			
		||||
        DEBUG_ECHOPAIR("< ", receivedbyte);
 | 
			
		||||
        DEBUG_ECHOPGM("< ", receivedbyte);
 | 
			
		||||
        if (DGUS_HEADER1 == receivedbyte) rx_datagram_state = DGUS_HEADER1_SEEN;
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
      case DGUS_HEADER1_SEEN: // Waiting for the second header byte
 | 
			
		||||
        receivedbyte = LCD_SERIAL.read();
 | 
			
		||||
        DEBUG_ECHOPAIR(" ", receivedbyte);
 | 
			
		||||
        DEBUG_ECHOPGM(" ", receivedbyte);
 | 
			
		||||
        rx_datagram_state = (DGUS_HEADER2 == receivedbyte) ? DGUS_HEADER2_SEEN : DGUS_IDLE;
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
      case DGUS_HEADER2_SEEN: // Waiting for the length byte
 | 
			
		||||
        rx_datagram_len = LCD_SERIAL.read();
 | 
			
		||||
        DEBUG_ECHOPAIR(" (", rx_datagram_len, ") ");
 | 
			
		||||
        DEBUG_ECHOPGM(" (", rx_datagram_len, ") ");
 | 
			
		||||
 | 
			
		||||
        // Telegram min len is 3 (command and one word of payload)
 | 
			
		||||
        rx_datagram_state = WITHIN(rx_datagram_len, 3, DGUS_RX_BUFFER_SIZE) ? DGUS_WAIT_TELEGRAM : DGUS_IDLE;
 | 
			
		||||
@@ -258,7 +258,7 @@ void DGUSDisplay::ProcessRx() {
 | 
			
		||||
        initialized = true; // We've talked to it, so we defined it as initialized.
 | 
			
		||||
        uint8_t command = LCD_SERIAL.read();
 | 
			
		||||
 | 
			
		||||
        DEBUG_ECHOPAIR("# ", command);
 | 
			
		||||
        DEBUG_ECHOPGM("# ", command);
 | 
			
		||||
 | 
			
		||||
        uint8_t readlen = rx_datagram_len - 1;  // command is part of len.
 | 
			
		||||
        unsigned char tmp[rx_datagram_len - 1];
 | 
			
		||||
@@ -266,7 +266,7 @@ void DGUSDisplay::ProcessRx() {
 | 
			
		||||
 | 
			
		||||
        while (readlen--) {
 | 
			
		||||
          receivedbyte = LCD_SERIAL.read();
 | 
			
		||||
          DEBUG_ECHOPAIR(" ", receivedbyte);
 | 
			
		||||
          DEBUG_ECHOPGM(" ", receivedbyte);
 | 
			
		||||
          *ptmp++ = receivedbyte;
 | 
			
		||||
        }
 | 
			
		||||
        DEBUG_ECHOPGM(" # ");
 | 
			
		||||
@@ -287,7 +287,7 @@ void DGUSDisplay::ProcessRx() {
 | 
			
		||||
        if (command == DGUS_READVAR) {
 | 
			
		||||
          const uint16_t addr = tmp[0] << 8 | tmp[1];
 | 
			
		||||
          const uint8_t dlen = tmp[2] << 1;  // Convert to Bytes. (Display works with words)
 | 
			
		||||
          DEBUG_ECHOPAIR("addr=", addr, " dlen=", dlen, "> ");
 | 
			
		||||
          DEBUG_ECHOPGM("addr=", addr, " dlen=", dlen, "> ");
 | 
			
		||||
 | 
			
		||||
          if (addr == DGUS_VERSION && dlen == 2) {
 | 
			
		||||
            DEBUG_ECHOLNPGM("VERSIONS");
 | 
			
		||||
@@ -400,7 +400,7 @@ bool DGUS_PopulateVP(const DGUS_Addr addr, DGUS_VP * const buffer) {
 | 
			
		||||
      return true;
 | 
			
		||||
    }
 | 
			
		||||
  } while (++ret);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("VP not found: ", (uint16_t)addr);
 | 
			
		||||
  DEBUG_ECHOLNPGM("VP not found: ", (uint16_t)addr);
 | 
			
		||||
  return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -178,9 +178,9 @@ bool UIFlashStorage::is_present = false;
 | 
			
		||||
 | 
			
		||||
    if (!is_known) {
 | 
			
		||||
      SERIAL_ECHO_MSG("Unable to locate supported SPI Flash Memory.");
 | 
			
		||||
      SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("  Manufacturer ID, got: ", manufacturer_id);
 | 
			
		||||
      SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("  Device Type    , got: ", device_type);
 | 
			
		||||
      SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("  Capacity       , got: ", capacity);
 | 
			
		||||
      SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("  Manufacturer ID, got: ", manufacturer_id);
 | 
			
		||||
      SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("  Device Type    , got: ", device_type);
 | 
			
		||||
      SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("  Capacity       , got: ", capacity);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return is_known;
 | 
			
		||||
@@ -247,7 +247,7 @@ bool UIFlashStorage::is_present = false;
 | 
			
		||||
        case 0xFFFFFFFFul: return read_offset;
 | 
			
		||||
        case delimiter:    read_offset = offset; break;
 | 
			
		||||
        default:
 | 
			
		||||
          SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Invalid delimiter in Flash: ", delim);
 | 
			
		||||
          SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Invalid delimiter in Flash: ", delim);
 | 
			
		||||
          return -1;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
@@ -325,7 +325,7 @@ bool UIFlashStorage::is_present = false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    SERIAL_ECHO_START();
 | 
			
		||||
    SERIAL_ECHOPAIR("Writing UI settings to SPI Flash (offset ", write_addr);
 | 
			
		||||
    SERIAL_ECHOPGM("Writing UI settings to SPI Flash (offset ", write_addr);
 | 
			
		||||
    SERIAL_ECHOPGM(")...");
 | 
			
		||||
 | 
			
		||||
    const uint32_t delim = delimiter;
 | 
			
		||||
@@ -509,7 +509,7 @@ bool UIFlashStorage::is_present = false;
 | 
			
		||||
 | 
			
		||||
    bytes_remaining = get_media_file_size(slot);
 | 
			
		||||
    if (bytes_remaining != 0xFFFFFFFFUL) {
 | 
			
		||||
      SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Boot media file size:", bytes_remaining);
 | 
			
		||||
      SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Boot media file size:", bytes_remaining);
 | 
			
		||||
      addr = get_media_file_start(slot);
 | 
			
		||||
      return true;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -131,7 +131,7 @@ namespace ExtUI {
 | 
			
		||||
  #if HAS_PID_HEATING
 | 
			
		||||
    void onPidTuning(const result_t rst) {
 | 
			
		||||
      // Called for temperature PID tuning result
 | 
			
		||||
      //SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
 | 
			
		||||
      //SERIAL_ECHOLNPGM("OnPidTuning:", rst);
 | 
			
		||||
      switch (rst) {
 | 
			
		||||
        case PID_STARTED:
 | 
			
		||||
          StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE));
 | 
			
		||||
 
 | 
			
		||||
@@ -1025,8 +1025,8 @@ template <class T> bool CLCD::CommandFifo::write(T data, uint16_t len) {
 | 
			
		||||
  if (Command_Space < (len + padding)) {
 | 
			
		||||
    #if ENABLED(TOUCH_UI_DEBUG)
 | 
			
		||||
      SERIAL_ECHO_START();
 | 
			
		||||
      SERIAL_ECHOPAIR("Waiting for ", len + padding);
 | 
			
		||||
      SERIAL_ECHOLNPAIR(" bytes in command queue, now free: ", Command_Space);
 | 
			
		||||
      SERIAL_ECHOPGM("Waiting for ", len + padding);
 | 
			
		||||
      SERIAL_ECHOLNPGM(" bytes in command queue, now free: ", Command_Space);
 | 
			
		||||
    #endif
 | 
			
		||||
    do {
 | 
			
		||||
      Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF;
 | 
			
		||||
 
 | 
			
		||||
@@ -199,7 +199,7 @@
 | 
			
		||||
  #define _NUM_ARGS(_,Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,OUT,...) OUT
 | 
			
		||||
  #define NUM_ARGS(V...) _NUM_ARGS(0,V,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
 | 
			
		||||
 | 
			
		||||
  // SERIAL_ECHOPAIR / SERIAL_ECHOPAIR_P is used to output a key value pair. The key must be a string and the value can be anything
 | 
			
		||||
  // SERIAL_ECHOPGM / SERIAL_ECHOPGM_P is used to output a key value pair. The key must be a string and the value can be anything
 | 
			
		||||
  // Print up to 12 pairs of values. Odd elements auto-wrapped in PSTR().
 | 
			
		||||
  #define __SEP_N(N,V...)   _SEP_##N(V)
 | 
			
		||||
  #define _SEP_N(N,V...)    __SEP_N(N,V)
 | 
			
		||||
@@ -218,9 +218,9 @@
 | 
			
		||||
  #define SERIAL_ECHO_START()
 | 
			
		||||
  #define SERIAL_ECHOLNPGM(str)       Serial.println(F(str))
 | 
			
		||||
  #define SERIAL_ECHOPGM(str)         Serial.print(F(str))
 | 
			
		||||
  #define SERIAL_ECHO_MSG(V...)       SERIAL_ECHOLNPAIR(V)
 | 
			
		||||
  #define SERIAL_ECHOLNPAIR(V...)     _SELP_N(NUM_ARGS(V),V)
 | 
			
		||||
  #define SERIAL_ECHOPAIR(str, val)   do{ Serial.print(F(str)); Serial.print(val); }while(0)
 | 
			
		||||
  #define SERIAL_ECHO_MSG(V...)       SERIAL_ECHOLNPGM(V)
 | 
			
		||||
  #define SERIAL_ECHOLNPGM(V...)     _SELP_N(NUM_ARGS(V),V)
 | 
			
		||||
  #define SERIAL_ECHOPGM(str, val)   do{ Serial.print(F(str)); Serial.print(val); }while(0)
 | 
			
		||||
 | 
			
		||||
  #define safe_delay delay
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -132,8 +132,8 @@ bool DLCache::store(uint32_t min_bytes /* = 0*/) {
 | 
			
		||||
    // Not enough memory to cache the display list.
 | 
			
		||||
    #if ENABLED(TOUCH_UI_DEBUG)
 | 
			
		||||
      SERIAL_ECHO_START();
 | 
			
		||||
      SERIAL_ECHOPAIR  ("Not enough space in GRAM to cache display list, free space: ", dl_slot_size);
 | 
			
		||||
      SERIAL_ECHOLNPAIR(" Required: ", dl_size);
 | 
			
		||||
      SERIAL_ECHOPGM  ("Not enough space in GRAM to cache display list, free space: ", dl_slot_size);
 | 
			
		||||
      SERIAL_ECHOLNPGM(" Required: ", dl_size);
 | 
			
		||||
    #endif
 | 
			
		||||
    dl_slot_used = 0;
 | 
			
		||||
    save_slot();
 | 
			
		||||
@@ -142,8 +142,8 @@ bool DLCache::store(uint32_t min_bytes /* = 0*/) {
 | 
			
		||||
  else {
 | 
			
		||||
    #if ENABLED(TOUCH_UI_DEBUG)
 | 
			
		||||
      SERIAL_ECHO_START();
 | 
			
		||||
      SERIAL_ECHOPAIR  ("Saving DL to RAMG cache, bytes: ", dl_slot_used);
 | 
			
		||||
      SERIAL_ECHOLNPAIR(" Free space: ", dl_slot_size);
 | 
			
		||||
      SERIAL_ECHOPGM  ("Saving DL to RAMG cache, bytes: ", dl_slot_used);
 | 
			
		||||
      SERIAL_ECHOLNPGM(" Free space: ", dl_slot_size);
 | 
			
		||||
    #endif
 | 
			
		||||
    dl_slot_used = dl_size;
 | 
			
		||||
    save_slot();
 | 
			
		||||
@@ -172,8 +172,8 @@ void DLCache::append() {
 | 
			
		||||
    cmd.execute();
 | 
			
		||||
    wait_until_idle();
 | 
			
		||||
    SERIAL_ECHO_START();
 | 
			
		||||
    SERIAL_ECHOPAIR  ("Appending to DL from RAMG cache, bytes: ", dl_slot_used);
 | 
			
		||||
    SERIAL_ECHOLNPAIR(" REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL));
 | 
			
		||||
    SERIAL_ECHOPGM  ("Appending to DL from RAMG cache, bytes: ", dl_slot_used);
 | 
			
		||||
    SERIAL_ECHOLNPGM(" REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL));
 | 
			
		||||
  #endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ uint8_t ScreenRef::lookupScreen(onRedraw_func_t onRedraw_ptr) {
 | 
			
		||||
  }
 | 
			
		||||
  #if ENABLED(TOUCH_UI_DEBUG)
 | 
			
		||||
    SERIAL_ECHO_START();
 | 
			
		||||
    SERIAL_ECHOPAIR("Screen not found: ", (uintptr_t) onRedraw_ptr);
 | 
			
		||||
    SERIAL_ECHOPGM("Screen not found: ", (uintptr_t) onRedraw_ptr);
 | 
			
		||||
  #endif
 | 
			
		||||
  return 0xFF;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -237,7 +237,7 @@ class CachedScreen {
 | 
			
		||||
      cmd.cmd(CMD_SWAP);
 | 
			
		||||
      cmd.execute();
 | 
			
		||||
      #if ENABLED(TOUCH_UI_DEBUG)
 | 
			
		||||
        SERIAL_ECHOLNPAIR("Time to draw screen (ms): ", millis() - start_time);
 | 
			
		||||
        SERIAL_ECHOLNPGM("Time to draw screen (ms): ", millis() - start_time);
 | 
			
		||||
      #endif
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -122,7 +122,7 @@ void set_lcd_error_P(PGM_P const error, PGM_P const component/*=nullptr*/) {
 | 
			
		||||
void process_lcd_c_command(const char *command) {
 | 
			
		||||
  const int target_val = command[1] ? atoi(command + 1) : -1;
 | 
			
		||||
  if (target_val < 0) {
 | 
			
		||||
    DEBUG_ECHOLNPAIR("UNKNOWN C COMMAND ", command);
 | 
			
		||||
    DEBUG_ECHOLNPGM("UNKNOWN C COMMAND ", command);
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
  switch (command[0]) {
 | 
			
		||||
@@ -143,7 +143,7 @@ void process_lcd_c_command(const char *command) {
 | 
			
		||||
      case 'P': ExtUI::setTargetTemp_celsius(target_val, ExtUI::heater_t::BED); break;
 | 
			
		||||
    #endif
 | 
			
		||||
 | 
			
		||||
    default: DEBUG_ECHOLNPAIR("UNKNOWN C COMMAND ", command);
 | 
			
		||||
    default: DEBUG_ECHOLNPGM("UNKNOWN C COMMAND ", command);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -185,7 +185,7 @@ void process_lcd_eb_command(const char *command) {
 | 
			
		||||
      write_to_lcd(message_buffer);
 | 
			
		||||
    } break;
 | 
			
		||||
 | 
			
		||||
    default: DEBUG_ECHOLNPAIR("UNKNOWN E/B COMMAND ", command);
 | 
			
		||||
    default: DEBUG_ECHOLNPGM("UNKNOWN E/B COMMAND ", command);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -212,7 +212,7 @@ void process_lcd_j_command(const char *command) {
 | 
			
		||||
    case 'Y': j_move_axis<ExtUI::axis_t>(command, ExtUI::axis_t::Y); break;
 | 
			
		||||
    case 'Z': j_move_axis<ExtUI::axis_t>(command, ExtUI::axis_t::Z); break;
 | 
			
		||||
    case 'X': j_move_axis<ExtUI::axis_t>(command, ExtUI::axis_t::X); break;
 | 
			
		||||
    default: DEBUG_ECHOLNPAIR("UNKNOWN J COMMAND ", command);
 | 
			
		||||
    default: DEBUG_ECHOLNPGM("UNKNOWN J COMMAND ", command);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -336,7 +336,7 @@ void process_lcd_s_command(const char *command) {
 | 
			
		||||
      #endif
 | 
			
		||||
    } break;
 | 
			
		||||
 | 
			
		||||
    default: DEBUG_ECHOLNPAIR("UNKNOWN S COMMAND ", command);
 | 
			
		||||
    default: DEBUG_ECHOLNPGM("UNKNOWN S COMMAND ", command);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -360,11 +360,11 @@ void process_lcd_command(const char *command) {
 | 
			
		||||
      case 'C': process_lcd_c_command(current); break;
 | 
			
		||||
      case 'B':
 | 
			
		||||
      case 'E': process_lcd_eb_command(current); break;
 | 
			
		||||
      default: DEBUG_ECHOLNPAIR("UNKNOWN COMMAND ", command);
 | 
			
		||||
      default: DEBUG_ECHOLNPGM("UNKNOWN COMMAND ", command);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  else
 | 
			
		||||
    DEBUG_ECHOLNPAIR("UNKNOWN COMMAND FORMAT ", command);
 | 
			
		||||
    DEBUG_ECHOLNPGM("UNKNOWN COMMAND FORMAT ", command);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
 
 | 
			
		||||
@@ -106,7 +106,7 @@ namespace ExtUI {
 | 
			
		||||
 | 
			
		||||
    void onPidTuning(const result_t rst) {
 | 
			
		||||
      // Called for temperature PID tuning result
 | 
			
		||||
      //SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
 | 
			
		||||
      //SERIAL_ECHOLNPGM("OnPidTuning:", rst);
 | 
			
		||||
      switch (rst) {
 | 
			
		||||
        case PID_STARTED:
 | 
			
		||||
          set_lcd_error_P(GET_TEXT(MSG_PID_AUTOTUNE));
 | 
			
		||||
 
 | 
			
		||||
@@ -233,7 +233,7 @@ uint32_t lv_get_pic_addr(uint8_t *Pname) {
 | 
			
		||||
  currentFlashPage = 0;
 | 
			
		||||
 | 
			
		||||
  #if ENABLED(MARLIN_DEV_MODE)
 | 
			
		||||
    SERIAL_ECHOLNPAIR("Getting picture SPI Flash Address: ", (const char*)Pname);
 | 
			
		||||
    SERIAL_ECHOLNPGM("Getting picture SPI Flash Address: ", (const char*)Pname);
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  W25QXX.init(SPI_QUARTER_SPEED);
 | 
			
		||||
@@ -408,7 +408,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) {
 | 
			
		||||
    createFilename(dosFilename, entry);
 | 
			
		||||
    if (!file.open(&dir, dosFilename, O_READ)) {
 | 
			
		||||
      #if ENABLED(MARLIN_DEV_MODE)
 | 
			
		||||
        SERIAL_ECHOLNPAIR("Error opening Asset: ", fn);
 | 
			
		||||
        SERIAL_ECHOLNPGM("Error opening Asset: ", fn);
 | 
			
		||||
      #endif
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
@@ -463,7 +463,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) {
 | 
			
		||||
        } while (pbr >= BMP_WRITE_BUF_LEN);
 | 
			
		||||
      #endif
 | 
			
		||||
      #if ENABLED(MARLIN_DEV_MODE)
 | 
			
		||||
        SERIAL_ECHOLNPAIR("Space used: ", fn, " - ", (SPIFlash.getCurrentPage() + 1) * SPI_FLASH_PageSize / 1024, "KB");
 | 
			
		||||
        SERIAL_ECHOLNPGM("Space used: ", fn, " - ", (SPIFlash.getCurrentPage() + 1) * SPI_FLASH_PageSize / 1024, "KB");
 | 
			
		||||
        totalCompressed += (SPIFlash.getCurrentPage() + 1) * SPI_FLASH_PageSize;
 | 
			
		||||
      #endif
 | 
			
		||||
      SPIFlash.endWrite();
 | 
			
		||||
@@ -481,7 +481,7 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) {
 | 
			
		||||
    file.close();
 | 
			
		||||
 | 
			
		||||
    #if ENABLED(MARLIN_DEV_MODE)
 | 
			
		||||
      SERIAL_ECHOLNPAIR("Asset added: ", fn);
 | 
			
		||||
      SERIAL_ECHOLNPGM("Asset added: ", fn);
 | 
			
		||||
    #endif
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -537,8 +537,8 @@ uint32_t Pic_Info_Write(uint8_t *P_name, uint32_t P_size) {
 | 
			
		||||
    #if ENABLED(MARLIN_DEV_MODE)
 | 
			
		||||
      uint8_t pic_counter = 0;
 | 
			
		||||
      W25QXX.SPI_FLASH_BufferRead(&pic_counter, PIC_COUNTER_ADDR, 1);
 | 
			
		||||
      SERIAL_ECHOLNPAIR("Total assets loaded: ", pic_counter);
 | 
			
		||||
      SERIAL_ECHOLNPAIR("Total Uncompressed: ", totalSizes, ", Compressed: ", totalCompressed);
 | 
			
		||||
      SERIAL_ECHOLNPGM("Total assets loaded: ", pic_counter);
 | 
			
		||||
      SERIAL_ECHOLNPGM("Total Uncompressed: ", totalSizes, ", Compressed: ", totalCompressed);
 | 
			
		||||
    #endif
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -79,7 +79,7 @@ void FileNavigator::getFiles(uint16_t index) {
 | 
			
		||||
  lastindex = index;
 | 
			
		||||
 | 
			
		||||
  #if NEXDEBUG(AC_FILE)
 | 
			
		||||
    DEBUG_ECHOLNPAIR("index=", index, " currentindex=", currentindex);
 | 
			
		||||
    DEBUG_ECHOLNPGM("index=", index, " currentindex=", currentindex);
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  if (currentindex == 0 && folderdepth > 0) { // Add a link to go up a folder
 | 
			
		||||
@@ -127,7 +127,7 @@ void FileNavigator::getFiles(uint16_t index) {
 | 
			
		||||
      fcnt++;
 | 
			
		||||
      fseek = seek;
 | 
			
		||||
      #if NEXDEBUG(AC_FILE)
 | 
			
		||||
        DEBUG_ECHOLNPAIR("-", seek, " '", filelist.longFilename(), "' '", currentfoldername, "", filelist.shortFilename(), "'\n");
 | 
			
		||||
        DEBUG_ECHOLNPGM("-", seek, " '", filelist.longFilename(), "' '", currentfoldername, "", filelist.shortFilename(), "'\n");
 | 
			
		||||
      #endif
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
@@ -137,7 +137,7 @@ void FileNavigator::getFiles(uint16_t index) {
 | 
			
		||||
 | 
			
		||||
void FileNavigator::changeDIR(char *folder) {
 | 
			
		||||
  #if NEXDEBUG(AC_FILE)
 | 
			
		||||
    DEBUG_ECHOLNPAIR("currentfolder: ", currentfoldername, "  New: ", folder);
 | 
			
		||||
    DEBUG_ECHOLNPGM("currentfolder: ", currentfoldername, "  New: ", folder);
 | 
			
		||||
  #endif
 | 
			
		||||
  if (folderdepth >= MAX_FOLDER_DEPTH) return; // limit the folder depth
 | 
			
		||||
  strcat(currentfoldername, folder);
 | 
			
		||||
@@ -165,7 +165,7 @@ void FileNavigator::upDIR() {
 | 
			
		||||
    pos[1] = '\0';
 | 
			
		||||
  }
 | 
			
		||||
  #if NEXDEBUG(AC_FILE)
 | 
			
		||||
    DEBUG_ECHOLNPAIR("depth: ", folderdepth, " currentfoldername: ", currentfoldername);
 | 
			
		||||
    DEBUG_ECHOLNPGM("depth: ", folderdepth, " currentfoldername: ", currentfoldername);
 | 
			
		||||
  #endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -72,7 +72,7 @@ void NextionTFT::Startup() {
 | 
			
		||||
  SEND_VALasTXT("tmppage.bedy", Y_BED_SIZE);
 | 
			
		||||
  SEND_VALasTXT("tmppage.bedz", Z_MAX_POS);
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("Nextion Debug Level ", NEXDEBUGLEVEL);
 | 
			
		||||
  DEBUG_ECHOLNPGM("Nextion Debug Level ", NEXDEBUGLEVEL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void NextionTFT::IdleLoop() {
 | 
			
		||||
@@ -98,13 +98,13 @@ void NextionTFT::PrintFinished() {
 | 
			
		||||
void NextionTFT::ConfirmationRequest(const char * const msg) {
 | 
			
		||||
  SEND_VALasTXT("tmppage.M117", msg);
 | 
			
		||||
  #if NEXDEBUG(N_MARLIN)
 | 
			
		||||
    DEBUG_ECHOLNPAIR("ConfirmationRequest() ", msg, " printer_state:", printer_state);
 | 
			
		||||
    DEBUG_ECHOLNPGM("ConfirmationRequest() ", msg, " printer_state:", printer_state);
 | 
			
		||||
  #endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void NextionTFT::StatusChange(const char * const msg) {
 | 
			
		||||
  #if NEXDEBUG(N_MARLIN)
 | 
			
		||||
    DEBUG_ECHOLNPAIR("StatusChange() ", msg, "\nprinter_state:", printer_state);
 | 
			
		||||
    DEBUG_ECHOLNPGM("StatusChange() ", msg, "\nprinter_state:", printer_state);
 | 
			
		||||
  #endif
 | 
			
		||||
  SEND_VALasTXT("tmppage.M117", msg);
 | 
			
		||||
}
 | 
			
		||||
@@ -133,12 +133,12 @@ bool NextionTFT::ReadTFTCommand() {
 | 
			
		||||
    if (nextion_command[0] == 'G' || nextion_command[0] == 'M' || nextion_command[0] == 'T')
 | 
			
		||||
      injectCommands(nextion_command);
 | 
			
		||||
    #if NEXDEBUG(N_ALL)
 | 
			
		||||
      DEBUG_ECHOLNPAIR("< ", nextion_command);
 | 
			
		||||
      DEBUG_ECHOLNPGM("< ", nextion_command);
 | 
			
		||||
    #endif
 | 
			
		||||
    #if NEXDEBUG(N_SOME)
 | 
			
		||||
      uint8_t req = atoi(&nextion_command[1]);
 | 
			
		||||
      if (req > 7 && req != 20)
 | 
			
		||||
        DEBUG_ECHOLNPAIR(  "> ", AS_CHAR(nextion_command[0]),
 | 
			
		||||
        DEBUG_ECHOLNPGM(  "> ", AS_CHAR(nextion_command[0]),
 | 
			
		||||
                         "\n> ", AS_CHAR(nextion_command[1]),
 | 
			
		||||
                         "\n> ", AS_CHAR(nextion_command[2]),
 | 
			
		||||
                         "\n> ", AS_CHAR(nextion_command[3]),
 | 
			
		||||
@@ -151,7 +151,7 @@ bool NextionTFT::ReadTFTCommand() {
 | 
			
		||||
void NextionTFT::SendFileList(int8_t startindex) {
 | 
			
		||||
  // respond to panel request for 7 files starting at index
 | 
			
		||||
  #if NEXDEBUG(N_INFO)
 | 
			
		||||
    DEBUG_ECHOLNPAIR("## SendFileList ## ", startindex);
 | 
			
		||||
    DEBUG_ECHOLNPGM("## SendFileList ## ", startindex);
 | 
			
		||||
  #endif
 | 
			
		||||
  filenavigator.getFiles(startindex);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -778,7 +778,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
 | 
			
		||||
            TERN_(MULTI_E_MANUAL, axis == E_AXIS ? e_index :) active_extruder
 | 
			
		||||
          );
 | 
			
		||||
 | 
			
		||||
          //SERIAL_ECHOLNPAIR("Add planner.move with Axis ", AS_CHAR(axis_codes[axis]), " at FR ", fr_mm_s);
 | 
			
		||||
          //SERIAL_ECHOLNPGM("Add planner.move with Axis ", AS_CHAR(axis_codes[axis]), " at FR ", fr_mm_s);
 | 
			
		||||
 | 
			
		||||
          axis = NO_AXIS_ENUM;
 | 
			
		||||
 | 
			
		||||
@@ -795,7 +795,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
 | 
			
		||||
      TERN_(MULTI_E_MANUAL, if (move_axis == E_AXIS) e_index = eindex);
 | 
			
		||||
      start_time = millis() + (menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves
 | 
			
		||||
      axis = move_axis;
 | 
			
		||||
      //SERIAL_ECHOLNPAIR("Post Move with Axis ", AS_CHAR(axis_codes[axis]), " soon.");
 | 
			
		||||
      //SERIAL_ECHOLNPGM("Post Move with Axis ", AS_CHAR(axis_codes[axis]), " soon.");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #if ENABLED(AUTO_BED_LEVELING_UBL)
 | 
			
		||||
@@ -981,10 +981,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
 | 
			
		||||
                  //#define ENCODER_RATE_MULTIPLIER_DEBUG
 | 
			
		||||
                  #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG)
 | 
			
		||||
                    SERIAL_ECHO_START();
 | 
			
		||||
                    SERIAL_ECHOPAIR("Enc Step Rate: ", encoderStepRate);
 | 
			
		||||
                    SERIAL_ECHOPAIR("  Multiplier: ", encoderMultiplier);
 | 
			
		||||
                    SERIAL_ECHOPAIR("  ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC);
 | 
			
		||||
                    SERIAL_ECHOPAIR("  ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC);
 | 
			
		||||
                    SERIAL_ECHOPGM("Enc Step Rate: ", encoderStepRate);
 | 
			
		||||
                    SERIAL_ECHOPGM("  Multiplier: ", encoderMultiplier);
 | 
			
		||||
                    SERIAL_ECHOPGM("  ENCODER_10X_STEPS_PER_SEC: ", ENCODER_10X_STEPS_PER_SEC);
 | 
			
		||||
                    SERIAL_ECHOPGM("  ENCODER_100X_STEPS_PER_SEC: ", ENCODER_100X_STEPS_PER_SEC);
 | 
			
		||||
                    SERIAL_EOL();
 | 
			
		||||
                  #endif
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
@@ -217,7 +217,7 @@ void menu_advanced_settings();
 | 
			
		||||
 | 
			
		||||
  #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
 | 
			
		||||
    void bltouch_report() {
 | 
			
		||||
      SERIAL_ECHOLNPAIR("EEPROM Last BLTouch Mode - ", bltouch.last_written_mode);
 | 
			
		||||
      SERIAL_ECHOLNPGM("EEPROM Last BLTouch Mode - ", bltouch.last_written_mode);
 | 
			
		||||
      SERIAL_ECHOLNPGM("Configuration BLTouch Mode - " TERN(BLTOUCH_SET_5V_MODE, "5V", "OD"));
 | 
			
		||||
      char mess[21];
 | 
			
		||||
      strcpy_P(mess, PSTR("BLTouch Mode - "));
 | 
			
		||||
 
 | 
			
		||||
@@ -56,12 +56,12 @@ static bool probe_single_point() {
 | 
			
		||||
  if (reference_index < 0) reference_index = tram_index;
 | 
			
		||||
  move_to_tramming_wait_pos();
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("probe_single_point(", tram_index, ") = ", z_probed_height, "mm");
 | 
			
		||||
  DEBUG_ECHOLNPGM("probe_single_point(", tram_index, ") = ", z_probed_height, "mm");
 | 
			
		||||
  return (z_isvalid[tram_index] = !isnan(z_probed_height));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void _menu_single_probe() {
 | 
			
		||||
  DEBUG_ECHOLNPAIR("Screen: single probe screen Arg:", tram_index);
 | 
			
		||||
  DEBUG_ECHOLNPGM("Screen: single probe screen Arg:", tram_index);
 | 
			
		||||
  START_MENU();
 | 
			
		||||
  STATIC_ITEM(MSG_BED_TRAMMING, SS_LEFT);
 | 
			
		||||
  STATIC_ITEM(MSG_LAST_VALUE_SP, SS_LEFT, z_isvalid[tram_index] ? ftostr42_52(z_measured[reference_index] - z_measured[tram_index]) : "---");
 | 
			
		||||
@@ -87,7 +87,7 @@ static void tramming_wizard_menu() {
 | 
			
		||||
 | 
			
		||||
// Init the wizard and enter the submenu
 | 
			
		||||
void goto_tramming_wizard() {
 | 
			
		||||
  DEBUG_ECHOLNPAIR("Screen: goto_tramming_wizard", 1);
 | 
			
		||||
  DEBUG_ECHOLNPGM("Screen: goto_tramming_wizard", 1);
 | 
			
		||||
  ui.defer_status_screen();
 | 
			
		||||
 | 
			
		||||
  // Initialize measured point flags
 | 
			
		||||
 
 | 
			
		||||
@@ -45,21 +45,21 @@ void TFT_String::set_font(const uint8_t *font) {
 | 
			
		||||
 | 
			
		||||
  for (glyph = 0; glyph < 256; glyph++) glyphs[glyph] = nullptr;
 | 
			
		||||
 | 
			
		||||
  DEBUG_ECHOLNPAIR("Format: ",            font_header->Format);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("BBXWidth: ",          font_header->BBXWidth);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("BBXHeight: ",         font_header->BBXHeight);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("BBXOffsetX: ",        font_header->BBXOffsetX);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("BBXOffsetY: ",        font_header->BBXOffsetY);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("CapitalAHeight: ",    font_header->CapitalAHeight);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("Encoding65Pos: ",     font_header->Encoding65Pos);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("Encoding97Pos: ",     font_header->Encoding97Pos);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("FontStartEncoding: ", font_header->FontStartEncoding);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("FontEndEncoding: ",   font_header->FontEndEncoding);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("LowerGDescent: ",     font_header->LowerGDescent);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("FontAscent: ",        font_header->FontAscent);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("FontDescent: ",       font_header->FontDescent);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("FontXAscent: ",       font_header->FontXAscent);
 | 
			
		||||
  DEBUG_ECHOLNPAIR("FontXDescent: ",      font_header->FontXDescent);
 | 
			
		||||
  DEBUG_ECHOLNPGM("Format: ",            font_header->Format);
 | 
			
		||||
  DEBUG_ECHOLNPGM("BBXWidth: ",          font_header->BBXWidth);
 | 
			
		||||
  DEBUG_ECHOLNPGM("BBXHeight: ",         font_header->BBXHeight);
 | 
			
		||||
  DEBUG_ECHOLNPGM("BBXOffsetX: ",        font_header->BBXOffsetX);
 | 
			
		||||
  DEBUG_ECHOLNPGM("BBXOffsetY: ",        font_header->BBXOffsetY);
 | 
			
		||||
  DEBUG_ECHOLNPGM("CapitalAHeight: ",    font_header->CapitalAHeight);
 | 
			
		||||
  DEBUG_ECHOLNPGM("Encoding65Pos: ",     font_header->Encoding65Pos);
 | 
			
		||||
  DEBUG_ECHOLNPGM("Encoding97Pos: ",     font_header->Encoding97Pos);
 | 
			
		||||
  DEBUG_ECHOLNPGM("FontStartEncoding: ", font_header->FontStartEncoding);
 | 
			
		||||
  DEBUG_ECHOLNPGM("FontEndEncoding: ",   font_header->FontEndEncoding);
 | 
			
		||||
  DEBUG_ECHOLNPGM("LowerGDescent: ",     font_header->LowerGDescent);
 | 
			
		||||
  DEBUG_ECHOLNPGM("FontAscent: ",        font_header->FontAscent);
 | 
			
		||||
  DEBUG_ECHOLNPGM("FontDescent: ",       font_header->FontDescent);
 | 
			
		||||
  DEBUG_ECHOLNPGM("FontXAscent: ",       font_header->FontXAscent);
 | 
			
		||||
  DEBUG_ECHOLNPGM("FontXDescent: ",      font_header->FontXDescent);
 | 
			
		||||
 | 
			
		||||
  add_glyphs(font);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -77,10 +77,10 @@ void TouchCalibration::validate_calibration() {
 | 
			
		||||
 | 
			
		||||
  if (calibration_state == CALIBRATION_SUCCESS) {
 | 
			
		||||
    SERIAL_ECHOLNPGM("Touch screen calibration completed");
 | 
			
		||||
    SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_X ", calibration.x);
 | 
			
		||||
    SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_Y ", calibration.y);
 | 
			
		||||
    SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x);
 | 
			
		||||
    SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y);
 | 
			
		||||
    SERIAL_ECHOLNPGM("TOUCH_CALIBRATION_X ", calibration.x);
 | 
			
		||||
    SERIAL_ECHOLNPGM("TOUCH_CALIBRATION_Y ", calibration.y);
 | 
			
		||||
    SERIAL_ECHOLNPGM("TOUCH_OFFSET_X ", calibration.offset_x);
 | 
			
		||||
    SERIAL_ECHOLNPGM("TOUCH_OFFSET_Y ", calibration.offset_y);
 | 
			
		||||
    SERIAL_ECHO_TERNARY(calibration.orientation == TOUCH_LANDSCAPE, "TOUCH_ORIENTATION ", "TOUCH_LANDSCAPE", "TOUCH_PORTRAIT", "\n");
 | 
			
		||||
    TERN_(TOUCH_CALIBRATION_AUTO_SAVE, settings.save());
 | 
			
		||||
  }
 | 
			
		||||
@@ -95,7 +95,7 @@ bool TouchCalibration::handleTouch(uint16_t x, uint16_t y) {
 | 
			
		||||
  if (calibration_state < CALIBRATION_SUCCESS) {
 | 
			
		||||
    calibration_points[calibration_state].raw_x = x;
 | 
			
		||||
    calibration_points[calibration_state].raw_y = y;
 | 
			
		||||
    DEBUG_ECHOLNPAIR("TouchCalibration - State: ", calibration_state, ", x: ", calibration_points[calibration_state].x, ", raw_x: ", x, ", y: ", calibration_points[calibration_state].y, ", raw_y: ", y);
 | 
			
		||||
    DEBUG_ECHOLNPGM("TouchCalibration - State: ", calibration_state, ", x: ", calibration_points[calibration_state].x, ", raw_x: ", x, ", y: ", calibration_points[calibration_state].y, ", raw_y: ", y);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  switch (calibration_state) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user