浏览代码

sorting files disabled in farm mode, start printer status needs reponse from monitoring

PavelSindler 7 年之前
父节点
当前提交
00569fea6a
共有 4 个文件被更改,包括 25 次插入8 次删除
  1. 1 0
      Firmware/Marlin.h
  2. 14 1
      Firmware/Marlin_main.cpp
  3. 1 0
      Firmware/cardreader.cpp
  4. 9 7
      Firmware/ultralcd.cpp

+ 1 - 0
Firmware/Marlin.h

@@ -355,3 +355,4 @@ void temp_compensation_apply();
 void temp_compensation_start();
 void wait_for_heater(long codenum);
 void serialecho_temperatures();
+void proc_commands();

+ 14 - 1
Firmware/Marlin_main.cpp

@@ -1016,6 +1016,8 @@ void setup()
 	if (farm_mode)
 	{
 		prusa_statistics(8);
+		no_response = true; //we need confirmation by recieving PRUSA thx
+		important_status = 8;
         selectedSerialPort = 1;
 	} else {
         selectedSerialPort = 0;
@@ -1173,6 +1175,8 @@ void setup()
 	if (farm_mode)
 	{
 		prusa_statistics(8);
+		no_response = true; //we need confirmation by recieving PRUSA thx
+		important_status = 8;
 	}
 
 	// Enable Toshiba FlashAir SD card / WiFi enahanced card.
@@ -1391,6 +1395,16 @@ void loop()
   lcd_update();
 }
 
+void proc_commands() {
+	if (buflen)
+	{
+		process_commands();
+		if (!cmdbuffer_front_already_processed)
+			cmdqueue_pop_front();
+		cmdbuffer_front_already_processed = false;
+	}
+}
+
 void get_command()
 {
     // Test and reserve space for the new command string.
@@ -2064,7 +2078,6 @@ void ramming() {
 */
 void process_commands()
 {
-	if (!buflen) return; //empty command
   #ifdef FILAMENT_RUNOUT_SUPPORT
     SET_INPUT(FR_SENS);
   #endif

+ 1 - 0
Firmware/cardreader.cpp

@@ -706,6 +706,7 @@ void CardReader::getfilename_sorted(const uint16_t nr) {
 */
 void CardReader::presort() {
 	
+	if (farm_mode) return; //sorting is not used in farm mode
 	uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT);
 	
 	if (sdSort == SD_SORT_NONE) return; //sd sort is turned off

+ 9 - 7
Firmware/ultralcd.cpp

@@ -4167,14 +4167,16 @@ void lcd_sdcard_menu()
     
   START_MENU();
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
+  if (!farm_mode) {
 #ifdef SDCARD_SORT_ALPHA
-  EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));
-  switch(sdSort){
-    case SD_SORT_TIME: MENU_ITEM(function, MSG_SORT_TIME, lcd_sort_type_set); break;
-    case SD_SORT_ALPHA: MENU_ITEM(function, MSG_SORT_ALPHA, lcd_sort_type_set); break;
-    default: MENU_ITEM(function, MSG_SORT_NONE, lcd_sort_type_set);
-  }
+	  EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));
+	  switch (sdSort) {
+	  case SD_SORT_TIME: MENU_ITEM(function, MSG_SORT_TIME, lcd_sort_type_set); break;
+	  case SD_SORT_ALPHA: MENU_ITEM(function, MSG_SORT_ALPHA, lcd_sort_type_set); break;
+	  default: MENU_ITEM(function, MSG_SORT_NONE, lcd_sort_type_set);
+	  }
 #endif // SDCARD_SORT_ALPHA
+  }
   card.getWorkDirName();
   if (card.filename[0] == '/')
   {
@@ -5241,7 +5243,7 @@ static void lcd_connect_printer() {
 		i++;
 		t++;		
 		delay_keep_alive(100);
-		process_commands();
+		process_command_small();
 		if (t == 10) {
 			prusa_statistics(important_status, saved_filament_type);
 			t = 0;