merging with upstream
This commit is contained in:
commit
df79ea94a7
|
|
@ -252,7 +252,7 @@ your extruder heater takes 2 minutes to hit the target on heating.
|
||||||
const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
|
const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
|
||||||
const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
|
const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
|
||||||
const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
|
const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
|
||||||
//#define DISABLE_MAX_ENDSTOPS
|
#define DISABLE_MAX_ENDSTOPS
|
||||||
//#define DISABLE_MIN_ENDSTOPS
|
//#define DISABLE_MIN_ENDSTOPS
|
||||||
|
|
||||||
// Disable max endstops for compatibility with endstop checking routine
|
// Disable max endstops for compatibility with endstop checking routine
|
||||||
|
|
|
||||||
|
|
@ -308,6 +308,10 @@ extern unsigned int custom_message_type;
|
||||||
extern unsigned int custom_message_state;
|
extern unsigned int custom_message_state;
|
||||||
extern char snmm_filaments_used;
|
extern char snmm_filaments_used;
|
||||||
extern unsigned long PingTime;
|
extern unsigned long PingTime;
|
||||||
|
extern unsigned long NcTime;
|
||||||
|
extern bool no_response;
|
||||||
|
extern uint8_t important_status;
|
||||||
|
extern uint8_t saved_filament_type;
|
||||||
|
|
||||||
|
|
||||||
// Handling multiple extruders pins
|
// Handling multiple extruders pins
|
||||||
|
|
@ -356,6 +360,7 @@ void temp_compensation_apply();
|
||||||
void temp_compensation_start();
|
void temp_compensation_start();
|
||||||
void wait_for_heater(long codenum);
|
void wait_for_heater(long codenum);
|
||||||
void serialecho_temperatures();
|
void serialecho_temperatures();
|
||||||
|
void proc_commands();
|
||||||
|
|
||||||
#ifdef HOST_KEEPALIVE_FEATURE
|
#ifdef HOST_KEEPALIVE_FEATURE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -226,6 +226,8 @@ CardReader card;
|
||||||
unsigned long TimeSent = millis();
|
unsigned long TimeSent = millis();
|
||||||
unsigned long TimeNow = millis();
|
unsigned long TimeNow = millis();
|
||||||
unsigned long PingTime = millis();
|
unsigned long PingTime = millis();
|
||||||
|
unsigned long NcTime;
|
||||||
|
|
||||||
union Data
|
union Data
|
||||||
{
|
{
|
||||||
byte b[2];
|
byte b[2];
|
||||||
|
|
@ -396,6 +398,10 @@ bool cancel_heatup = false ;
|
||||||
const char errormagic[] PROGMEM = "Error:";
|
const char errormagic[] PROGMEM = "Error:";
|
||||||
const char echomagic[] PROGMEM = "echo:";
|
const char echomagic[] PROGMEM = "echo:";
|
||||||
|
|
||||||
|
bool no_response = false;
|
||||||
|
uint8_t important_status;
|
||||||
|
uint8_t saved_filament_type;
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//=============================Private Variables=============================
|
//=============================Private Variables=============================
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
@ -1021,6 +1027,8 @@ void setup()
|
||||||
if (farm_mode)
|
if (farm_mode)
|
||||||
{
|
{
|
||||||
prusa_statistics(8);
|
prusa_statistics(8);
|
||||||
|
no_response = true; //we need confirmation by recieving PRUSA thx
|
||||||
|
important_status = 8;
|
||||||
selectedSerialPort = 1;
|
selectedSerialPort = 1;
|
||||||
} else {
|
} else {
|
||||||
selectedSerialPort = 0;
|
selectedSerialPort = 0;
|
||||||
|
|
@ -1179,6 +1187,8 @@ void setup()
|
||||||
if (farm_mode)
|
if (farm_mode)
|
||||||
{
|
{
|
||||||
prusa_statistics(8);
|
prusa_statistics(8);
|
||||||
|
no_response = true; //we need confirmation by recieving PRUSA thx
|
||||||
|
important_status = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable Toshiba FlashAir SD card / WiFi enahanced card.
|
// Enable Toshiba FlashAir SD card / WiFi enahanced card.
|
||||||
|
|
@ -1428,6 +1438,16 @@ void loop()
|
||||||
lcd_update();
|
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()
|
void get_command()
|
||||||
{
|
{
|
||||||
// Test and reserve space for the new command string.
|
// Test and reserve space for the new command string.
|
||||||
|
|
@ -2141,11 +2161,18 @@ void process_commands()
|
||||||
PingTime = millis();
|
PingTime = millis();
|
||||||
//MYSERIAL.print(farm_no); MYSERIAL.println(": OK");
|
//MYSERIAL.print(farm_no); MYSERIAL.println(": OK");
|
||||||
}
|
}
|
||||||
}
|
} else if (code_seen("PRN")) {
|
||||||
else if (code_seen("PRN")) {
|
|
||||||
MYSERIAL.println(status_number);
|
MYSERIAL.println(status_number);
|
||||||
|
|
||||||
}else if (code_seen("fn")) {
|
} else if (code_seen("RESET")) {
|
||||||
|
// careful!
|
||||||
|
if (farm_mode) {
|
||||||
|
asm volatile(" jmp 0x3E000");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MYSERIAL.println("Not in farm mode.");
|
||||||
|
}
|
||||||
|
} else if (code_seen("fn")) {
|
||||||
if (farm_mode) {
|
if (farm_mode) {
|
||||||
MYSERIAL.println(farm_no);
|
MYSERIAL.println(farm_no);
|
||||||
}
|
}
|
||||||
|
|
@ -2153,6 +2180,9 @@ void process_commands()
|
||||||
MYSERIAL.println("Not in farm mode.");
|
MYSERIAL.println("Not in farm mode.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (code_seen("thx")) {
|
||||||
|
no_response = false;
|
||||||
}else if (code_seen("fv")) {
|
}else if (code_seen("fv")) {
|
||||||
// get file version
|
// get file version
|
||||||
#ifdef SDSUPPORT
|
#ifdef SDSUPPORT
|
||||||
|
|
@ -5712,7 +5742,6 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
|
||||||
|
|
||||||
pinMode(E_MUX0_PIN, OUTPUT);
|
pinMode(E_MUX0_PIN, OUTPUT);
|
||||||
pinMode(E_MUX1_PIN, OUTPUT);
|
pinMode(E_MUX1_PIN, OUTPUT);
|
||||||
pinMode(E_MUX2_PIN, OUTPUT);
|
|
||||||
|
|
||||||
delay(100);
|
delay(100);
|
||||||
SERIAL_ECHO_START;
|
SERIAL_ECHO_START;
|
||||||
|
|
@ -5722,25 +5751,21 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
|
||||||
case 1:
|
case 1:
|
||||||
WRITE(E_MUX0_PIN, HIGH);
|
WRITE(E_MUX0_PIN, HIGH);
|
||||||
WRITE(E_MUX1_PIN, LOW);
|
WRITE(E_MUX1_PIN, LOW);
|
||||||
WRITE(E_MUX2_PIN, LOW);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
WRITE(E_MUX0_PIN, LOW);
|
WRITE(E_MUX0_PIN, LOW);
|
||||||
WRITE(E_MUX1_PIN, HIGH);
|
WRITE(E_MUX1_PIN, HIGH);
|
||||||
WRITE(E_MUX2_PIN, LOW);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
WRITE(E_MUX0_PIN, HIGH);
|
WRITE(E_MUX0_PIN, HIGH);
|
||||||
WRITE(E_MUX1_PIN, HIGH);
|
WRITE(E_MUX1_PIN, HIGH);
|
||||||
WRITE(E_MUX2_PIN, LOW);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WRITE(E_MUX0_PIN, LOW);
|
WRITE(E_MUX0_PIN, LOW);
|
||||||
WRITE(E_MUX1_PIN, LOW);
|
WRITE(E_MUX1_PIN, LOW);
|
||||||
WRITE(E_MUX2_PIN, LOW);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -705,7 +705,8 @@ void CardReader::getfilename_sorted(const uint16_t nr) {
|
||||||
* - Most RAM: Buffer the directory and return filenames from RAM
|
* - Most RAM: Buffer the directory and return filenames from RAM
|
||||||
*/
|
*/
|
||||||
void CardReader::presort() {
|
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);
|
uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT);
|
||||||
|
|
||||||
if (sdSort == SD_SORT_NONE) return; //sd sort is turned off
|
if (sdSort == SD_SORT_NONE) return; //sd sort is turned off
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,6 @@
|
||||||
|
|
||||||
#define E_MUX0_PIN 17
|
#define E_MUX0_PIN 17
|
||||||
#define E_MUX1_PIN 16
|
#define E_MUX1_PIN 16
|
||||||
#define E_MUX2_PIN 84
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -229,7 +228,6 @@
|
||||||
|
|
||||||
#define E_MUX0_PIN 17
|
#define E_MUX0_PIN 17
|
||||||
#define E_MUX1_PIN 16
|
#define E_MUX1_PIN 16
|
||||||
#define E_MUX2_PIN 84
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -506,10 +506,10 @@ static void lcd_status_screen()
|
||||||
feedmultiply = 999;
|
feedmultiply = 999;
|
||||||
#endif //ULTIPANEL
|
#endif //ULTIPANEL
|
||||||
|
|
||||||
if (farm_mode && !printer_connected) {
|
/*if (farm_mode && !printer_connected) {
|
||||||
lcd.setCursor(0, 3);
|
lcd.setCursor(0, 3);
|
||||||
lcd_printPGM(MSG_PRINTER_DISCONNECTED);
|
lcd_printPGM(MSG_PRINTER_DISCONNECTED);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2141,14 +2141,14 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
||||||
farm_timer = 2;
|
farm_timer = 2;
|
||||||
break;
|
break;
|
||||||
case 6: // print done
|
case 6: // print done
|
||||||
SERIAL_ECHOLN("{[PRN:8]");
|
SERIAL_ECHO("{[PRN:8]");
|
||||||
prusa_stat_farm_number();
|
prusa_stat_farm_number();
|
||||||
SERIAL_ECHOLN("}");
|
SERIAL_ECHOLN("}");
|
||||||
status_number = 8;
|
status_number = 8;
|
||||||
farm_timer = 2;
|
farm_timer = 2;
|
||||||
break;
|
break;
|
||||||
case 7: // print done - stopped
|
case 7: // print done - stopped
|
||||||
SERIAL_ECHOLN("{[PRN:9]");
|
SERIAL_ECHO("{[PRN:9]");
|
||||||
prusa_stat_farm_number();
|
prusa_stat_farm_number();
|
||||||
SERIAL_ECHOLN("}");
|
SERIAL_ECHOLN("}");
|
||||||
status_number = 9;
|
status_number = 9;
|
||||||
|
|
@ -2162,7 +2162,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
||||||
farm_timer = 2;
|
farm_timer = 2;
|
||||||
break;
|
break;
|
||||||
case 20: // echo farm no
|
case 20: // echo farm no
|
||||||
SERIAL_ECHOLN("{");
|
SERIAL_ECHO("{");
|
||||||
prusa_stat_printerstatus(status_number);
|
prusa_stat_printerstatus(status_number);
|
||||||
prusa_stat_farm_number();
|
prusa_stat_farm_number();
|
||||||
SERIAL_ECHOLN("}");
|
SERIAL_ECHOLN("}");
|
||||||
|
|
@ -2176,19 +2176,19 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
||||||
SERIAL_ECHOLN("}");
|
SERIAL_ECHOLN("}");
|
||||||
break;
|
break;
|
||||||
case 22: // waiting for filament change
|
case 22: // waiting for filament change
|
||||||
SERIAL_ECHOLN("{[PRN:5]");
|
SERIAL_ECHO("{[PRN:5]");
|
||||||
prusa_stat_farm_number();
|
prusa_stat_farm_number();
|
||||||
SERIAL_ECHOLN("}");
|
SERIAL_ECHOLN("}");
|
||||||
status_number = 5;
|
status_number = 5;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 90: // Error - Thermal Runaway
|
case 90: // Error - Thermal Runaway
|
||||||
SERIAL_ECHOLN("{[ERR:1]");
|
SERIAL_ECHO("{[ERR:1]");
|
||||||
prusa_stat_farm_number();
|
prusa_stat_farm_number();
|
||||||
SERIAL_ECHOLN("}");
|
SERIAL_ECHOLN("}");
|
||||||
break;
|
break;
|
||||||
case 91: // Error - Thermal Runaway Preheat
|
case 91: // Error - Thermal Runaway Preheat
|
||||||
SERIAL_ECHOLN("{[ERR:2]");
|
SERIAL_ECHO("{[ERR:2]");
|
||||||
prusa_stat_farm_number();
|
prusa_stat_farm_number();
|
||||||
SERIAL_ECHOLN("}");
|
SERIAL_ECHOLN("}");
|
||||||
break;
|
break;
|
||||||
|
|
@ -2198,7 +2198,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
||||||
SERIAL_ECHOLN("}");
|
SERIAL_ECHOLN("}");
|
||||||
break;
|
break;
|
||||||
case 93: // Error - Max temp
|
case 93: // Error - Max temp
|
||||||
SERIAL_ECHOLN("{[ERR:4]");
|
SERIAL_ECHO("{[ERR:4]");
|
||||||
prusa_stat_farm_number();
|
prusa_stat_farm_number();
|
||||||
SERIAL_ECHOLN("}");
|
SERIAL_ECHOLN("}");
|
||||||
break;
|
break;
|
||||||
|
|
@ -3273,31 +3273,26 @@ void change_extr(int extr) { //switches multiplexer for extruders
|
||||||
|
|
||||||
pinMode(E_MUX0_PIN, OUTPUT);
|
pinMode(E_MUX0_PIN, OUTPUT);
|
||||||
pinMode(E_MUX1_PIN, OUTPUT);
|
pinMode(E_MUX1_PIN, OUTPUT);
|
||||||
pinMode(E_MUX2_PIN, OUTPUT);
|
|
||||||
|
|
||||||
switch (extr) {
|
switch (extr) {
|
||||||
case 1:
|
case 1:
|
||||||
WRITE(E_MUX0_PIN, HIGH);
|
WRITE(E_MUX0_PIN, HIGH);
|
||||||
WRITE(E_MUX1_PIN, LOW);
|
WRITE(E_MUX1_PIN, LOW);
|
||||||
WRITE(E_MUX2_PIN, LOW);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
WRITE(E_MUX0_PIN, LOW);
|
WRITE(E_MUX0_PIN, LOW);
|
||||||
WRITE(E_MUX1_PIN, HIGH);
|
WRITE(E_MUX1_PIN, HIGH);
|
||||||
WRITE(E_MUX2_PIN, LOW);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
WRITE(E_MUX0_PIN, HIGH);
|
WRITE(E_MUX0_PIN, HIGH);
|
||||||
WRITE(E_MUX1_PIN, HIGH);
|
WRITE(E_MUX1_PIN, HIGH);
|
||||||
WRITE(E_MUX2_PIN, LOW);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WRITE(E_MUX0_PIN, LOW);
|
WRITE(E_MUX0_PIN, LOW);
|
||||||
WRITE(E_MUX1_PIN, LOW);
|
WRITE(E_MUX1_PIN, LOW);
|
||||||
WRITE(E_MUX2_PIN, LOW);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -3305,7 +3300,7 @@ void change_extr(int extr) { //switches multiplexer for extruders
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_ext_nr() { //reads multiplexer input pins and return current extruder number (counted from 0)
|
static int get_ext_nr() { //reads multiplexer input pins and return current extruder number (counted from 0)
|
||||||
return(4 * READ(E_MUX2_PIN) + 2 * READ(E_MUX1_PIN) + READ(E_MUX0_PIN));
|
return(2 * READ(E_MUX1_PIN) + READ(E_MUX0_PIN));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3782,12 +3777,20 @@ void lcd_confirm_print()
|
||||||
_ret = 1;
|
_ret = 1;
|
||||||
filament_type = lcd_choose_color();
|
filament_type = lcd_choose_color();
|
||||||
prusa_statistics(4, filament_type);
|
prusa_statistics(4, filament_type);
|
||||||
|
no_response = true; //we need confirmation by recieving PRUSA thx
|
||||||
|
important_status = 4;
|
||||||
|
saved_filament_type = filament_type;
|
||||||
|
NcTime = millis();
|
||||||
}
|
}
|
||||||
if (cursor_pos == 2)
|
if (cursor_pos == 2)
|
||||||
{
|
{
|
||||||
_ret = 2;
|
_ret = 2;
|
||||||
filament_type = lcd_choose_color();
|
filament_type = lcd_choose_color();
|
||||||
prusa_statistics(5, filament_type);
|
prusa_statistics(5, filament_type);
|
||||||
|
no_response = true; //we need confirmation by recieving PRUSA thx
|
||||||
|
important_status = 5;
|
||||||
|
saved_filament_type = filament_type;
|
||||||
|
NcTime = millis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3858,7 +3861,7 @@ static void lcd_main_menu()
|
||||||
|
|
||||||
|
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if ( ( IS_SD_PRINTING || is_usb_printing ) && (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) && !homing_flag && !mesh_bed_leveling_flag)
|
if ( ( IS_SD_PRINTING || is_usb_printing ) && (current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU) && !homing_flag && !mesh_bed_leveling_flag)
|
||||||
{
|
{
|
||||||
MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z);//8
|
MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z);//8
|
||||||
|
|
@ -4118,7 +4121,7 @@ void lcd_sdcard_stop()
|
||||||
lcd_return_to_status();
|
lcd_return_to_status();
|
||||||
lcd_ignore_click(true);
|
lcd_ignore_click(true);
|
||||||
lcd_commands_type = LCD_COMMAND_STOP_PRINT;
|
lcd_commands_type = LCD_COMMAND_STOP_PRINT;
|
||||||
|
if (farm_mode) prusa_statistics(7);
|
||||||
// Turn off the print fan
|
// Turn off the print fan
|
||||||
SET_OUTPUT(FAN_PIN);
|
SET_OUTPUT(FAN_PIN);
|
||||||
WRITE(FAN_PIN, 0);
|
WRITE(FAN_PIN, 0);
|
||||||
|
|
@ -4168,14 +4171,16 @@ void lcd_sdcard_menu()
|
||||||
|
|
||||||
START_MENU();
|
START_MENU();
|
||||||
MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
|
MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
|
||||||
|
if (!farm_mode) {
|
||||||
#ifdef SDCARD_SORT_ALPHA
|
#ifdef SDCARD_SORT_ALPHA
|
||||||
EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));
|
EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));
|
||||||
switch(sdSort){
|
switch (sdSort) {
|
||||||
case SD_SORT_TIME: MENU_ITEM(function, MSG_SORT_TIME, lcd_sort_type_set); break;
|
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;
|
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);
|
default: MENU_ITEM(function, MSG_SORT_NONE, lcd_sort_type_set);
|
||||||
}
|
}
|
||||||
#endif // SDCARD_SORT_ALPHA
|
#endif // SDCARD_SORT_ALPHA
|
||||||
|
}
|
||||||
card.getWorkDirName();
|
card.getWorkDirName();
|
||||||
if (card.filename[0] == '/')
|
if (card.filename[0] == '/')
|
||||||
{
|
{
|
||||||
|
|
@ -5212,12 +5217,56 @@ void lcd_update(uint8_t lcdDrawUpdateOverride)
|
||||||
}
|
}
|
||||||
if (!SdFatUtil::test_stack_integrity()) stack_error();
|
if (!SdFatUtil::test_stack_integrity()) stack_error();
|
||||||
lcd_ping(); //check that we have received ping command if we are in farm mode
|
lcd_ping(); //check that we have received ping command if we are in farm mode
|
||||||
|
lcd_send_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_printer_connected() {
|
void lcd_printer_connected() {
|
||||||
printer_connected = true;
|
printer_connected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void lcd_send_status() {
|
||||||
|
if (farm_mode && no_response && ((millis() - NcTime) > (NC_TIME * 1000))) {
|
||||||
|
//send important status messages periodicaly
|
||||||
|
prusa_statistics(important_status, saved_filament_type);
|
||||||
|
NcTime = millis();
|
||||||
|
lcd_connect_printer();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static void lcd_connect_printer() {
|
||||||
|
lcd_update_enable(false);
|
||||||
|
lcd_implementation_clear();
|
||||||
|
|
||||||
|
bool pressed = false;
|
||||||
|
int i = 0;
|
||||||
|
int t = 0;
|
||||||
|
lcd_set_custom_characters_progress();
|
||||||
|
lcd_implementation_print_at(0, 0, "Connect printer to");
|
||||||
|
lcd_implementation_print_at(0, 1, "monitoring or hold");
|
||||||
|
lcd_implementation_print_at(0, 2, "the knob to continue");
|
||||||
|
while (no_response) {
|
||||||
|
i++;
|
||||||
|
t++;
|
||||||
|
delay_keep_alive(100);
|
||||||
|
proc_commands();
|
||||||
|
if (t == 10) {
|
||||||
|
prusa_statistics(important_status, saved_filament_type);
|
||||||
|
t = 0;
|
||||||
|
}
|
||||||
|
if (READ(BTN_ENC)) { //if button is not pressed
|
||||||
|
i = 0;
|
||||||
|
lcd_implementation_print_at(0, 3, " ");
|
||||||
|
}
|
||||||
|
if (i!=0) lcd_implementation_print_at((i * 20) / (NC_BUTTON_LONG_PRESS * 10), 3, "\x01");
|
||||||
|
if (i == NC_BUTTON_LONG_PRESS * 10) {
|
||||||
|
no_response = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lcd_set_custom_characters_degree();
|
||||||
|
lcd_update_enable(true);
|
||||||
|
lcd_update(2);
|
||||||
|
}
|
||||||
|
|
||||||
void lcd_ping() { //chceck if printer is connected to monitoring when in farm mode
|
void lcd_ping() { //chceck if printer is connected to monitoring when in farm mode
|
||||||
if (farm_mode) {
|
if (farm_mode) {
|
||||||
bool empty = is_buffer_empty();
|
bool empty = is_buffer_empty();
|
||||||
|
|
|
||||||
|
|
@ -266,4 +266,7 @@ void lcd_set_arrows();
|
||||||
void lcd_set_progress();
|
void lcd_set_progress();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void lcd_send_status();
|
||||||
|
static void lcd_connect_printer();
|
||||||
|
|
||||||
#endif //ULTRALCD_H
|
#endif //ULTRALCD_H
|
||||||
|
|
@ -831,7 +831,7 @@ static void lcd_implementation_status_screen()
|
||||||
if (heating_status != 0) { custom_message = true; }
|
if (heating_status != 0) { custom_message = true; }
|
||||||
|
|
||||||
// If printing from SD, show what we are printing
|
// If printing from SD, show what we are printing
|
||||||
if ((IS_SD_PRINTING) && !custom_message)
|
if (IS_SD_PRINTING)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(strcmp(longFilenameOLD, card.longFilename) != 0)
|
if(strcmp(longFilenameOLD, card.longFilename) != 0)
|
||||||
|
|
@ -840,38 +840,40 @@ static void lcd_implementation_status_screen()
|
||||||
sprintf_P(longFilenameOLD, PSTR("%s"), card.longFilename);
|
sprintf_P(longFilenameOLD, PSTR("%s"), card.longFilename);
|
||||||
scrollstuff = 0;
|
scrollstuff = 0;
|
||||||
}
|
}
|
||||||
|
if (!custom_message) {
|
||||||
|
|
||||||
if(strlen(card.longFilename) > LCD_WIDTH)
|
if (strlen(card.longFilename) > LCD_WIDTH)
|
||||||
{
|
|
||||||
|
|
||||||
int inters = 0;
|
|
||||||
int gh = scrollstuff;
|
|
||||||
while( ((gh-scrollstuff)<LCD_WIDTH) && (inters == 0) )
|
|
||||||
{
|
|
||||||
|
|
||||||
if(card.longFilename[gh] == '\0')
|
|
||||||
{
|
{
|
||||||
lcd.setCursor(gh-scrollstuff, 3);
|
|
||||||
lcd.print(card.longFilename[gh-1]);
|
int inters = 0;
|
||||||
scrollstuff = 0;
|
int gh = scrollstuff;
|
||||||
gh = scrollstuff;
|
while (((gh - scrollstuff) < LCD_WIDTH) && (inters == 0))
|
||||||
inters = 1;
|
{
|
||||||
}
|
|
||||||
|
if (card.longFilename[gh] == '\0')
|
||||||
|
{
|
||||||
|
lcd.setCursor(gh - scrollstuff, 3);
|
||||||
|
lcd.print(card.longFilename[gh - 1]);
|
||||||
|
scrollstuff = 0;
|
||||||
|
gh = scrollstuff;
|
||||||
|
inters = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lcd.setCursor(gh - scrollstuff, 3);
|
||||||
|
lcd.print(card.longFilename[gh - 1]);
|
||||||
|
gh++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
scrollstuff++;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lcd.setCursor(gh-scrollstuff, 3);
|
lcd.print(longFilenameOLD);
|
||||||
lcd.print(card.longFilename[gh-1]);
|
}
|
||||||
gh++;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
scrollstuff++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lcd.print(longFilenameOLD);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -391,6 +391,8 @@ THERMISTORS SETTINGS
|
||||||
#define PING_TIME 60 //time in s
|
#define PING_TIME 60 //time in s
|
||||||
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
||||||
#define PING_ALLERT_PERIOD 60 //time in s
|
#define PING_ALLERT_PERIOD 60 //time in s
|
||||||
|
#define NC_TIME 10 //time in s for periodic important status messages sending which needs reponse from monitoring
|
||||||
|
#define NC_BUTTON_LONG_PRESS 15 //time in s
|
||||||
|
|
||||||
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
||||||
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
||||||
|
|
|
||||||
|
|
@ -391,6 +391,8 @@ THERMISTORS SETTINGS
|
||||||
#define PING_TIME 60 //time in s
|
#define PING_TIME 60 //time in s
|
||||||
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
||||||
#define PING_ALLERT_PERIOD 60 //time in s
|
#define PING_ALLERT_PERIOD 60 //time in s
|
||||||
|
#define NC_TIME 10 //time in s for periodic important status messages sending which needs reponse from monitoring
|
||||||
|
#define NC_BUTTON_LONG_PRESS 15 //time in s
|
||||||
|
|
||||||
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
||||||
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
||||||
|
|
|
||||||
|
|
@ -386,6 +386,8 @@ THERMISTORS SETTINGS
|
||||||
#define PING_TIME 60 //time in s
|
#define PING_TIME 60 //time in s
|
||||||
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
||||||
#define PING_ALLERT_PERIOD 60 //time in s
|
#define PING_ALLERT_PERIOD 60 //time in s
|
||||||
|
#define NC_TIME 10 //time in s for periodic important status messages sending which needs reponse from monitoring
|
||||||
|
#define NC_BUTTON_LONG_PRESS 15 //time in s
|
||||||
|
|
||||||
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
||||||
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
||||||
|
|
|
||||||
|
|
@ -388,6 +388,8 @@ THERMISTORS SETTINGS
|
||||||
#define PING_TIME 60 //time in s
|
#define PING_TIME 60 //time in s
|
||||||
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
||||||
#define PING_ALLERT_PERIOD 60 //time in s
|
#define PING_ALLERT_PERIOD 60 //time in s
|
||||||
|
#define NC_TIME 10 //time in s for periodic important status messages sending which needs reponse from monitoring
|
||||||
|
#define NC_BUTTON_LONG_PRESS 15 //time in s
|
||||||
|
|
||||||
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
||||||
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
||||||
|
|
|
||||||
|
|
@ -386,6 +386,8 @@ THERMISTORS SETTINGS
|
||||||
#define PING_TIME 60 //time in s
|
#define PING_TIME 60 //time in s
|
||||||
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
||||||
#define PING_ALLERT_PERIOD 60 //time in s
|
#define PING_ALLERT_PERIOD 60 //time in s
|
||||||
|
#define NC_TIME 10 //time in s for periodic important status messages sending which needs reponse from monitoring
|
||||||
|
#define NC_BUTTON_LONG_PRESS 15 //time in s
|
||||||
|
|
||||||
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
||||||
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
||||||
|
|
|
||||||
|
|
@ -388,6 +388,8 @@ THERMISTORS SETTINGS
|
||||||
#define PING_TIME 60 //time in s
|
#define PING_TIME 60 //time in s
|
||||||
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
#define PING_TIME_LONG 600 //10 min; used when length of commands buffer > 0 to avoid false triggering when dealing with long gcodes
|
||||||
#define PING_ALLERT_PERIOD 60 //time in s
|
#define PING_ALLERT_PERIOD 60 //time in s
|
||||||
|
#define NC_TIME 10 //time in s for periodic important status messages sending which needs reponse from monitoring
|
||||||
|
#define NC_BUTTON_LONG_PRESS 15 //time in s
|
||||||
|
|
||||||
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
#define LONG_PRESS_TIME 1000 //time in ms for button long press
|
||||||
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
#define BUTTON_BLANKING_TIME 200 //time in ms for blanking after button release
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue