Improve pause function work

Fix disconnecting from qgc while pausing in the simulation. 
Consider total delay time in micros() in simulation to increase t while delaying.
Simplify and get rid of ARDUINO macro check.
This commit is contained in:
Oleg Kalachev
2025-07-12 09:29:47 +03:00
parent fd4bcbeb89
commit 85afe405cb
2 changed files with 5 additions and 6 deletions

View File

@@ -53,7 +53,6 @@ void print(const char* format, ...) {
}
void pause(float duration) {
#if ARDUINO
double start = t;
while (t - start < duration) {
step();
@@ -61,11 +60,8 @@ void pause(float duration) {
#if WIFI_ENABLED
processMavlink();
#endif
delay(50);
}
#else
// Code above won't work in the simulation
delay(duration * 1000);
#endif
}
void doCommand(String str, bool echo = false) {