Skip to content
Snippets Groups Projects
Commit 42960efe authored by Michael Oborne's avatar Michael Oborne
Browse files

sitl cygwin mods

parent 010f147f
No related branches found
No related tags found
No related merge requests found
...@@ -83,6 +83,12 @@ int main(int argc, char * const argv[]) ...@@ -83,6 +83,12 @@ int main(int argc, char * const argv[])
struct timeval tv; struct timeval tv;
fd_set fds; fd_set fds;
int fd_high = 0; int fd_high = 0;
#ifdef __CYGWIN__
// under windows if this loop is using alot of cpu,
// the alarm gets called at a slower rate.
sleep(5);
#endif
FD_ZERO(&fds); FD_ZERO(&fds);
loop(); loop();
......
...@@ -231,6 +231,17 @@ static void timer_handler(int signum) ...@@ -231,6 +231,17 @@ static void timer_handler(int signum)
if (kill(parent_pid, 0) != 0) { if (kill(parent_pid, 0) != 0) {
exit(1); exit(1);
} }
#else
static uint16_t count = 0;
static uint32_t last_report;
count++;
if (millis() - last_report > 1000) {
printf("TH %u cps\n", count);
count = 0;
last_report = millis();
}
#endif #endif
/* check for packet from flight sim */ /* check for packet from flight sim */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment