Browse Source

Update 'esp_rc_ctrl/esp_rc_ctrl.ino'

The rc control firmware should run more smooth now
klaute 1 year ago
parent
commit
9725c841d8
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      esp_rc_ctrl/esp_rc_ctrl.ino

+ 5
- 2
esp_rc_ctrl/esp_rc_ctrl.ino View File

@@ -249,8 +249,11 @@ void loop()
249 249
         uint8_t timeout = 0;
250 250
         char c = -1;
251 251
         do {
252
-            c = Serial.read();
253
-            sock.write(c);
252
+            if (Serial.available() > 0 and timeout < 2*MSG_LENGTH)
253
+            {
254
+                c = Serial.read();
255
+                sock.write(c);
256
+            }
254 257
             timeout++;
255 258
         } while(c > -1 && timeout < 2*MSG_LENGTH);
256 259
 

Loading…
Cancel
Save