ArduinoOTA endless loop (#1533)
* Changed pinmap to show pins34-39 as GPI * ArduinoOTA could have endless loop b/c udp.read can return negative result
This commit is contained in:
parent
a59eafbc9d
commit
cde668dada
@ -149,13 +149,13 @@ int ArduinoOTAClass::parseInt(){
|
|||||||
|
|
||||||
String ArduinoOTAClass::readStringUntil(char end){
|
String ArduinoOTAClass::readStringUntil(char end){
|
||||||
String res = "";
|
String res = "";
|
||||||
char value;
|
int value;
|
||||||
while(true){
|
while(true){
|
||||||
value = _udp_ota.read();
|
value = _udp_ota.read();
|
||||||
if(value == '\0' || value == end){
|
if(value <= 0 || value == end){
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
res += value;
|
res += (char)value;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user