浏览代码

Show filename during print fixed, sorting files on Sd card in farm mode fixed

PavelSindler 7 年之前
父节点
当前提交
33168bedbd
共有 2 个文件被更改,包括 12 次插入15 次删除
  1. 2 1
      Firmware/ultralcd.cpp
  2. 10 14
      Firmware/ultralcd_implementation_hitachi_HD44780.h

+ 2 - 1
Firmware/ultralcd.cpp

@@ -4186,7 +4186,8 @@ void lcd_sdcard_menu()
   {
     if (_menuItemNr == _lineNr)
     {
-		const uint16_t nr = (sdSort == SD_SORT_NONE) ? (fileCnt - 1 - i) : i;
+		const uint16_t nr = ((sdSort == SD_SORT_NONE) || farm_mode) ? (fileCnt - 1 - i) : i;
+
 		 /* #ifdef SDCARD_RATHERRECENTFIRST
 			#ifndef SDCARD_SORT_ALPHA
 				fileCnt - 1 -

+ 10 - 14
Firmware/ultralcd_implementation_hitachi_HD44780.h

@@ -830,21 +830,20 @@ static void lcd_implementation_status_screen()
     // If heating in progress, set flag
 	if (heating_status != 0) { custom_message = true; }
 
+	if (IS_SD_PRINTING) {
+		if (strcmp(longFilenameOLD, card.longFilename) != 0)
+		{
+			memset(longFilenameOLD, '\0', strlen(longFilenameOLD));
+			sprintf_P(longFilenameOLD, PSTR("%s"), card.longFilename);
+			scrollstuff = 0;
+		}
+	}
+
     // If printing from SD, show what we are printing
-	if (IS_SD_PRINTING)
+	if (IS_SD_PRINTING && !custom_message)
 	{
-
-      if(strcmp(longFilenameOLD, card.longFilename) != 0)
-	  {
-        memset(longFilenameOLD,'\0',strlen(longFilenameOLD));
-        sprintf_P(longFilenameOLD, PSTR("%s"), card.longFilename);
-        scrollstuff = 0;
-      }
-	  if (!custom_message) {
-
 		  if (strlen(card.longFilename) > LCD_WIDTH)
 		  {
-
 			  int inters = 0;
 			  int gh = scrollstuff;
 			  while (((gh - scrollstuff) < LCD_WIDTH) && (inters == 0))
@@ -873,9 +872,6 @@ static void lcd_implementation_status_screen()
 		  {
 			  lcd.print(longFilenameOLD);
 		  }
-	  }
-
-
     }
     // If not, check for other special events
 	else