farm mode ping

This commit is contained in:
PavelSindler 2017-03-06 15:20:24 +01:00
parent 062612f96a
commit f6edfb7c19
2 changed files with 11 additions and 2 deletions

View file

@ -231,7 +231,7 @@ CardReader card;
unsigned long TimeSent = millis();
unsigned long TimeNow = millis();
unsigned long PingTime = millis();
union Data
{
byte b[2];
@ -1954,7 +1954,13 @@ void process_commands()
int8_t SilentMode;
#endif
if(code_seen("PRUSA")){
if (code_seen("PRN")) {
if (code_seen("Ping")) {
if (farm_mode) {
PingTime = millis();
MYSERIAL.print(farm_no); MYSERIAL.println(" : OK");
}
}
else if (code_seen("PRN")) {
MYSERIAL.println(status_number);
}else if (code_seen("fn")) {

View file

@ -4473,6 +4473,9 @@ void lcd_update(uint8_t lcdDrawUpdateOverride)
lcd_next_update_millis = millis() + LCD_UPDATE_INTERVAL;
}
if (!SdFatUtil::test_stack_integrity()) stack_error();
if (farm_mode && ((millis() - PingTime) > PING_TIME * 1000)) {
// beep once per minute
}
}
void lcd_ignore_click(bool b)