Merge branch 'MK3' into use_enum_class_2

This commit is contained in:
Marek Bel 2019-06-12 19:17:35 +02:00
commit 72f5e87c61
14 changed files with 258 additions and 15 deletions

View file

@ -214,8 +214,6 @@ static LongTimer crashDetTimer;
bool mesh_bed_leveling_flag = false;
bool mesh_bed_run_from_menu = false;
int8_t FarmMode = 0;
bool prusa_sd_card_upload = false;
unsigned int status_number = 0;
@ -1065,6 +1063,9 @@ void setup()
//disabled filament autoload (PFW360)
fsensor_autoload_set(false);
#endif //FILAMENT_SENSOR
// ~ FanCheck -> on
if(!(eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED)))
eeprom_update_byte((unsigned char *)EEPROM_FAN_CHECK_ENABLED,true);
}
MYSERIAL.begin(BAUDRATE);
fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream
@ -1644,6 +1645,7 @@ void setup()
}
#endif //UVLO_SUPPORT
fCheckModeInit();
KEEPALIVE_STATE(NOT_BUSY);
#ifdef WATCHDOG
wdt_enable(WDTO_4S);
@ -3649,7 +3651,39 @@ void process_commands()
} else if(code_seen("FR")) { //! PRUSA FR
// Factory full reset
factory_reset(0);
}
//-//
/*
} else if(code_seen("qqq")) {
MYSERIAL.println("=== checking ===");
MYSERIAL.println(eeprom_read_byte((uint8_t*)EEPROM_CHECK_MODE),DEC);
MYSERIAL.println(eeprom_read_byte((uint8_t*)EEPROM_NOZZLE_DIAMETER),DEC);
MYSERIAL.println(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM),DEC);
MYSERIAL.println(farm_mode,DEC);
MYSERIAL.println(eCheckMode,DEC);
} else if(code_seen("www")) {
MYSERIAL.println("=== @ FF ===");
eeprom_update_byte((uint8_t*)EEPROM_CHECK_MODE,0xFF);
eeprom_update_byte((uint8_t*)EEPROM_NOZZLE_DIAMETER,0xFF);
eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
*/
} else if (code_seen("nozzle")) { //! PRUSA nozzle
uint16_t nDiameter;
if(code_seen('D'))
{
nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um]
nozzle_diameter_check(nDiameter);
}
else if(code_seen("set") && farm_mode)
{
strchr_pointer++; // skip 2nd char (~ 'e')
strchr_pointer++; // skip 3rd char (~ 't')
nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um]
eeprom_update_byte((uint8_t*)EEPROM_NOZZLE_DIAMETER,(uint8_t)e_NOZZLE_DIAMETER_NULL); // for correct synchronization after farm-mode exiting
eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,nDiameter);
}
else SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0);
}
//else if (code_seen('Cal')) {
// lcd_calibration();
// }
@ -4959,6 +4993,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
EEPROM_save_B(EEPROM_FARM_NUMBER, &farm_no);
SilentModeMenu = SILENT_MODE_OFF;
eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu);
fCheckModeInit(); // alternatively invoke printer reset
break;
case 99: //! G99 (deactivate farm mode)
@ -4966,6 +5001,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
lcd_printer_connected();
eeprom_update_byte((unsigned char *)EEPROM_FARM_MODE, farm_mode);
lcd_update(2);
fCheckModeInit(); // alternatively invoke printer reset
break;
default:
printf_P(PSTR("Unknown G code: %s \n"), cmdbuffer + bufindr + CMDHDRSIZE);
@ -7671,7 +7707,7 @@ static void handleSafetyTimer()
{
safetyTimer.start();
}
else if (safetyTimer.expired(safetytimer_inactive_time))
else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time))
{
setTargetBed(0);
setAllTargetHotends(0);