mirror of
https://github.com/okalachev/flix.git
synced 2025-08-17 17:16:10 +00:00
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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user