Send M105 only if no temperature is sent

so went printer is heating and automaticaly send temperature no M105 is
necessary
Add some yield() to avoid possible WD triggered
This commit is contained in:
luc 2015-07-13 11:49:20 +08:00
parent f12d7d9abb
commit 3aedb9c019
2 changed files with 7 additions and 1 deletions

View File

@ -112,6 +112,7 @@ uint8_t i,data;
serverClients[i] = data_server->available();
continue;
}
yield();
}
//no free/disconnected spot so reject
WiFiClient serverClient = data_server->available();
@ -127,6 +128,7 @@ uint8_t i,data;
Serial.write(data);
COMMAND::read_buffer_tcp(data);
}
yield();
}
}
}

View File

@ -482,6 +482,7 @@ void handle_web_interface_root()
{
istatus++;
stationtmp = STAILQ_NEXT(stationtmp, next);
yield();
}
//start table as at least one connected
buffer2send+=(PROGMEM2CHAR(TABLE_START));
@ -500,6 +501,7 @@ void handle_web_interface_root()
istatus=0;
while(station)
{
yield();
istatus++;
//display each client
buffer2send+=(PROGMEM2CHAR(TR_S));
@ -1483,7 +1485,6 @@ void handle_web_interface_printer()
void handle_web_interface_status()
{
Serial.println("M105");
Serial.println("M114");
String buffer2send =(PROGMEM2CHAR(DATA_S));
String description;
@ -1491,6 +1492,9 @@ void handle_web_interface_status()
static bool flashit = true;
int temperature,target;
flashit=!flashit;
//request temperature only if no feedback
if ((system_get_time()-web_interface->last_temp)>3000000)
Serial.println("M105");
if ((system_get_time()-web_interface->last_temp)<3200000)
{
if (flashit)status_color="lime";